summaryrefslogtreecommitdiff
path: root/html/en/cdluaim.html
diff options
context:
space:
mode:
Diffstat (limited to 'html/en/cdluaim.html')
-rw-r--r--html/en/cdluaim.html54
1 files changed, 54 insertions, 0 deletions
diff --git a/html/en/cdluaim.html b/html/en/cdluaim.html
new file mode 100644
index 0000000..707539d
--- /dev/null
+++ b/html/en/cdluaim.html
@@ -0,0 +1,54 @@
+<!doctype HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+ <head>
+ <title>CDLua+IMLua</title>
+ <meta http-equiv="Content-Language" content="en-us">
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <link rel="stylesheet" type="text/css" href="../style.css">
+ </head>
+ <body>
+ <h2 align="center">CDLua+IMLua</h2>
+
+<p>
+When CD is used togheter with the IM library in Lua, the CD bitmap and the IM
+image objects in Lua have a few more methods. These methods allow to map the <font face="Courier New">imImage</font>
+ structure to the <font face="Courier New">cdBitmap</font> structure and add some facilities to draw
+on an imImage using a CD
+ canvas. See also the <a target="_blank" href="http://www.tecgraf.puc-rio.br/im">IM documentation</a>.<p>Color values and palettes can be created and used transparently in both libraries. Palettes and color values are
+ 100% compatible between CD and IM.</p>
+
+
+ <p>
+ You must link the application with the "cdluaim51" library.<p>
+See also the <a target="_top" href="http://www.tecgraf.puc-rio.br/im">IM
+documentation</a>.<pre class="function">int <strong><span style="font-size: 110%"><a name="cdlua_open">cdluaim_open</a></span></strong>(lua_State* L); [in C] [for Lua 5]</pre>
+
+ <p>
+Must be called to enable the additional methods. Can be called only after CDLua
+and IMLua were initialized. require&quot;cdluaim&quot; can also be used. <br>
+ Returns 0 (leaves nothing on the top of the stack).<hr>
+ <h3>Available methods</h3>
+ <pre class="function">bitmap:imImageCreate() -&gt; image: imImage [in Lua]
+</pre>
+<p>Creates an imImage from a cdBitmap.</p>
+<pre class="function">image:cdCreateBitmap() -&gt; bitmap: cdBitmap [in Lua]</pre>
+<p>Creates a cdBitmap from an imImage. The imImage must be a bitmap image, see
+&quot;image:<strong>IsBitmap</strong>&quot;. </p>
+<pre class="function">image:cdInitBitmap() -&gt; bitmap: cdBitmap [in Lua]</pre>
+<p>Creates a cdBitmap from an imImage, but reuses image data. When the
+cdBitmap is destroyed, the data is preserved. </p>
+<pre class="function">image:cdCanvasPutImageRect(canvas: cdCanvas, x: number, y: number, w: number, h: number, xmin: number, xmax: number, ymin: number, ymax: number) [in Lua] </pre>
+<p>&nbsp;&nbsp;&nbsp; Draws the imImage into the given cdCanvas. The imImage must be a
+bitmap image, see \ref imImageIsBitmap. </p>
+<pre class="function">image:wdCanvasPutImageRect(canvas: cdCanvas, x: number, y: number, w: number, h: number, xmin: number, xmax: number, ymin: number, ymax: number) [in Lua] </pre>
+<p>Draws the imImage into the given cdCanvas using world coordinates. The
+imImage must be a bitmap image, see \ref imImageIsBitmap. </p>
+<pre class="function">image:cdCanvasGetImage(canvas: cdCanvas, x: number, y: number) [in Lua] </pre>
+<p>Retrieve the imImage data from the given cdCanvas. The imImage must be a
+IM_RGB/IM_BYTE image. </p>
+<pre class="function">image:cdCreateCanvas([res: number]) -&gt; canvas: cdCanvas [in Lua] </pre>
+ <p>&nbsp;Creates a cdCanvas using the <a href="drv/irgb.html">CD_IMAGERGB</a> driver. Resolution is optional,
+ default is 3.8 pixels per milimiter (96.52 DPI). The imImage must be a
+ IM_RGB/IM_BYTE image. </p>
+</BODY>
+</HTML>