im.im_convert

\file \brief Image Conversion

See Copyright Notice in im_lib.h

Members

Enums

imCastMode
enum imCastMode

Predefined Cast Modes \n * See also \ref color Color Manipulation, Color Component Intervals section. * \ingroup convert

imComplex2Real
enum imComplex2Real

Complex to real conversions * \ingroup convert

imGammaFactor
enum imGammaFactor

Predefined Gamma factors. Gamma can be any real number. * When gamma<0 use logarithmic, when gamma>0 use exponential. * gamma(x,g) = ((e^(g*x))-1)/(exp(g)-1) * gamma(x,g) = (log((g*x)+1))/(log(g+1)) * \ingroup convert

Functions

imConvertColorSpace
int imConvertColorSpace(const(imImage)* src_image, imImage* dst_image)

Converts one color space to another. \n * Images must be of the same size and data type. If color mode is the same nothing is done. \n * CMYK can be converted to RGB only, and it is a very simple conversion. \n * All colors can be converted to Binary, the non zero gray values are converted to 1. \n * RGB to Map uses the median cut implementation from the free IJG JPEG software, copyright Thomas G. Lane. \n * Alpha channel is considered and Transparency* attributes are converted to alpha channel. \n * All other color space conversions assume sRGB and CIE definitions, see \ref color. \n * Returns IM_ERR_NONE, IM_ERR_DATA or IM_ERR_COUNTER, see also \ref imErrorCodes. \n * See also \ref imColorSpace, \ref imColorModeConfig and \ref colormodeutl. * * \verbatim im.ConvertColorSpace(src_image: imImage, dst_image: imImage) -> error: number [in Lua 5] \endverbatim * \verbatim im.ConvertColorSpaceNew(image: imImage, color_space: number, has_alpha: boolean) -> error: number, new_image: imImage [in Lua 5] \endverbatim * \ingroup convert

imConvertDataType
int imConvertDataType(const(imImage)* src_image, imImage* dst_image, int cpx2real, float gamma, int absolute, int cast_mode)

Changes the image data type, using a complex2real conversion, * a gamma factor, and an absolute mode (modulus). \n * When demoting the data type the function will scan source for min/max values or use fixed values (cast_mode) * to scale the result according to the target range. \n * Except complex to real that will use only the complex2real conversion. \n * Images must be of the same size and color mode. If data type is the same nothing is done. \n * Returns IM_ERR_NONE, IM_ERR_DATA or IM_ERR_COUNTER, see also \ref imErrorCodes. \n * See also \ref imDataType, \ref datatypeutl, \ref imComplex2Real, \ref imGammaFactor and \ref imCastMode. * * \verbatim im.ConvertDataType(src_image: imImage, dst_image: imImage, cpx2real: number, gamma: number, absolute: boolean, cast_mode: number) -> error: number [in Lua 5] \endverbatim * \verbatim im.ConvertDataTypeNew(image: imImage, data_type: number, cpx2real: number, gamma: number, absolute: boolean, cast_mode: number) -> error: number, new_image: imImage [in Lua 5] \endverbatim * \ingroup convert

imConvertMapToRGB
void imConvertMapToRGB(ubyte* data, int count, int depth, int packed, c_long* palette, int palette_count)

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 * \ingroup cnvutil

imConvertPacking
void imConvertPacking(const(void)* src_data, void* dst_data, int width, int height, int src_depth, int dst_depth, int data_type, int src_is_packed)

Changes the packing of the data buffer. Both must have the same width, height and data_type. \n * It can be used to copy data even if depth=1. * \ingroup cnvutil

imConvertRGB2Map
int imConvertRGB2Map(int width, int height, ubyte* red, ubyte* green, ubyte* blue, ubyte* map, c_long* palette, int* palette_count)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
imConvertToBitmap
int imConvertToBitmap(const(imImage)* src_image, imImage* dst_image, int cpx2real, float gamma, int absolute, int cast_mode)

Converts the image to its bitmap equivalent, * uses \ref imConvertColorSpace and \ref imConvertDataType. \n * Returns IM_ERR_NONE, IM_ERR_DATA or IM_ERR_COUNTER, see also \ref imErrorCodes. * See also \ref imImageIsBitmap, \ref imComplex2Real, \ref imGammaFactor and \ref imCastMode. \n * The function im.ConvertToBitmapNew uses the default conversion result from \ref imColorModeToBitmap if color_space is nil. * * \verbatim im.ConvertToBitmap(src_image: imImage, dst_image: imImage, cpx2real: number, gamma: number, absolute: boolean, cast_mode: number) -> error: number [in Lua 5] \endverbatim * \verbatim im.ConvertToBitmapNew(image: imImage, color_space: number, has_alpha: boolean, cpx2real: number, gamma: number, absolute: boolean, cast_mode: number) -> error: number, new_image: imImage [in Lua 5] \endverbatim * \ingroup convert

imImageCreateFromOpenGLData
imImage* imImageCreateFromOpenGLData(int width, int height, int glformat, const(void)* gldata)

Creates an image from an OpenGL data. * * \verbatim im.ImageCreateFromOpenGLData(width, height, glformat: number, gldata: userdata) -> image: imImage [in Lua 5] \endverbatim * \ingroup convert

imImageGetOpenGLData
void* imImageGetOpenGLData(const(imImage)* image, int* glformat)

Returns an OpenGL compatible data buffer. Also returns the correspondent 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 be cleared by 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

Mixins

__anonymous
mixin FreeEnumMembers!imComplex2Real
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__anonymous
mixin FreeEnumMembers!imGammaFactor
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
__anonymous
mixin FreeEnumMembers!imCastMode
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.

Meta