From 7b52cc13af4e85f1ca2deb6b6c77de9c95ea0dcf Mon Sep 17 00:00:00 2001 From: scuri Date: Fri, 17 Oct 2008 06:10:33 +0000 Subject: First commit - moving from LuaForge to SourceForge --- html/en/cdluaim.html | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 html/en/cdluaim.html (limited to 'html/en/cdluaim.html') 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 @@ + + + + CDLua+IMLua + + + + + +

CDLua+IMLua

+ +

+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 imImage + structure to the cdBitmap structure and add some facilities to draw +on an imImage using a CD + canvas. See also the IM documentation.

Color values and palettes can be created and used transparently in both libraries. Palettes and color values are + 100% compatible between CD and IM.

+ + +

+ You must link the application with the "cdluaim51" library.

+See also the IM +documentation.

int cdluaim_open(lua_State* L); [in C] [for Lua 5]
+ +

+Must be called to enable the additional methods. Can be called only after CDLua +and IMLua were initialized. require"cdluaim" can also be used.
+ Returns 0 (leaves nothing on the top of the stack).


+

Available methods

+
bitmap:imImageCreate() -> image: imImage [in Lua] 
+
+

Creates an imImage from a cdBitmap.

+
image:cdCreateBitmap() -> bitmap: cdBitmap [in Lua]
+

Creates a cdBitmap from an imImage. The imImage must be a bitmap image, see +"image:IsBitmap".

+
image:cdInitBitmap() -> bitmap: cdBitmap [in Lua]
+

Creates a cdBitmap from an imImage, but reuses image data. When the +cdBitmap is destroyed, the data is preserved.

+
image:cdCanvasPutImageRect(canvas: cdCanvas, x: number, y: number, w: number, h: number, xmin: number, xmax: number, ymin: number, ymax: number) [in Lua] 
+

    Draws the imImage into the given cdCanvas. The imImage must be a +bitmap image, see \ref imImageIsBitmap.

+
image:wdCanvasPutImageRect(canvas: cdCanvas, x: number, y: number, w: number, h: number, xmin: number, xmax: number, ymin: number, ymax: number) [in Lua]     
+

Draws the imImage into the given cdCanvas using world coordinates. The +imImage must be a bitmap image, see \ref imImageIsBitmap.

+
image:cdCanvasGetImage(canvas: cdCanvas, x: number, y: number) [in Lua]     
+

Retrieve the imImage data from the given cdCanvas. The imImage must be a +IM_RGB/IM_BYTE image.

+
image:cdCreateCanvas([res: number]) -> canvas: cdCanvas [in Lua]    
+

 Creates a cdCanvas using the CD_IMAGERGB driver. Resolution is optional, + default is 3.8 pixels per milimiter (96.52 DPI). The imImage must be a + IM_RGB/IM_BYTE image.

+ + -- cgit v1.2.3