diff options
author | scuri <scuri> | 2009-08-13 22:34:25 +0000 |
---|---|---|
committer | scuri <scuri> | 2009-08-13 22:34:25 +0000 |
commit | 380fdb5d8c80d094e5a8bc82bfc091bc87e6c43e (patch) | |
tree | 82e1142d204b405febd4554b76c0b81187f22d5a /include/im_convert.h | |
parent | 22eee5011ab2699a3267bde4a7b4430d8460314c (diff) |
*** empty log message ***
Diffstat (limited to 'include/im_convert.h')
-rw-r--r-- | include/im_convert.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/include/im_convert.h b/include/im_convert.h index 4ec7f0a..114786b 100644 --- a/include/im_convert.h +++ b/include/im_convert.h @@ -89,6 +89,17 @@ int imConvertColorSpace(const imImage* src_image, imImage* dst_image); * \ingroup convert */ int imConvertToBitmap(const imImage* src_image, imImage* dst_image, int cpx2real, float gamma, int abssolute, int cast_mode); +/** Returns an OpenGL compatible data buffer. Also returns the correspondant pixel format. \n + * The memory allocated is stored in the attribute "GLDATA" with BYTE type. And it will exists while the image exists. \n + * It can also be cleared setting the attribute to NULL. \n + * MAP images are converted to RGB, and BINARY images are converted to GRAY. + * Alpha channel is considered and Transparency* attributes are converted to alpha channel. + * So calculate depth from glformat, not from image depth. + * + * \verbatim image:GetOpenGLData() -> gldata: userdata, glformat: number [in Lua 5] \endverbatim + * \ingroup convert */ +void* imImageGetOpenGLData(const imImage* image, int *glformat); + /** \defgroup cnvutil Raw Data Conversion Utilities @@ -99,13 +110,12 @@ int imConvertToBitmap(const imImage* src_image, imImage* dst_image, int cpx2real * \ingroup imagerep */ -/** Changes the packing of the data buffer. +/** Changes the packing of the data buffer. Both must have the same depth. * \ingroup cnvutil */ void imConvertPacking(const void* src_data, void* dst_data, int width, int height, int depth, int data_type, int src_is_packed); /** Changes in-place a MAP data into a RGB data. The data must have room for the RGB image. \n * depth can be 3 or 4. count=width*height. \n - * Very usefull for OpenGL applications. * \ingroup cnvutil */ void imConvertMapToRGB(unsigned char* data, int count, int depth, int packed, long* palette, int palette_count); |