summaryrefslogtreecommitdiff
path: root/im/src
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2010-09-09 01:06:43 +0200
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2010-09-09 01:06:47 +0200
commit92efe73791d0998536042bfab5a1babc67d168c7 (patch)
tree6c5f7e9d9a8e5b439f50821f498ae6f6df776f36 /im/src
parentf23d91bd3ba87c8fe6691af9ebd1a5210e2fbaec (diff)
Upgrading to IM 3.6.2, and doing some cleanup at the same time.
Diffstat (limited to 'im/src')
-rwxr-xr-xim/src/config.mak89
-rwxr-xr-xim/src/im_capture.def2
-rwxr-xr-xim/src/im_capture.mak73
-rwxr-xr-xim/src/im_capture_dx.cpp15
-rwxr-xr-xim/src/im_ecw.mak16
-rwxr-xr-xim/src/im_format_ico.cpp12
-rwxr-xr-xim/src/im_lib.cpp11
-rwxr-xr-xim/src/im_process.mak36
-rwxr-xr-xim/src/im_wmv.mak23
-rwxr-xr-xim/src/imlua3.mak12
-rwxr-xr-xim/src/imlua5.mak18
-rwxr-xr-xim/src/imlua_capture5.mak18
-rwxr-xr-xim/src/imlua_process5.mak19
-rwxr-xr-xim/src/imlua_wmv.mak17
-rwxr-xr-xim/src/lua5/imlua.c7
-rwxr-xr-xim/src/lua5/imlua.def1
-rwxr-xr-xim/src/lua5/imlua_aux.c6
-rwxr-xr-xim/src/lua5/imlua_aux.h7
-rwxr-xr-xim/src/lua5/imlua_avi.c5
-rwxr-xr-xim/src/lua5/imlua_avi.def1
-rwxr-xr-xim/src/lua5/imlua_capture.c21
-rwxr-xr-xim/src/lua5/imlua_capture.def1
-rwxr-xr-xim/src/lua5/imlua_convert.c2
-rwxr-xr-xim/src/lua5/imlua_fftw.c31
-rwxr-xr-xim/src/lua5/imlua_fftw.def1
-rwxr-xr-xim/src/lua5/imlua_image.c8
-rwxr-xr-xim/src/lua5/imlua_jp2.c5
-rwxr-xr-xim/src/lua5/imlua_jp2.def1
-rwxr-xr-xim/src/lua5/imlua_palette.c4
-rwxr-xr-xim/src/lua5/imlua_process.c11
-rwxr-xr-xim/src/lua5/imlua_process.def1
-rwxr-xr-xim/src/lua5/imlua_wmv.c5
-rwxr-xr-xim/src/lua5/imlua_wmv.def1
-rwxr-xr-xim/src/make_uname13
-rwxr-xr-xim/src/make_uname.bat74
35 files changed, 74 insertions, 493 deletions
diff --git a/im/src/config.mak b/im/src/config.mak
deleted file mode 100755
index f0b7966..0000000
--- a/im/src/config.mak
+++ /dev/null
@@ -1,89 +0,0 @@
-PROJNAME = im
-LIBNAME = im
-OPT = YES
-
-INCLUDES = . ../include
-
-# WORDS_BIGENDIAN used by libTIFF
-ifeq ($(TEC_SYSARCH), ppc)
- DEFINES = WORDS_BIGENDIAN
-endif
-ifeq ($(TEC_SYSARCH), mips)
- DEFINES = WORDS_BIGENDIAN
-endif
-ifeq ($(TEC_SYSARCH), sparc)
- DEFINES = WORDS_BIGENDIAN
-endif
-
-SRC = \
- old_imcolor.c old_imresize.c im_converttype.cpp \
- im_attrib.cpp im_format.cpp im_format_tga.cpp im_filebuffer.cpp \
- im_bin.cpp im_format_all.cpp im_format_raw.cpp \
- im_binfile.cpp im_format_sgi.cpp im_datatype.cpp im_format_pcx.cpp \
- im_colorhsi.cpp im_format_bmp.cpp im_image.cpp im_rgb2map.cpp \
- im_colormode.cpp im_format_gif.cpp im_lib.cpp im_format_pnm.cpp \
- im_colorutil.cpp im_format_ico.cpp im_palette.cpp \
- im_convertbitmap.cpp im_format_led.cpp im_counter.cpp im_str.cpp \
- im_convertcolor.cpp im_fileraw.cpp im_format_krn.cpp \
- im_file.cpp im_format_ras.cpp old_im.cpp \
- $(SRCJPEG) $(SRCTIFF) $(SRCPNG) $(SRCZLIB) $(SRCLZF)
-
-
-ifneq ($(findstring Win, $(TEC_SYSNAME)), )
- SRC += im_sysfile_win32.cpp im_dib.cpp im_dibxbitmap.cpp
-
- ifneq ($(findstring dll, $(TEC_UNAME)), )
- SRC += im.rc
- endif
-
- ifeq ($(findstring _64, $(TEC_UNAME)), )
- # optimize PNG lib for VC
- ifneq ($(findstring vc, $(TEC_UNAME)), )
- SRC += libpng/pngvcrd.c
- DEFINES += PNG_USE_PNGVCRD
- endif
- ifneq ($(findstring dll, $(TEC_UNAME)), )
- SRC += libpng/pngvcrd.c
- DEFINES += PNG_USE_PNGVCRD
- endif
- endif
-
- # force the definition of math functions using float
- # Watcom does not define them
- ifneq ($(findstring ow, $(TEC_UNAME)), )
- DEFINES += IM_DEFMATHFLOAT
- endif
-
- ifneq ($(findstring bc, $(TEC_UNAME)), )
- DEFINES += IM_DEFMATHFLOAT
- else
- USE_EXIF = Yes
- endif
-else
- SRC += im_sysfile_unix.cpp
-endif
-
-ifdef USE_EXIF
- SRC += $(SRCEXIF)
- DEFINES += USE_EXIF
-endif
-
-ifneq ($(findstring Linux, $(TEC_UNAME)), )
- # optimize PNG lib for Linux in x86
- ifeq "$(TEC_SYSARCH)" "x86"
- SRC += libpng/pnggccrd.c
- DEFINES += PNG_USE_PNGGCCRD
- endif
-endif
-
-ifneq ($(findstring AIX, $(TEC_UNAME)), )
- DEFINES += IM_DEFMATHFLOAT
-endif
-
-ifneq ($(findstring SunOS, $(TEC_UNAME)), )
- DEFINES += IM_DEFMATHFLOAT
-endif
-
-ifneq ($(findstring HP-UX, $(TEC_UNAME)), )
- DEFINES += IM_DEFMATHFLOAT
-endif
diff --git a/im/src/im_capture.def b/im/src/im_capture.def
index 6b44ac3..19560fc 100755
--- a/im/src/im_capture.def
+++ b/im/src/im_capture.def
@@ -25,3 +25,5 @@ EXPORTS
imVideoCaptureDeviceExDesc
imVideoCaptureDevicePath
imVideoCaptureDeviceVendorInfo
+ imVideoCaptureReleaseDevices
+ \ No newline at end of file
diff --git a/im/src/im_capture.mak b/im/src/im_capture.mak
deleted file mode 100755
index 8f10bc7..0000000
--- a/im/src/im_capture.mak
+++ /dev/null
@@ -1,73 +0,0 @@
-PROJNAME = im
-LIBNAME = im_capture
-OPT = YES
-
-INCLUDES = ../include
-
-# New Direct X does not includes Direct Show
-# Direct Show is included in latest Platform SDK, but depends on Direct X...
-DXSDK = d:/lng/dxsdk
-WINSDK = d:/lng/winsdk
-
-ifeq ($(TEC_UNAME), vc6)
- #Use old Direct X with Direct Show
- #But do NOT use the VC6 strmiids.lib
- PLATSDK = d:/lng/vc7/PlatformSDK
-endif
-
-ifeq ($(TEC_UNAME), dll)
- #Use old Direct X with Direct Show
- PLATSDK = d:/lng/vc7/PlatformSDK
- LDIR = ../lib/$(TEC_UNAME)
-endif
-
-ifeq ($(TEC_UNAME), vc8)
- INCLUDES += $(WINSDK)/include
- LDIR = $(WINSDK)/lib
-endif
-
-ifeq ($(TEC_UNAME), dll8)
- INCLUDES += $(WINSDK)/include
- LDIR = $(WINSDK)/lib
-endif
-
-ifeq ($(TEC_UNAME), vc8_64)
- INCLUDES += $(WINSDK)/include
- LDIR = $(WINSDK)/lib/amd64
-endif
-
-ifeq ($(TEC_UNAME), dll8_64)
- INCLUDES += $(WINSDK)/include
- LDIR = $(WINSDK)/lib/amd64
-endif
-
-ifneq ($(findstring Win, $(TEC_SYSNAME)), )
- INCLUDES += $(DXSDK)/include
- SRC = im_capture_dx.cpp
-endif
-
-#ifneq ($(findstring Linux, $(TEC_UNAME)), )
-# SRC = im_capture_v4l.cpp
-#endif
-
-LIBS = strmiids
-
-mingw3-dll:
- @echo Importing MingW stub library
- @cd ../lib/dll
- @dlltool -d im_capture.def -D im_capture.dll -l ../lib/mingw3/libim_capture.a
- @cd ../src
-
-mingw4-dll:
- @echo Importing MingW stub library
- @cd ../lib/dll
- @dlltool -d im_capture.def -D im_capture.dll -l ../lib/mingw4/libim_capture.a
- @cd ../src
-
-bc56-dll:
- @echo Importing Bcc stub library
- @d:/lng/cbuilderx/bin/implib -a ../lib/bc56/im_capture.lib ../lib/dll/im_capture.dll
-
-#owc1-dll:
-# @wlib -b -c -n -q -fo -io ../lib/owc1/im_capture.lib @im_capture.wlib
-# TEST @wlib -b -c -n -q -fo -io ../lib/owc1/im_capture.lib +../lib/dll/im_capture.dll
diff --git a/im/src/im_capture_dx.cpp b/im/src/im_capture_dx.cpp
index cb4749b..fcd6d98 100755
--- a/im/src/im_capture_dx.cpp
+++ b/im/src/im_capture_dx.cpp
@@ -2,7 +2,7 @@
* \brief Video Capture Using Direct Show 9
*
* See Copyright Notice in im.h
- * $Id: im_capture_dx.cpp,v 1.1 2008/10/17 06:10:16 scuri Exp $
+ * $Id: im_capture_dx.cpp,v 1.2 2010/04/25 21:51:29 scuri Exp $
*/
/*
@@ -240,7 +240,7 @@ struct vcDevice
static vcDevice vc_DeviceList[VC_MAXVIDDEVICES];
static int vc_DeviceCount = 0;
-static void vc_AddDevice(IBaseFilter *filter, char* desc, char* ex_desc, char* path, char* vendorinfo)
+static void vc_AddDevice(IBaseFilter *filter, const char* desc, const char* ex_desc, const char* path, const char* vendorinfo)
{
int i = vc_DeviceCount;
vcDevice* device = &vc_DeviceList[i];
@@ -596,14 +596,19 @@ int imVideoCaptureDeviceCount(void)
return vc_DeviceCount;
}
-int imVideoCaptureReloadDevices(void)
+void imVideoCaptureReleaseDevices(void)
{
for (int i = 0; i < vc_DeviceCount; i++)
{
vc_DeviceList[i].filter->Release();
}
-
vc_DeviceCount = 0;
+}
+
+int imVideoCaptureReloadDevices(void)
+{
+ imVideoCaptureReleaseDevices();
+
vc_EnumerateDevices();
return vc_DeviceCount;
}
@@ -1291,7 +1296,7 @@ static void vc_GetFormatName(GUID subtype, char* desc)
desc[0] = (char)(subtype.Data1);
desc[1] = (char)(subtype.Data1 >> 8);
desc[2] = (char)(subtype.Data1 >> 16);
- desc[3] = (char)(subtype.Data1 >> 32);
+ desc[3] = (char)(subtype.Data1 >> 24);
desc[4] = 0;
}
diff --git a/im/src/im_ecw.mak b/im/src/im_ecw.mak
deleted file mode 100755
index 0894425..0000000
--- a/im/src/im_ecw.mak
+++ /dev/null
@@ -1,16 +0,0 @@
-PROJNAME = im
-LIBNAME = im_ecw
-OPT = YES
-
-SRC = im_format_ecw.cpp
-
-ECWSDKINC = d:/lng/ecw_sdk/include
-ECWSDKLIB = d:/lng/ecw_sdk/lib/$(TEC_UNAME)
-
-INCLUDES = ../include $(ECWSDKINC)
-
-LDIR = $(ECWSDKLIB)
-LIBS = NCSEcw
-
-IM = ..
-USE_IM = Yes
diff --git a/im/src/im_format_ico.cpp b/im/src/im_format_ico.cpp
index b10f30e..7079952 100755
--- a/im/src/im_format_ico.cpp
+++ b/im/src/im_format_ico.cpp
@@ -2,7 +2,7 @@
* \brief ICO - Windows Icon
*
* See Copyright Notice in im_lib.h
- * $Id: im_format_ico.cpp,v 1.2 2008/12/03 15:45:34 scuri Exp $
+ * $Id: im_format_ico.cpp,v 1.3 2010/04/30 18:06:31 scuri Exp $
*/
#include "im_format.h"
@@ -49,11 +49,13 @@ static const char* iICOCompTable[1] =
"NONE"
};
+#define IMICON_MAX 10
+
class imFileFormatICO: public imFileFormatBase
{
imBinFile* handle; /* the binary file handle */
unsigned short bpp; /* number of bits per pixel */
- unsigned int offset[10],
+ unsigned int offset[IMICON_MAX],
next_offset;
int line_raw_size; // raw line size
@@ -134,7 +136,7 @@ int imFileFormatICO::Open(const char* file_name)
/* reads the number of images */
imBinFileRead(handle, &word, 1, 2);
- this->image_count = word > 10? 10: word;
+ this->image_count = word > IMICON_MAX? IMICON_MAX: word;
strcpy(this->compression, "NONE");
for (int i = 0; i < this->image_count; i++)
@@ -170,7 +172,7 @@ int imFileFormatICO::New(const char* file_name)
imBinFileWrite(handle, &word_value, 1, 2); /* resource type */
imBinFileWrite(handle, &word_value, 1, 2); /* number of images, at least one, must update at close */
- this->next_offset = 6 + 5 * 16; // offset to the first image, room for 5 ICONDIRENTRY
+ this->next_offset = 6 + IMICON_MAX * 16; // offset to the first image, room for IMICON_MAX ICONDIRENTRY
return IM_ERR_NONE;
}
@@ -285,7 +287,7 @@ int imFileFormatICO::WriteImageInfo()
this->file_data_type = IM_BYTE;
this->file_color_mode = imColorModeSpace(this->user_color_mode);
- if (this->image_count == 5)
+ if (this->image_count == IMICON_MAX)
return IM_ERR_DATA;
if (this->width > 255 || this->height > 255)
diff --git a/im/src/im_lib.cpp b/im/src/im_lib.cpp
index 4860ea7..499f5a9 100755
--- a/im/src/im_lib.cpp
+++ b/im/src/im_lib.cpp
@@ -2,7 +2,7 @@
* \brief Library Management
*
* See Copyright Notice in im_lib.h
- * $Id: im_lib.cpp,v 1.6 2010/04/23 17:45:44 scuri Exp $
+ * $Id: im_lib.cpp,v 1.8 2010/06/22 13:26:01 scuri Exp $
*/
#include <stdlib.h>
@@ -11,8 +11,9 @@
#include "im_lib.h"
/* This appears only here to avoid changing the im_lib.h header for bug fixes */
-#define IM_VERSION_FIX ".1"
-#define IM_VERSION_FIX_NUMBER 1
+#define IM_VERSION_FIX ".2"
+#define IM_VERSION_FIX_NUMBER 2
+#define IM_VERSION_FIX_DATE "2010/06/22"
static char *iVersion = "TECVERID.str:IM:LIB:" IM_VERSION IM_VERSION_FIX;
@@ -29,7 +30,11 @@ const char* imVersion(void)
const char* imVersionDate(void)
{
+#ifdef IM_VERSION_FIX_DATE
+ return IM_VERSION_FIX_DATE;
+#else
return IM_VERSION_DATE;
+#endif
}
int imVersionNumber(void)
diff --git a/im/src/im_process.mak b/im/src/im_process.mak
deleted file mode 100755
index 064be76..0000000
--- a/im/src/im_process.mak
+++ /dev/null
@@ -1,36 +0,0 @@
-PROJNAME = im
-LIBNAME = im_process
-OPT = YES
-
-SRC = \
- im_arithmetic_bin.cpp im_morphology_gray.cpp im_quantize.cpp \
- im_arithmetic_un.cpp im_geometric.cpp im_render.cpp \
- im_color.cpp im_histogram.cpp im_resize.cpp \
- im_convolve.cpp im_houghline.cpp im_statistics.cpp \
- im_convolve_rank.cpp im_logic.cpp im_threshold.cpp \
- im_effects.cpp im_morphology_bin.cpp im_tonegamut.cpp \
- im_canny.cpp im_distance.cpp im_analyze.cpp \
- im_kernel.cpp
-SRC := $(addprefix process/, $(SRC))
-
-USE_IM = Yes
-IM = ..
-
-ifneq ($(findstring Win, $(TEC_SYSNAME)), )
- ifneq ($(findstring ow, $(TEC_UNAME)), )
- DEFINES += IM_DEFMATHFLOAT
- endif
- ifneq ($(findstring bc, $(TEC_UNAME)), )
- DEFINES += IM_DEFMATHFLOAT
- endif
-else
- ifneq ($(findstring AIX, $(TEC_UNAME)), )
- DEFINES += IM_DEFMATHFLOAT
- endif
- ifneq ($(findstring SunOS, $(TEC_UNAME)), )
- DEFINES += IM_DEFMATHFLOAT
- endif
- ifneq ($(findstring HP-UX, $(TEC_UNAME)), )
- DEFINES += IM_DEFMATHFLOAT
- endif
-endif
diff --git a/im/src/im_wmv.mak b/im/src/im_wmv.mak
deleted file mode 100755
index fef3c40..0000000
--- a/im/src/im_wmv.mak
+++ /dev/null
@@ -1,23 +0,0 @@
-PROJNAME = im
-LIBNAME = im_wmv
-OPT = YES
-
-SRC = im_format_wmv.cpp
-
-ifneq ($(findstring _64, $(TEC_UNAME)), )
- WMFSDK = d:/lng/wmfsdk95
- INCLUDES = $(WMFSDK)/include
-else
-# WMFSDK = d:/lng/wmfsdk11
-# EXTRAINCS = $(WMFSDK)/include
- WMFSDK = d:/lng/wmfsdk9
- INCLUDES = $(WMFSDK)/include
-endif
-
-DEFINES = _CRT_NON_CONFORMING_SWPRINTFS
-
-LDIR = $(WMFSDK)/lib
-LIBS = wmvcore
-
-USE_IM = Yes
-IM = ..
diff --git a/im/src/imlua3.mak b/im/src/imlua3.mak
deleted file mode 100755
index aac7b00..0000000
--- a/im/src/imlua3.mak
+++ /dev/null
@@ -1,12 +0,0 @@
-PROJNAME = im
-LIBNAME = imlua3
-OPT = YES
-
-SRC = im_lua3.c
-
-USE_LUA = Yes
-#Do NOT use USE_CD because we use no CD functions, only headers are used.
-INCLUDES = $(CD)/include
-
-USE_IM = Yes
-IM = ..
diff --git a/im/src/imlua5.mak b/im/src/imlua5.mak
deleted file mode 100755
index 554b701..0000000
--- a/im/src/imlua5.mak
+++ /dev/null
@@ -1,18 +0,0 @@
-PROJNAME = im
-LIBNAME = imlua51
-
-OPT = YES
-
-LOHDIR = lua5/loh
-SRC = lua5/imlua.c lua5/imlua_aux.c lua5/imlua_convert.c lua5/imlua_file.c lua5/imlua_image.c lua5/imlua_palette.c lua5/imlua_util.c
-DEF_FILE = lua5/imlua.def
-
-SRCLUA = lua5/im_image.lua lua5/im_convert.lua
-SRCLUADIR = lua5
-
-INCLUDES = lua5
-
-USE_IM = YES
-USE_LUA51 = YES
-NO_LUALINK = Yes
-IM = ..
diff --git a/im/src/imlua_capture5.mak b/im/src/imlua_capture5.mak
deleted file mode 100755
index a4fe97c..0000000
--- a/im/src/imlua_capture5.mak
+++ /dev/null
@@ -1,18 +0,0 @@
-PROJNAME = im
-LIBNAME = imlua_capture51
-DEF_FILE = imlua_capture.def
-
-OPT = YES
-
-SRCDIR = lua5
-
-SRC = imlua_capture.c
-
-LIBS = im_capture
-
-INCLUDES = lua5
-
-USE_IMLUA = Yes
-USE_LUA51 = Yes
-NO_LUALINK = Yes
-IM = ..
diff --git a/im/src/imlua_process5.mak b/im/src/imlua_process5.mak
deleted file mode 100755
index 85415c4..0000000
--- a/im/src/imlua_process5.mak
+++ /dev/null
@@ -1,19 +0,0 @@
-PROJNAME = im
-LIBNAME = imlua_process51
-
-OPT = YES
-
-LOHDIR = lua5/loh
-SRC = lua5/imlua_process.c lua5/imlua_kernel.c
-DEF_FILE = lua5/imlua_process.def
-
-SRCLUA = lua5/im_process.lua
-SRCLUADIR = lua5
-
-LIBS = im_process
-INCLUDES = lua5
-
-USE_IMLUA = YES
-USE_LUA51 = YES
-NO_LUALINK = Yes
-IM = ..
diff --git a/im/src/imlua_wmv.mak b/im/src/imlua_wmv.mak
deleted file mode 100755
index f487075..0000000
--- a/im/src/imlua_wmv.mak
+++ /dev/null
@@ -1,17 +0,0 @@
-PROJNAME = im
-LIBNAME = imlua_wmv51
-DEF_FILE = imlua_wmv.def
-
-OPT = YES
-
-SRCDIR = lua5
-
-SRC = imlua_wmv.c
-
-LIBS = im_wmv
-
-INCLUDES = lua5
-
-USE_IMLUA = Yes
-USE_LUA51 = Yes
-IM = ..
diff --git a/im/src/lua5/imlua.c b/im/src/lua5/imlua.c
index 7e5c328..48224c2 100755
--- a/im/src/lua5/imlua.c
+++ b/im/src/lua5/imlua.c
@@ -2,7 +2,7 @@
* \brief IM Lua 5 Binding
*
* See Copyright Notice in im_lib.h
- * $Id: imlua.c,v 1.2 2008/12/11 19:02:49 scuri Exp $
+ * $Id: imlua.c,v 1.3 2010/06/07 20:59:32 scuri Exp $
*/
#include <string.h>
@@ -245,8 +245,3 @@ int luaopen_imlua(lua_State *L)
{
return imlua_open(L);
}
-
-int luaopen_imlua51(lua_State *L)
-{
- return imlua_open(L);
-}
diff --git a/im/src/lua5/imlua.def b/im/src/lua5/imlua.def
index 259c822..deb5584 100755
--- a/im/src/lua5/imlua.def
+++ b/im/src/lua5/imlua.def
@@ -1,6 +1,5 @@
EXPORTS
luaopen_imlua
- luaopen_imlua51
imlua_open
imlua_checkimage
imlua_newarrayulong
diff --git a/im/src/lua5/imlua_aux.c b/im/src/lua5/imlua_aux.c
index b26df93..ef972b2 100755
--- a/im/src/lua5/imlua_aux.c
+++ b/im/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.3 2010/01/21 18:24:22 scuri Exp $
+ * $Id: imlua_aux.c,v 1.4 2010/06/10 20:17:40 scuri Exp $
*/
#include <memory.h>
@@ -27,7 +27,11 @@ int imlua_getn (lua_State *L, int index)
{
int n;
lua_pushstring(L, "table");
+#if LUA_VERSION_NUM > 501
+ lua_pushglobaltable(L);
+#else
lua_gettable(L, LUA_GLOBALSINDEX);
+#endif
lua_pushstring(L, "getn");
lua_gettable(L, -2);
lua_pushvalue(L, index);
diff --git a/im/src/lua5/imlua_aux.h b/im/src/lua5/imlua_aux.h
index 2dc4466..c1cbdb5 100755
--- a/im/src/lua5/imlua_aux.h
+++ b/im/src/lua5/imlua_aux.h
@@ -2,7 +2,7 @@
* \brief IM Lua 5 Binding
*
* See Copyright Notice in im_lib.h
- * $Id: imlua_aux.h,v 1.1 2008/10/17 06:16:32 scuri Exp $
+ * $Id: imlua_aux.h,v 1.2 2010/06/11 17:43:52 scuri Exp $
*/
#ifndef __IMLUA_AUX_H
@@ -75,6 +75,11 @@ void imlua_open_convert(lua_State *L); /* imlua_convert.c */
void imlua_open_util(lua_State *L); /* imlua_util.c */
void imlua_open_file(lua_State *L); /* imlua_file.c */
+#if LUA_VERSION_NUM < 502
+#define luaL_typeerror luaL_typerror
+#endif
+
+
#ifdef __cplusplus
}
#endif
diff --git a/im/src/lua5/imlua_avi.c b/im/src/lua5/imlua_avi.c
index f2cd7f4..c6ffff1 100755
--- a/im/src/lua5/imlua_avi.c
+++ b/im/src/lua5/imlua_avi.c
@@ -37,8 +37,3 @@ int luaopen_imlua_avi(lua_State* L)
{
return imlua_avi_open(L);
}
-
-int luaopen_imlua_avi51(lua_State* L)
-{
- return imlua_avi_open(L);
-}
diff --git a/im/src/lua5/imlua_avi.def b/im/src/lua5/imlua_avi.def
index 3086a0d..9287d69 100755
--- a/im/src/lua5/imlua_avi.def
+++ b/im/src/lua5/imlua_avi.def
@@ -1,4 +1,3 @@
EXPORTS
luaopen_imlua_avi
- luaopen_imlua_avi51
\ No newline at end of file
diff --git a/im/src/lua5/imlua_capture.c b/im/src/lua5/imlua_capture.c
index 59ec0fb..181cbd0 100755
--- a/im/src/lua5/imlua_capture.c
+++ b/im/src/lua5/imlua_capture.c
@@ -2,7 +2,7 @@
* \brief IM Lua 5 Binding
*
* See Copyright Notice in im_lib.h
- * $Id: imlua_capture.c,v 1.2 2009/08/12 04:09:17 scuri Exp $
+ * $Id: imlua_capture.c,v 1.4 2010/06/07 20:59:32 scuri Exp $
*/
#include <string.h>
@@ -68,7 +68,7 @@ static int imluaVideoCaptureDeviceDesc (lua_State *L)
}
/*****************************************************************************\
- im.VideoCaptureDeviceDesc(device)
+ im.VideoCaptureReloadDevices()
\*****************************************************************************/
static int imluaVideoCaptureReloadDevices (lua_State *L)
{
@@ -77,6 +77,16 @@ static int imluaVideoCaptureReloadDevices (lua_State *L)
}
/*****************************************************************************\
+ im.VideoCaptureReleaseDevices()
+\*****************************************************************************/
+static int imluaVideoCaptureReleaseDevices (lua_State *L)
+{
+ (void)L;
+ imVideoCaptureReleaseDevices();
+ return 0;
+}
+
+/*****************************************************************************\
im.VideoCaptureCreate()
\*****************************************************************************/
static int imluaVideoCaptureCreate (lua_State *L)
@@ -381,6 +391,7 @@ static const luaL_reg imcapture_lib[] = {
{"VideoCaptureDeviceCount", imluaVideoCaptureDeviceCount},
{"VideoCaptureDeviceDesc", imluaVideoCaptureDeviceDesc},
{"VideoCaptureReloadDevices", imluaVideoCaptureReloadDevices},
+ {"VideoCaptureReleaseDevices", imluaVideoCaptureReleaseDevices},
{"VideoCaptureCreate", imluaVideoCaptureCreate},
{"VideoCaptureDestroy", imluaVideoCaptureDestroy},
{NULL, NULL}
@@ -435,9 +446,3 @@ int luaopen_imlua_capture(lua_State *L)
{
return imlua_open_capture(L);
}
-
-int luaopen_imlua_capture51(lua_State *L)
-{
- return imlua_open_capture(L);
-}
-
diff --git a/im/src/lua5/imlua_capture.def b/im/src/lua5/imlua_capture.def
index 1b279cf..5d247cf 100755
--- a/im/src/lua5/imlua_capture.def
+++ b/im/src/lua5/imlua_capture.def
@@ -1,5 +1,4 @@
EXPORTS
imlua_open_capture
luaopen_imlua_capture
- luaopen_imlua_capture51
\ No newline at end of file
diff --git a/im/src/lua5/imlua_convert.c b/im/src/lua5/imlua_convert.c
index 3c3f146..1bc4ab3 100755
--- a/im/src/lua5/imlua_convert.c
+++ b/im/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.3 2009/08/18 02:23:33 scuri Exp $
+ * $Id: imlua_convert.c,v 1.4 2010/06/07 20:59:32 scuri Exp $
*/
#include "im.h"
diff --git a/im/src/lua5/imlua_fftw.c b/im/src/lua5/imlua_fftw.c
index c8ad3df..f25f9c3 100755
--- a/im/src/lua5/imlua_fftw.c
+++ b/im/src/lua5/imlua_fftw.c
@@ -2,7 +2,7 @@
* \brief IM Lua 5 Binding
*
* See Copyright Notice in im_lib.h
- * $Id: imlua_fftw.c,v 1.2 2008/11/26 17:25:51 scuri Exp $
+ * $Id: imlua_fftw.c,v 1.3 2010/06/07 20:59:32 scuri Exp $
*/
#include <memory.h>
@@ -131,23 +131,17 @@ static const luaL_reg imfftw_lib[] = {
int imlua_open_fftw (lua_State *L)
{
luaL_register(L, "im", imfftw_lib); /* leave "im" table at the top of the stack */
-#ifdef TEC_BIGENDIAN
-#ifdef TEC_64
-#include "loh/im_fftw_be64.loh"
-#else
-#include "loh/im_fftw_be32.loh"
-#endif
-#else
-#ifdef TEC_64
-#ifdef WIN64
-#include "loh/im_fftw_le64w.loh"
+
+#ifdef IMLUA_USELOH
+#include "im_fftw.loh"
#else
-#include "loh/im_fftw_le64.loh"
-#endif
+#ifdef IMLUA_USELZH
+#include "im_fftw.lzh"
#else
-#include "loh/im_fftw.loh"
-#endif
-#endif
+ luaL_dofile(L, "im_fftw.lua");
+#endif
+#endif
+
return 1;
}
@@ -155,8 +149,3 @@ int luaopen_imlua_fftw(lua_State *L)
{
return imlua_open_fftw(L);
}
-
-int luaopen_imlua_fftw51(lua_State *L)
-{
- return imlua_open_fftw(L);
-}
diff --git a/im/src/lua5/imlua_fftw.def b/im/src/lua5/imlua_fftw.def
index 216c967..b364103 100755
--- a/im/src/lua5/imlua_fftw.def
+++ b/im/src/lua5/imlua_fftw.def
@@ -1,4 +1,3 @@
EXPORTS
imlua_open_fftw
luaopen_imlua_fftw
- luaopen_imlua_fftw51 \ No newline at end of file
diff --git a/im/src/lua5/imlua_image.c b/im/src/lua5/imlua_image.c
index 0e8676d..dd00d87 100755
--- a/im/src/lua5/imlua_image.c
+++ b/im/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.9 2010/01/17 18:18:12 scuri Exp $
+ * $Id: imlua_image.c,v 1.11 2010/06/07 20:59:32 scuri Exp $
*/
#include <string.h>
@@ -674,7 +674,7 @@ static int imluaImageColorSpace(lua_State *L)
static int imluaImageHasAlpha(lua_State *L)
{
imImage *im = imlua_checkimage(L, 1);
- lua_pushnumber(L, im->has_alpha);
+ lua_pushboolean(L, im->has_alpha);
return 1;
}
@@ -785,14 +785,14 @@ static int imluaImage_tostring (lua_State *L)
if (*image_p)
{
imImage *image = *image_p;
- lua_pushfstring(L, "imImage(%p) [width=%d,height=%d,color_space=%s,data_type=%s,depth=%d,has_alpha=%d]",
+ lua_pushfstring(L, "imImage(%p) [width=%d,height=%d,color_space=%s,data_type=%s,depth=%d,has_alpha=%s]",
image_p,
image->width,
image->height,
imColorModeSpaceName(image->color_space),
imDataTypeName(image->data_type),
image->depth,
- image->has_alpha
+ image->has_alpha? "yes": "no"
);
}
else
diff --git a/im/src/lua5/imlua_jp2.c b/im/src/lua5/imlua_jp2.c
index d69ba7e..fc694d5 100755
--- a/im/src/lua5/imlua_jp2.c
+++ b/im/src/lua5/imlua_jp2.c
@@ -37,8 +37,3 @@ int luaopen_imlua_jp2(lua_State* L)
{
return imlua_jp2_open(L);
}
-
-int luaopen_imlua_jp251(lua_State* L)
-{
- return imlua_jp2_open(L);
-}
diff --git a/im/src/lua5/imlua_jp2.def b/im/src/lua5/imlua_jp2.def
index 29aa05c..c5713d3 100755
--- a/im/src/lua5/imlua_jp2.def
+++ b/im/src/lua5/imlua_jp2.def
@@ -1,4 +1,3 @@
EXPORTS
luaopen_imlua_jp2
- luaopen_imlua_jp251
\ No newline at end of file
diff --git a/im/src/lua5/imlua_palette.c b/im/src/lua5/imlua_palette.c
index 80d23eb..135fe9a 100755
--- a/im/src/lua5/imlua_palette.c
+++ b/im/src/lua5/imlua_palette.c
@@ -2,7 +2,7 @@
* \brief IM Lua 5 Binding
*
* See Copyright Notice in im_lib.h
- * $Id: imlua_palette.c,v 1.1 2008/10/17 06:16:32 scuri Exp $
+ * $Id: imlua_palette.c,v 1.2 2010/06/11 17:43:52 scuri Exp $
*/
#include <string.h>
@@ -42,7 +42,7 @@ static imluaPalette* imlua_rawcheckpalette(lua_State *L, int param)
}
}
}
- luaL_typerror(L, param, "imPalette"); /* else error */
+ luaL_typeerror(L, param, "imPalette"); /* else error */
return NULL; /* to avoid warnings */
}
diff --git a/im/src/lua5/imlua_process.c b/im/src/lua5/imlua_process.c
index 978428b..b8c435c 100755
--- a/im/src/lua5/imlua_process.c
+++ b/im/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.11 2010/03/21 22:29:10 scuri Exp $
+ * $Id: imlua_process.c,v 1.13 2010/06/10 20:17:40 scuri Exp $
*/
#include <memory.h>
@@ -1805,7 +1805,11 @@ static int imluaProcessMultipleStdDev (lua_State *L)
luaL_argerror(L, 1, "must be a table");
lua_pushstring(L, "table");
+#if LUA_VERSION_NUM > 501
+ lua_pushglobaltable(L);
+#else
lua_gettable(L, LUA_GLOBALSINDEX);
+#endif
lua_pushstring(L, "getn");
lua_gettable(L, -2);
src_image_count = luaL_checkint(L, -1);
@@ -3139,8 +3143,3 @@ int luaopen_imlua_process(lua_State *L)
{
return imlua_open_process(L);
}
-
-int luaopen_imlua_process51(lua_State *L)
-{
- return imlua_open_process(L);
-}
diff --git a/im/src/lua5/imlua_process.def b/im/src/lua5/imlua_process.def
index 2b77e77..bac2cf7 100755
--- a/im/src/lua5/imlua_process.def
+++ b/im/src/lua5/imlua_process.def
@@ -1,4 +1,3 @@
EXPORTS
imlua_open_process
luaopen_imlua_process
- luaopen_imlua_process51 \ No newline at end of file
diff --git a/im/src/lua5/imlua_wmv.c b/im/src/lua5/imlua_wmv.c
index 7f61030..d715b37 100755
--- a/im/src/lua5/imlua_wmv.c
+++ b/im/src/lua5/imlua_wmv.c
@@ -37,8 +37,3 @@ int luaopen_imlua_wmv(lua_State* L)
{
return imlua_wmv_open(L);
}
-
-int luaopen_imlua_wmv51(lua_State* L)
-{
- return imlua_wmv_open(L);
-}
diff --git a/im/src/lua5/imlua_wmv.def b/im/src/lua5/imlua_wmv.def
index 0c05563..96f7128 100755
--- a/im/src/lua5/imlua_wmv.def
+++ b/im/src/lua5/imlua_wmv.def
@@ -1,4 +1,3 @@
EXPORTS
luaopen_imlua_wmv
- luaopen_imlua_wmv51
\ No newline at end of file
diff --git a/im/src/make_uname b/im/src/make_uname
deleted file mode 100755
index b104eac..0000000
--- a/im/src/make_uname
+++ /dev/null
@@ -1,13 +0,0 @@
-# This builds all the libraries of the folder for 1 uname
-
-tecmake $1 $2 $3 $4 $5 $6 $7 $8
-tecmake $1 MF=im_process $2 $3 $4 $5 $6 $7 $8
-tecmake $1 MF=im_jp2 $2 $3 $4 $5 $6 $7 $8
-tecmake $1 MF=im_fftw $2 $3 $4 $5 $6 $7 $8
-
-#tecmake $1 MF=imlua3 $2 $3 $4 $5 $6 $7 $8
-
-tecmake $1 MF=imlua5 $2 $3 $4 $5 $6 $7 $8
-tecmake $1 MF=imlua_process5 $2 $3 $4 $5 $6 $7 $8
-tecmake $1 MF=imlua_jp2 $2 $3 $4 $5 $6 $7 $8
-tecmake $1 MF=imlua_fftw5 $2 $3 $4 $5 $6 $7 $8
diff --git a/im/src/make_uname.bat b/im/src/make_uname.bat
deleted file mode 100755
index 0bfcec1..0000000
--- a/im/src/make_uname.bat
+++ /dev/null
@@ -1,74 +0,0 @@
-@echo off
-REM This builds all the libraries of the folder for 1 uname
-
-if "%1"=="VCC" goto do-vcc
-if "%1"=="vc-all" goto start-all-vc
-
-call tecmake %1 %2 %3 %4 %5 %6 %7 %8
-call tecmake %1 "MF=im_process" %2 %3 %4 %5 %6 %7 %8
-call tecmake %1 "MF=im_jp2" %2 %3 %4 %5 %6 %7 %8
-call tecmake %1 "MF=im_avi" %2 %3 %4 %5 %6 %7 %8
-call tecmake %1 "MF=im_fftw" %2 %3 %4 %5 %6 %7 %8
-
-REM call tecmake %1 "MF=imlua3" %2 %3 %4 %5 %6 %7 %8
-
-call tecmake %1 "MF=imlua5" %2 %3 %4 %5 %6 %7 %8
-call tecmake %1 "MF=imlua_process5" %2 %3 %4 %5 %6 %7 %8
-call tecmake %1 "MF=imlua_jp2" %2 %3 %4 %5 %6 %7 %8
-call tecmake %1 "MF=imlua_avi" %2 %3 %4 %5 %6 %7 %8
-call tecmake %1 "MF=imlua_fftw5" %2 %3 %4 %5 %6 %7 %8
-
-if "%1"=="vc6" goto vc
-if "%1"=="vc7" goto vc
-if "%1"=="vc8" goto vc
-if "%1"=="vc8_64" goto vc
-if "%1"=="vc9" goto vc
-if "%1"=="vc9_64" goto vc
-if "%1"=="dll" goto vc
-if "%1"=="dll7" goto vc
-if "%1"=="dll8" goto vc
-if "%1"=="dll8_64" goto vc
-if "%1"=="dll9" goto vc
-if "%1"=="dll9_64" goto vc
-if "%1"=="all" goto start-all-vc
-goto end
-
-:vc
-call tecmake %1 "MF=im_wmv" %2 %3 %4 %5 %6 %7 %8
-call tecmake %1 "MF=imlua_wmv" %2 %3 %4 %5 %6 %7 %8
-call tecmake %1 "MF=im_capture" %2 %3 %4 %5 %6 %7 %8
-call tecmake %1 "MF=imlua_capture5" %2 %3 %4 %5 %6 %7 %8
-if "%1"=="dll" goto dll
-goto end
-
-:dll
-call tecmake mingw4 "MF=im_capture" mingw4-dll
-call tecmake mingw3 "MF=im_capture" mingw3-dll
-call tecmake bc56 "MF=im_capture" bc56-dll
-REM call tecmake owc1 "MF=im_capture" owc1-dll
-goto end
-
-:start-all-vc
-call make_uname VCC vc6 %2 %3 %4 %5 %6
-call make_uname VCC vc7 %2 %3 %4 %5 %6
-call make_uname VCC vc8 %2 %3 %4 %5 %6
-call make_uname VCC vc8_64 %2 %3 %4 %5 %6
-call make_uname VCC vc9 %2 %3 %4 %5 %6
-call make_uname VCC vc9_64 %2 %3 %4 %5 %6
-call make_uname VCC dll %2 %3 %4 %5 %6
-call make_uname VCC dll7 %2 %3 %4 %5 %6
-call make_uname VCC dll8 %2 %3 %4 %5 %6
-call make_uname VCC dll8_64 %2 %3 %4 %5 %6
-call make_uname VCC dll9 %2 %3 %4 %5 %6
-call make_uname VCC dll9_64 %2 %3 %4 %5 %6
-goto end
-
-:do-vcc
-call tecmake %2 "MF=im_wmv" %3 %4 %5 %6 %7 %8
-call tecmake %2 "MF=imlua_wmv" %3 %4 %5 %6 %7 %8
-call tecmake %2 "MF=im_capture" %3 %4 %5 %6 %7 %8
-call tecmake %2 "MF=imlua_capture5" %3 %4 %5 %6 %7 %8
-if "%2"=="dll" goto dll
-goto end
-
-:end