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_convert.lua | |
parent | e2726d7bef3b0a1684011e558cb68ca99cfecd75 (diff) |
*** empty log message ***
Diffstat (limited to 'src/lua5/im_convert.lua')
-rw-r--r-- | src/lua5/im_convert.lua | 18 |
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 |