diff options
author | scuri <scuri> | 2009-08-18 02:21:01 +0000 |
---|---|---|
committer | scuri <scuri> | 2009-08-18 02:21:01 +0000 |
commit | 77a4608ee1f828ed70ec58588f0229cd57758148 (patch) | |
tree | b1550da93d53331715c200f1acf8a7c1b2ff7be9 /src/lua5/im_fftw.lua | |
parent | e2726d7bef3b0a1684011e558cb68ca99cfecd75 (diff) |
*** empty log message ***
Diffstat (limited to 'src/lua5/im_fftw.lua')
-rw-r--r-- | src/lua5/im_fftw.lua | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/lua5/im_fftw.lua b/src/lua5/im_fftw.lua index e57c7bf..7bae53e 100644 --- a/src/lua5/im_fftw.lua +++ b/src/lua5/im_fftw.lua @@ -3,6 +3,7 @@ -- Creates a new function, with the name suffixed by "New". This new function -- creates a new image, based on a source image, and calls the previous function -- with this new image. +-- We assume here that the functions returns only one parameter or none. local function OneSourceOneDest (funcname, width, height, color_space, data_type) local func = im[funcname] @@ -14,8 +15,12 @@ local function OneSourceOneDest (funcname, width, height, color_space, data_type local dst_image = im.ImageCreateBased(src_image, width, height, color_space, data_type) -- call previous method, repassing all parameters - func(src_image, dst_image, unpack(arg)) - return dst_image + local ret = func(src_image, dst_image, unpack(arg)) + if (ret) then + return ret, dst_image + else + return dst_image + end end end @@ -25,7 +30,7 @@ end local function TwoSourcesOneDest (funcname, width, height, color_space, data_type) local func = im[funcname] - + -- see if function is really defined assert(func, string.format("undefined function `%s'", funcname)) @@ -35,8 +40,12 @@ local function TwoSourcesOneDest (funcname, width, height, color_space, data_typ local dst_image = im.ImageCreateBased(src_image1, width, height, color_space, data_type) -- call previous method, repassing all parameters - func(src_image1, src_image2, dst_image, unpack(arg)) - return dst_image + local ret = func(src_image1, src_image2, dst_image, unpack(arg)) + if (ret) then + return ret, dst_image + else + return dst_image + end end end |