diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2010-09-09 02:26:30 +0200 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2010-09-09 02:32:26 +0200 |
commit | 7505e88db66798b2b8fcdff2d92a7136cd826b5b (patch) | |
tree | b6ced565318f8e8112e35cb0ad53abe4212ef8de /iup/srclua5/image.lua | |
parent | e9a184546b18cf3b796bd560561f312934004c54 (diff) |
Upgrading to IUP 3.2 - and cleaning up.
Diffstat (limited to 'iup/srclua5/image.lua')
-rwxr-xr-x | iup/srclua5/image.lua | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/iup/srclua5/image.lua b/iup/srclua5/image.lua index 3a82063..dffd8bd 100755 --- a/iup/srclua5/image.lua +++ b/iup/srclua5/image.lua @@ -19,26 +19,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); @@ -47,7 +47,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++) { @@ -65,7 +65,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++) { |