summaryrefslogtreecommitdiff
path: root/iup/srclua5/il_image.c
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2010-09-09 02:26:30 +0200
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2010-09-09 02:32:26 +0200
commit7505e88db66798b2b8fcdff2d92a7136cd826b5b (patch)
treeb6ced565318f8e8112e35cb0ad53abe4212ef8de /iup/srclua5/il_image.c
parente9a184546b18cf3b796bd560561f312934004c54 (diff)
Upgrading to IUP 3.2 - and cleaning up.
Diffstat (limited to 'iup/srclua5/il_image.c')
-rwxr-xr-xiup/srclua5/il_image.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/iup/srclua5/il_image.c b/iup/srclua5/il_image.c
index 4be480d..382f17a 100755
--- a/iup/srclua5/il_image.c
+++ b/iup/srclua5/il_image.c
@@ -25,26 +25,26 @@ static int Image (lua_State * L)
int i, j;
/* get the number of lines */
- h = luaL_getn(L, 1);
+ h = iuplua_getn(L, 1);
/* get the number of columns of the first line */
- lua_pushnumber(L, 1);
+ lua_pushinteger(L, 1);
lua_gettable(L, 1);
- w = luaL_getn(L, -1);
+ w = iuplua_getn(L, -1);
lua_pop(L, 1);
pixels = (unsigned char *) malloc (h*w);
for (i=1; i<=h; i++)
{
- lua_pushnumber(L, i);
+ lua_pushinteger(L, i);
lua_gettable(L, 1);
for (j=1; j<=w; j++)
{
int idx = (i-1)*w+(j-1);
- lua_pushnumber(L, j);
+ lua_pushinteger(L, j);
lua_gettable(L, -2);
- pixels[idx] = (unsigned char)lua_tonumber(L, -1);
+ pixels[idx] = (unsigned char)lua_tointeger(L, -1);
lua_pop(L, 1);
}
lua_pop(L, 1);
@@ -53,7 +53,7 @@ static int Image (lua_State * L)
ih = IupImage(w,h,pixels);
free(pixels);
- num_colors = luaL_getn(L, 2);
+ num_colors = iuplua_getn(L, 2);
num_colors = num_colors>255? 255: num_colors;
for(c=1; c<=num_colors; c++)
{
@@ -71,7 +71,7 @@ static int Image (lua_State * L)
ih = IupImage(w, h, pixels);
free(pixels);
- num_colors = luaL_getn(L, 4);
+ num_colors = iuplua_getn(L, 4);
num_colors = num_colors>256? 256: num_colors;
for(c=1; c<=num_colors; c++)
{