summaryrefslogtreecommitdiff
path: root/src/lua5/im_convert.lua
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/im_convert.lua
parente2726d7bef3b0a1684011e558cb68ca99cfecd75 (diff)
*** empty log message ***
Diffstat (limited to 'src/lua5/im_convert.lua')
-rw-r--r--src/lua5/im_convert.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lua5/im_convert.lua b/src/lua5/im_convert.lua
new file mode 100644
index 0000000..231bdb5
--- /dev/null
+++ b/src/lua5/im_convert.lua
@@ -0,0 +1,18 @@
+
+function im.ConvertDataTypeNew(src_image, data_type, cpx2real, gamma, abssolute, cast_mode)
+ local dst_image = im.ImageCreateBased(src_image, nil, nil, nil, data_type)
+ return im.ConvertDataType(src_image, dst_image, cpx2real, gamma, abssolute, cast_mode), dst_image
+end
+
+function im.ConvertColorSpaceNew(src_image, color_space, has_alpha)
+ local dst_image = im.ImageCreateBased(src_image, nil, nil, color_space)
+ if (has_alpha) then dst_image:AddAlpha() end
+ return im.ConvertColorSpace(src_image, dst_image), dst_image
+end
+
+function im.ConvertToBitmapNew(src_image, color_space, has_alpha, cpx2real, gamma, abssolute, cast_mode)
+ if (not color_space) then color_space = im.ColorModeToBitmap(src_image:ColorSpace()) end
+ local dst_image = im.ImageCreateBased(src_image, nil, nil, color_space)
+ if (has_alpha) then dst_image:AddAlpha() end
+ return im.ConvertToBitmap(src_image, dst_image, cpx2real, gamma, abssolute, cast_mode), dst_image
+end