summaryrefslogtreecommitdiff
path: root/src/lua5/imlua_image.c
diff options
context:
space:
mode:
authorscuri <scuri>2009-08-18 02:21:01 +0000
committerscuri <scuri>2009-08-18 02:21:01 +0000
commit77a4608ee1f828ed70ec58588f0229cd57758148 (patch)
treeb1550da93d53331715c200f1acf8a7c1b2ff7be9 /src/lua5/imlua_image.c
parente2726d7bef3b0a1684011e558cb68ca99cfecd75 (diff)
*** empty log message ***
Diffstat (limited to 'src/lua5/imlua_image.c')
-rw-r--r--src/lua5/imlua_image.c50
1 files changed, 18 insertions, 32 deletions
diff --git a/src/lua5/imlua_image.c b/src/lua5/imlua_image.c
index dc3322a..d823ac1 100644
--- a/src/lua5/imlua_image.c
+++ b/src/lua5/imlua_image.c
@@ -2,7 +2,7 @@
* \brief IM Lua 5 Binding
*
* See Copyright Notice in im_lib.h
- * $Id: imlua_image.c,v 1.2 2009/08/12 04:09:17 scuri Exp $
+ * $Id: imlua_image.c,v 1.3 2009/08/18 02:23:33 scuri Exp $
*/
#include <string.h>
@@ -1055,40 +1055,26 @@ static void createmeta (lua_State *L)
lua_pop(L, 1); /* removes the metatable from the top of the stack */
}
-/* If all parameteres, besides the image, are nil, this is equivalent to image:Clone.
- If any parameter is not nil, then the value is used instead of the one from the source image.
- If a parameter is a function, then the function is called, passing the source
- image as parameter, to obtain the substituion value. */
-static void reg_image(lua_State *L)
-{
- const char* data = {
-"function im.ImageCreateBased(image, width, height, color_space, data_type) \n"
-" -- default values are those of the source image \n"
-" width = width or image:Width() \n"
-" height = height or image:Height() \n"
-" color_space = color_space or image:ColorSpace() \n"
-" data_type = data_type or image:DataType() \n"
-" \n"
-" -- callback to calculate parameters based on source image \n"
-" if type(width) == \"function\" then width = width(image) end \n"
-" if type(height) == \"function\" then height = height(image) end \n"
-" if type(color_space) == \"function\" then color_space = color_space(image) end \n"
-" if type(data_type) == \"function\" then data_type = data_type(image) end \n"
-" \n"
-" -- create a new image \n"
-" new_image = im.ImageCreate(width, height, color_space, data_type) \n"
-" image:CopyAttributes(new_image) \n"
-" return new_image \n"
-"end \n"
- };
-
- if (luaL_loadbuffer(L, data, strlen(data), "reg_image")==0) lua_pcall(L, 0, 0, 0);
-}
-
void imlua_open_image (lua_State *L)
{
/* "im" table is at the top of the stack */
createmeta(L);
luaL_register(L, NULL, imimage_lib);
- reg_image(L);
+#ifdef TEC_BIGENDIAN
+#ifdef TEC_64
+#include "loh/im_image_be64.loh"
+#else
+#include "loh/im_image_be32.loh"
+#endif
+#else
+#ifdef TEC_64
+#ifdef WIN64
+#include "loh/im_image_le64w.loh"
+#else
+#include "loh/im_image_le64.loh"
+#endif
+#else
+#include "loh/im_image.loh"
+#endif
+#endif
}