From 380fdb5d8c80d094e5a8bc82bfc091bc87e6c43e Mon Sep 17 00:00:00 2001 From: scuri Date: Thu, 13 Aug 2009 22:34:25 +0000 Subject: *** empty log message *** --- include/im_convert.h | 14 ++++++++++++-- include/im_format_all.h | 8 +++++--- include/im_image.h | 12 ++---------- 3 files changed, 19 insertions(+), 15 deletions(-) (limited to 'include') 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); diff --git a/include/im_format_all.h b/include/im_format_all.h index 0aca379..7ae8052 100644 --- a/include/im_format_all.h +++ b/include/im_format_all.h @@ -203,8 +203,9 @@ void imFormatRegisterJPEG(void); PrimaryChromaticities IMFLOAT (6) XPosition, YPosition IM_FLOAT (1) sRGBIntent IM_INT (1) [0: Perceptual, 1: Relative colorimetric, 2: Saturation, 3: Absolute colorimetric] - TransparencyIndex IM_BYTE (1 or N) - TransparentColor IM_BYTE (3) + TransparencyMap IM_BYTE (N) (for MAP images is the alpha value of the corresponding palette index) + TransparencyIndex IM_BYTE (1) (for MAP images is the first index that has minimum alpha in TransparencyMap, for GRAY images is the index that it is fully transparent) + TransparencyColor IM_BYTE (3) (for RGB images is the color that is full transparent) CalibrationName, CalibrationUnits (string) CalibrationLimits IM_INT (2) CalibrationEquation IM_BYTE (1) [0-Linear,1-Exponential,2-Arbitrary,3-HyperbolicSine)] @@ -217,6 +218,7 @@ void imFormatRegisterJPEG(void); XScale, YScale IM_FLOAT (1) Comments: + When saving PNG image with TransparencyIndex or TransparencyMap, TransparencyMap has precedence, so set it to NULL if you changed TransparencyIndex. Attributes after the image are ignored. Define PNG_NO_CONSOLE_IO to avoid printfs. We also define PNG_TIME_RFC1123_SUPPORTED. Added the following files to the makefile to optimize the library: @@ -504,7 +506,7 @@ void imFormatRegisterPNM(void); Internally the lines are arranged from bottom up to top. Attributes: - TransparencyIndex IM_BYTE (1 or N) + TransparencyIndex IM_BYTE (1) Comments: If the user specifies an alpha channel, the AND mask is loaded as alpha if diff --git a/include/im_image.h b/include/im_image.h index b5e8628..7438f11 100644 --- a/include/im_image.h +++ b/include/im_image.h @@ -141,14 +141,6 @@ imImage* imImageDuplicate(const imImage* image); * \ingroup imgclass */ imImage* imImageClone(const imImage* image); -/** 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. - * - * \verbatim image:GetOpenGLData() -> gldata: userdata, format: number [in Lua 5] \endverbatim - * \ingroup imgclass */ -void* imImageGetOpenGLData(imImage* image, int *format); - /** Changes an extended attribute. \n * The data will be internally duplicated. \n * If data is NULL and count==0 the attribute is removed. \n @@ -158,7 +150,7 @@ void* imImageGetOpenGLData(imImage* image, int *format); * \verbatim image:SetAttribute(attrib: string, data_type: number, data: table of numbers or string) [in Lua 5] \endverbatim * If data_type is IM_BYTE, as_string can be used as data. * \ingroup imgclass */ -void imImageSetAttribute(imImage* image, const char* attrib, int data_type, int count, const void* data); +void imImageSetAttribute(const imImage* image, const char* attrib, int data_type, int count, const void* data); /** Returns an extended attribute. \n * Returns NULL if not found. @@ -233,7 +225,7 @@ int imImageMatchColorSpace(const imImage* image1, const imImage* image2); * \ingroup imgclass */ int imImageMatch(const imImage* image1, const imImage* image2); -/** Changes the image space from gray to binary by just changing color_space and the palette. +/** Changes the image color space from gray to binary by just changing color_space and the palette. * * \verbatim image:SetBinary() [in Lua 5] \endverbatim * \ingroup imgclass */ -- cgit v1.2.3