From 77a4608ee1f828ed70ec58588f0229cd57758148 Mon Sep 17 00:00:00 2001 From: scuri Date: Tue, 18 Aug 2009 02:21:01 +0000 Subject: *** empty log message *** --- src/lua5/im_convert.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/lua5/im_convert.lua (limited to 'src/lua5/im_convert.lua') 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 -- cgit v1.2.3