diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lua5/imlua_aux.c | 3 | ||||
-rw-r--r-- | src/lua5/imlua_convert.c | 6 | ||||
-rw-r--r-- | src/lua5/imlua_file.c | 8 | ||||
-rw-r--r-- | src/lua5/imlua_process.c | 19 |
4 files changed, 18 insertions, 18 deletions
diff --git a/src/lua5/imlua_aux.c b/src/lua5/imlua_aux.c index d5df8ac..e472dca 100644 --- a/src/lua5/imlua_aux.c +++ b/src/lua5/imlua_aux.c @@ -2,7 +2,7 @@ * \brief IM Lua 5 Binding * * See Copyright Notice in im_lib.h - * $Id: imlua_aux.c,v 1.1 2008/10/17 06:16:32 scuri Exp $ + * $Id: imlua_aux.c,v 1.2 2009/08/04 21:35:26 scuri Exp $ */ #include <memory.h> @@ -20,6 +20,7 @@ #include "imlua_aux.h" #include "imlua_image.h" + /*****************************************************************************\ \*****************************************************************************/ int imlua_getn (lua_State *L, int index) diff --git a/src/lua5/imlua_convert.c b/src/lua5/imlua_convert.c index 5ec73c9..96b8429 100644 --- a/src/lua5/imlua_convert.c +++ b/src/lua5/imlua_convert.c @@ -2,7 +2,7 @@ * \brief IM Lua 5 Binding * * See Copyright Notice in im_lib.h - * $Id: imlua_convert.c,v 1.1 2008/10/17 06:16:32 scuri Exp $ + * $Id: imlua_convert.c,v 1.2 2009/08/04 21:35:26 scuri Exp $ */ #include "im.h" @@ -25,7 +25,7 @@ static int imluaConvertDataType (lua_State *L) imImage* dst_image = imlua_checkimage(L, 2); int cpx2real = luaL_checkint(L, 3); float gamma = (float) luaL_checknumber(L, 4); - int abssolute = luaL_checkint(L, 5); + int abssolute = lua_toboolean(L, 5); int cast_mode = luaL_checkint(L, 6); imlua_matchcolorspace(L, src_image, dst_image); @@ -55,7 +55,7 @@ static int imluaConvertToBitmap (lua_State *L) imImage* dst_image = imlua_checkimage(L, 2); int cpx2real = luaL_checkint(L, 3); float gamma = (float) luaL_checknumber(L, 4); - int abssolute = luaL_checkint(L, 5); + int abssolute = lua_toboolean(L, 5); int cast_mode = luaL_checkint(L, 6); imlua_matchsize(L, src_image, dst_image); diff --git a/src/lua5/imlua_file.c b/src/lua5/imlua_file.c index fd20c36..066dd76 100644 --- a/src/lua5/imlua_file.c +++ b/src/lua5/imlua_file.c @@ -2,7 +2,7 @@ * \brief IM Lua 5 Binding * * See Copyright Notice in im_lib.h - * $Id: imlua_file.c,v 1.1 2008/10/17 06:16:32 scuri Exp $ + * $Id: imlua_file.c,v 1.2 2009/08/04 21:35:26 scuri Exp $ */ #include <string.h> @@ -542,20 +542,20 @@ static int imluaFileWriteImageInfo (lua_State *L) } /*****************************************************************************\ - file:imFileReadImageData(data) + file:ReadImageData(data) \*****************************************************************************/ static int imluaFileReadImageData (lua_State *L) { imFile *ifile = imlua_checkfile(L, 1); void* data = lua_touserdata(L, 2); - int convert2bitmap = luaL_checkint(L, 3); + int convert2bitmap = lua_toboolean(L, 3); int color_mode_flags = luaL_checkint(L, 4); imlua_pusherror(L, imFileReadImageData(ifile, data, convert2bitmap, color_mode_flags)); return 1; } /*****************************************************************************\ - file:imFileWriteImageData(data) + file:WriteImageData(data) \*****************************************************************************/ static int imluaFileWriteImageData (lua_State *L) { diff --git a/src/lua5/imlua_process.c b/src/lua5/imlua_process.c index 6f08588..492a1ba 100644 --- a/src/lua5/imlua_process.c +++ b/src/lua5/imlua_process.c @@ -2,7 +2,7 @@ * \brief IM Lua 5 Binding * * See Copyright Notice in im_lib.h - * $Id: imlua_process.c,v 1.4 2009/07/03 17:45:13 scuri Exp $ + * $Id: imlua_process.c,v 1.5 2009/08/04 21:35:26 scuri Exp $ */ #include <memory.h> @@ -724,7 +724,7 @@ static int imluaProcessRotateRef (lua_State *L) double sin0 = (double) luaL_checknumber(L, 4); int x = luaL_checkint(L, 5); int y = luaL_checkint(L, 6); - int to_origin = luaL_checkint(L, 7); + int to_origin = lua_toboolean(L, 7); int order = luaL_checkint(L, 8); imlua_matchcolor(L, src_image, dst_image); @@ -741,7 +741,7 @@ static int imluaProcessRotate90 (lua_State *L) { imImage *src_image = imlua_checkimage(L, 1); imImage *dst_image = imlua_checkimage(L, 2); - int dir = luaL_checkint(L, 3); + int dir = lua_toboolean(L, 3); imlua_matchcolor(L, src_image, dst_image); luaL_argcheck(L, dst_image->width == src_image->height && dst_image->height == src_image->width, 2, "destiny width and height must have the source height and width"); @@ -1010,7 +1010,7 @@ static int imluaProcessBinMorphConvolve (lua_State *L) imImage *src_image = imlua_checkimage(L, 1); imImage *dst_image = imlua_checkimage(L, 2); imImage *kernel = imlua_checkimage(L, 3); - int hit_white = luaL_checkint(L, 4); + int hit_white = lua_toboolean(L, 4); int iter = luaL_checkint(L, 5); imlua_checkcolorspace(L, 1, src_image, IM_BINARY); @@ -1659,7 +1659,7 @@ static int imluaProcessSplitComplex (lua_State *L) imImage *src_image = imlua_checkimage(L, 1); imImage *dst_image1 = imlua_checkimage(L, 2); imImage *dst_image2 = imlua_checkimage(L, 3); - int polar = luaL_checkint(L, 4); + int polar = lua_toboolean(L, 4); imlua_checkdatatype(L, 1, src_image, IM_CFLOAT); imlua_checkdatatype(L, 2, dst_image1, IM_FLOAT); @@ -1783,7 +1783,7 @@ static int imluaProcessAutoCovariance (lua_State *L) imlua_matchcolorspace(L, src_image, dst_image); imlua_checkdatatype(L, 3, dst_image, IM_FLOAT); - lua_pushnumber(L, imProcessAutoCovariance(src_image, mean_image, dst_image)); + lua_pushboolean(L, imProcessAutoCovariance(src_image, mean_image, dst_image)); return 1; } @@ -1815,7 +1815,7 @@ static int imluaProcessQuantizeRGBUniform (lua_State *L) { imImage *src_image = imlua_checkimage(L, 1); imImage *dst_image = imlua_checkimage(L, 2); - int dither = luaL_checkint(L, 3); + int dither = lua_toboolean(L, 3); imlua_checktype(L, 1, src_image, IM_RGB, IM_BYTE); imlua_checkcolorspace(L, 2, dst_image, IM_MAP); @@ -2131,7 +2131,7 @@ static int imluaProcessBitPlane (lua_State *L) imImage *src_image = imlua_checkimage(L, 1); imImage *dst_image = imlua_checkimage(L, 2); int plane = luaL_checkint(L, 3); - int reset = luaL_checkint(L, 4); + int reset = lua_toboolean(L, 4); imlua_checkdatatype(L, 1, src_image, IM_BYTE); imlua_match(L, src_image, dst_image); @@ -2201,7 +2201,7 @@ static float imluaRenderCondFunc (int x, int y, int d, int *cond, float *param) lua_call(L, 4, 2); - *cond = luaL_checkint(L, -1); + *cond = lua_toboolean(L, -1); return (float) luaL_checknumber(L, -2); } @@ -3088,4 +3088,3 @@ int luaopen_imlua_process51(lua_State *L) { return imlua_open_process(L); } - |