Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/image.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsamehkhamis <sameh.khamis@gmail.com>2015-07-24 03:34:19 +0300
committersamehkhamis <sameh.khamis@gmail.com>2015-07-24 03:34:19 +0300
commit5d18767aa1bdc85dc09b95f9ac71e9eeb8bccca4 (patch)
treed567125bae84e74fc8bf01b2b13a3c3001c2c97d
parentc7eef085d9ffdbca894cd77a0d186ccd2ce13bd8 (diff)
Work under windows
-rw-r--r--CMakeLists.txt6
-rwxr-xr-xgeneric/image.c2
-rw-r--r--image-1.1.alpha-0.rockspec2
3 files changed, 8 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9033240..96cfe9e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,6 +8,9 @@ FIND_PACKAGE(PNG QUIET)
SET(src ppm.c)
ADD_TORCH_PACKAGE(ppm "${src}" "${luasrc}" "Image Processing")
TARGET_LINK_LIBRARIES(ppm luaT TH)
+IF(LUALIB)
+ TARGET_LINK_LIBRARIES(ppm ${LUALIB})
+ENDIF()
if (JPEG_FOUND)
SET(src jpeg.c)
@@ -32,4 +35,7 @@ SET(luasrc init.lua fabio.jpg fabio.png lena.jpg lena.png win.ui)
ADD_TORCH_PACKAGE(image "${src}" "${luasrc}" "Image Processing")
TARGET_LINK_LIBRARIES(image luaT TH)
+IF(LUALIB)
+ TARGET_LINK_LIBRARIES(image ${LUALIB})
+ENDIF()
INSTALL(FILES "README.md" DESTINATION "${Torch_INSTALL_LUA_PATH_SUBDIR}/image")
diff --git a/generic/image.c b/generic/image.c
index 27469ab..bfbf29a 100755
--- a/generic/image.c
+++ b/generic/image.c
@@ -1677,7 +1677,7 @@ int image_(Main_warp)(lua_State *L) {
long y_pix = floor(iy);
// Precalculate the L(x) function evaluations in the u and v direction
- const long rad = 3; // This is a tunable parameter: 2 to 3 is OK
+ #define rad (3) // This is a tunable parameter: 2 to 3 is OK
float Lu[2 * rad]; // L(x) for u direction
float Lv[2 * rad]; // L(x) for v direction
for (u=x_pix-rad+1, i=0; u<=x_pix+rad; u++, i++) {
diff --git a/image-1.1.alpha-0.rockspec b/image-1.1.alpha-0.rockspec
index b7bde31..2c498db 100644
--- a/image-1.1.alpha-0.rockspec
+++ b/image-1.1.alpha-0.rockspec
@@ -25,7 +25,7 @@ dependencies = {
build = {
type = "command",
build_command = [[
-cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$(LUA_BINDIR)/.." -DCMAKE_INSTALL_PREFIX="$(PREFIX)" && $(MAKE)
+cmake -E make_directory build && cd build && cmake .. -DLUALIB=$(LUALIB) -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$(LUA_BINDIR)/.." -DCMAKE_INSTALL_PREFIX="$(PREFIX)" && $(MAKE)
]],
install_command = "cd build && $(MAKE) install"
}