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:
authorJonathan Tompson <jonathantompson@gmail.com>2015-08-14 06:36:53 +0300
committerJonathan Tompson <jonathantompson@gmail.com>2015-08-14 06:36:53 +0300
commit00b8a0e409625f2d0eeac2d53dad1ff5b162b63f (patch)
treea399d08f05f4d766d54f9bbf0b197df73a9526cb /generic
parent7956503de7fe04903245819d653a688f4fdbb16c (diff)
Added user specified pad value to warp function.
Diffstat (limited to 'generic')
-rwxr-xr-xgeneric/image.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/generic/image.c b/generic/image.c
index b06f664..6b69900 100755
--- a/generic/image.c
+++ b/generic/image.c
@@ -1644,6 +1644,7 @@ int image_(Main_warp)(lua_State *L) {
int mode = lua_tointeger(L, 4);
int offset_mode = lua_toboolean(L, 5);
int clamp_mode = lua_tointeger(L, 6);
+ real pad_value = (real)lua_tonumber(L, 7);
// dims
int width = dst->size[2];
@@ -1680,7 +1681,7 @@ int image_(Main_warp)(lua_State *L) {
if (off_image == 1 && clamp_mode == 1) {
// We're off the image and we're clamping the input image to 0
for (k=0; k<channels; k++) {
- dst_data[ k*os[0] + y*os[1] + x*os[2] ] = 0;
+ dst_data[ k*os[0] + y*os[1] + x*os[2] ] = pad_value;
}
} else {
ix = MAX(ix,0); ix = MIN(ix,src_width-1);