IM: imlua.h Source File
From IM - An Imaging Tool
imlua.h
Go to the documentation of this file.00001 /** \file 00002 * \brief IM Lua 5 Binding 00003 * 00004 * See Copyright Notice in im_lib.h 00005 */ 00006 00007 #ifndef __IMLUA_H 00008 #define __IMLUA_H 00009 00010 #ifdef __cplusplus 00011 extern "C" { 00012 #endif 00013 00014 /** \defgroup imlua IM Lua 5 Binding 00015 * \par 00016 * Binding for the Lua 5 scripting language. Works with versions 5.0 and 5.1. \n 00017 * Lua 5.0.2 Copyright (C) 1994-2004 Tecgraf, PUC-Rio \n 00018 * Lua 5.1 Copyright (C) 1994-2005 Lua.org, PUC-Rio \n 00019 * R. Ierusalimschy, L. H. de Figueiredo & W. Celes \n 00020 * http://www.lua.org 00021 * \par 00022 * The name of the functions were changed because of the namespace "im" and because of the object orientation. \n 00023 * As a general rule use: 00024 \verbatim 00025 imXxx -> im.Xxx 00026 IM_XXX -> im.XXX 00027 imFileXXX(ifile,... -> ifile:XXX(... 00028 imImageXXX(image,... -> image:XXX(... 00029 \endverbatim 00030 * All the objects are garbage collected by the Lua garbage collector. 00031 * \par 00032 * See \ref imlua.h 00033 * \ingroup util */ 00034 00035 #ifdef LUA_NOOBJECT /* Lua 3 */ 00036 void imlua_open(void); 00037 #endif 00038 00039 #ifdef LUA_TNONE /* Lua 5 */ 00040 00041 /** Initializes the Lua binding of the main IM library. \n 00042 * Returns 1 (leaves the "im" table on the top of the stack). 00043 * You must link the application with the "imlua5" library. 00044 * \ingroup imlua */ 00045 int imlua_open(lua_State *L); 00046 int luaopen_imlua(lua_State *L); 00047 00048 /** Initializes the Lua binding of the capture library. \n 00049 * Returns 1 (leaves the "im" table on the top of the stack). 00050 * You must link the application with the "imlua_capture5" library. 00051 * \ingroup imlua */ 00052 int imlua_open_capture(lua_State *L); 00053 int luaopen_imlua_capture(lua_State *L); 00054 00055 /** Initializes the Lua binding of the process library. \n 00056 * Returns 1 (leaves the "im" table on the top of the stack). 00057 * You must link the application with the "imlua_process5" library. 00058 * \ingroup imlua */ 00059 int imlua_open_process(lua_State *L); 00060 int luaopen_imlua_process(lua_State *L); 00061 00062 /** Initializes the Lua binding of the fourier transform library. \n 00063 * Returns 1 (leaves the "im" table on the top of the stack). 00064 * You must link the application with the "imlua_fftw5" library. 00065 * \ingroup imlua */ 00066 int imlua_open_fftw(lua_State *L); 00067 int luaopen_imlua_fftw(lua_State *L); 00068 00069 /** Initializes the Lua binding of addicional functions for the CD library. \n 00070 * Returns 1 (leaves the "im" table on the top of the stack). 00071 * CD library is a 2D graphics library (http://www.tecgraf.puc-rio.br/cd) \n 00072 * You must link the application with the "imlua_cd5" library. 00073 * 00074 * The following functions are defined: 00075 * \verbatim bitmap:imImageCreate() -> image: imImage [in Lua 5] 00076 Creates an imImage from a cdBitmap. \endverbatim 00077 * 00078 * \verbatim image:cdCreateBitmap() -> bitmap: cdBitmap [in Lua 5] 00079 Creates a cdBitmap from an imImage. 00080 The imImage must be a bitmap image, see \ref imImageIsBitmap. \endverbatim 00081 * 00082 * \verbatim image:cdInitBitmap() -> bitmap: cdBitmap [in Lua 5] 00083 Creates a cdBitmap from an imImage, but reuses image data. 00084 When the cdBitmap is destroyed, the data is preserved. \endverbatim 00085 * 00086 * \verbatim image:cdCanvasPutImageRect(canvas: cdCanvas, x: number, y: number, w: number, h: number, xmin: number, xmax: number, ymin: number, ymax: number) [in Lua 5] 00087 Draws the imImage into the given cdCanvas. 00088 The imImage must be a bitmap image, see \ref imImageIsBitmap. \endverbatim 00089 * 00090 * \verbatim image:wdCanvasPutImageRect(canvas: cdCanvas, x: number, y: number, w: number, h: number, xmin: number, xmax: number, ymin: number, ymax: number) [in Lua 5] 00091 Draws the imImage into the given cdCanvas using world coordinates. 00092 The imImage must be a bitmap image, see \ref imImageIsBitmap. \endverbatim 00093 * 00094 * \verbatim image:cdCanvasGetImage(canvas: cdCanvas, x: number, y: number) [in Lua 5] 00095 Retrieve the imImage data from the given cdCanvas. 00096 The imImage must be a IM_RGB/IM_BYTE image. \endverbatim 00097 * 00098 * \verbatim image:cdCreateCanvas([res: number]) -> canvas: cdCanvas [in Lua 5] 00099 Creates a cdCanvas using the CD_IMAGERGB driver. Resolution is optional, default is 3.8 pixels per milimiter (96.52 DPI). 00100 The imImage must be a IM_RGB/IM_BYTE image. \endverbatim 00101 * 00102 * \ingroup imlua */ 00103 int imlua_open_cd(lua_State *L); 00104 int luaopen_imlua_cd(lua_State *L); 00105 00106 00107 #endif 00108 00109 #ifdef __cplusplus 00110 } 00111 #endif 00112 00113 #endif