im.util

\file \brief Utilities

See Copyright Notice in im_lib.d

Members

Aliases

imbyte
alias imbyte = ubyte

\defgroup datatypeutl Data Type Utilities \par See \ref im_util.h \ingroup util @{

imushort
alias imushort = ushort
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.

Enums

imByteOrder
enum imByteOrder

CPU Byte Orders. * \ingroup bin

Functions

IM_BYTECROP
auto IM_BYTECROP(T _v)
Undocumented in source. Be warned that the author may not have intended to support it.
IM_CROPMAX
auto IM_CROPMAX(T _v, U _max)
Undocumented in source. Be warned that the author may not have intended to support it.
IM_CROPMINMAX
auto IM_CROPMINMAX(T _v, U _min, V _max)
Undocumented in source. Be warned that the author may not have intended to support it.
IM_FLOATCROP
auto IM_FLOATCROP(T _v)
Undocumented in source. Be warned that the author may not have intended to support it.
IM_MAX
auto IM_MAX(T _a, U _b)
Undocumented in source. Be warned that the author may not have intended to support it.
IM_MIN
auto IM_MIN(T _a, U _b)

\defgroup util Utilities \par See \ref im_util.h @{

imBinCPUByteOrder
int imBinCPUByteOrder()

Returns the current CPU byte order. * \ingroup bin

imBinSwapBytes
void imBinSwapBytes(void* data, int count, int size)

Changes the byte order of an array of 2, 4 or 8 byte values. * \ingroup bin

imBinSwapBytes2
void imBinSwapBytes2(void* data, int count)

Changes the byte order of an array of 2 byte values. * \ingroup bin

imBinSwapBytes4
void imBinSwapBytes4(void* data, int count)

Inverts the byte order of the 4 byte values * \ingroup bin

imBinSwapBytes8
void imBinSwapBytes8(void* data, int count)

Inverts the byte order of the 8 byte values * \ingroup bin

imColorDecode
void imColorDecode(ubyte* red, ubyte* green, ubyte* blue, long color)

Decode RGB components from a long for palette usage. \n * "long" definition is compatible with the CD library definition. * * \verbatim im.ColorDecode(color: lightuserdata) -> red: number, green: number, blue: number [in Lua 5] \endverbatim * \ingroup colorutl

imColorEncode
long imColorEncode(ubyte red, ubyte green, ubyte blue)

Encode RGB components in a long for palette usage. \n * "long" definition is compatible with the CD library definition. * * \verbatim im.ColorEncode(red: number, green: number, blue: number) -> color: lightuserdata [in Lua 5] \endverbatim * \ingroup colorutl

imColorModeDepth
int imColorModeDepth(int color_mode)

Returns the number of components of the color space including alpha. * * \verbatim im.ColorModeDepth(color_mode: number) -> depth: number [in Lua 5] \endverbatim * \ingroup colormodeutl

imColorModeHasAlpha
auto imColorModeHasAlpha(T _cm)

Check if the color mode has an alpha channel. * * \verbatim im.ColorModeHasAlpha(color_mode: number) -> has_alpha: boolean [in Lua 5] \endverbatim * \ingroup colormodeutl

imColorModeIsBitmap
int imColorModeIsBitmap(int color_mode, int data_type)

Check if the color mode and data_type defines a display bitmap image. * * \verbatim im.ColorModeIsBitmap(color_mode: number, data_type: number) -> is_bitmap: boolean [in Lua 5] \endverbatim * \ingroup colormodeutl

imColorModeIsPacked
auto imColorModeIsPacked(T _cm)

Check if the color mode components are packed in one plane. * * \verbatim im.ColorModeIsPacked(color_mode: number) -> is_packed: boolean [in Lua 5] \endverbatim * \ingroup colormodeutl

imColorModeIsTopDown
auto imColorModeIsTopDown(T _cm)

Check if the color mode orients the image from top down to bottom. * * \verbatim im.ColorModeIsTopDown(color_mode: number) -> is_top_down: boolean [in Lua 5] \endverbatim * \ingroup colormodeutl

imColorModeMatch
auto imColorModeMatch(T _cm1, U _cm2)

Check if the two color modes match. Only the color space is compared. * * \verbatim im.ColorModeMatch(color_mode1: number, color_mode2: number) -> match: boolean [in Lua 5] \endverbatim * \ingroup colormodeutl

imColorModeSpace
auto imColorModeSpace(T _cm)

Returns the color space of the color mode. * * \verbatim im.ColorModeSpace(color_mode: number) -> color_space: number [in Lua 5] \endverbatim * \ingroup colormodeutl

imColorModeSpaceName
const(char)* imColorModeSpaceName(int color_mode)

Returns the color mode name. * * \verbatim im.ColorModeSpaceName(color_mode: number) -> name: string [in Lua 5] \endverbatim * \ingroup colormodeutl

imColorModeToBitmap
int imColorModeToBitmap(int color_mode)

Returns the color space of the equivalent display bitmap image. \n * Original packing and alpha are ignored. Returns IM_RGB, IM_GRAY, IM_MAP or IM_BINARY. * * \verbatim im.ColorModeToBitmap(color_mode: number) -> color_space: number [in Lua 5] \endverbatim * \ingroup colormodeutl

imCompressDataLZF
int imCompressDataLZF(const(void)* src_data, int src_size, void* dst_data, int dst_size)

Compresses the data using the libLZF compression. \n * Returns the size of the compressed buffer or zero if failed. * \ingroup compress

imCompressDataLZO
int imCompressDataLZO(const(void)* src_data, int src_size, void* dst_data, int dst_size)

Compresses the data using the libLZO compression. (Since 3.9) \n Returns the size of the compressed buffer or zero if failed. \n Available in a separate library called "im_lzo" which license is GPL. \ingroup compress

imCompressDataUnLZF
int imCompressDataUnLZF(const(void)* src_data, int src_size, void* dst_data, int dst_size)

Uncompresses the data compressed with the libLZF compression. \n * Returns zero if failed. * \ingroup compress

imCompressDataUnLZO
int imCompressDataUnLZO(const(void)* src_data, int src_size, void* dst_data, int dst_size)

Uncompresses the data compressed with the libLZO compression. (Since 3.9) \n Returns zero if failed. \n Available in a separate library called "im_lzo" which license is GPL. \ingroup compress

imCompressDataUnZ
int imCompressDataUnZ(const(void)* src_data, int src_size, void* dst_data, int dst_size)

Uncompresses the data compressed with the ZLIB Deflate compression. \n * Returns zero if failed. * \ingroup compress

imCompressDataZ
int imCompressDataZ(const(void)* src_data, int src_size, void* dst_data, int dst_size, int zip_quality)

Compresses the data using the ZLIB Deflate compression. \n * The destination buffer must be at least 0.1% larger than source_size plus 12 bytes. \n * It compresses raw byte data. zip_quality can be 1 to 9. \n * Returns the size of the compressed buffer or zero if failed. * \ingroup compress

imDataTypeIntMax
ulong imDataTypeIntMax(int data_type)

Returns the maximum value of an integer data type. For floating point returns 0. * * \verbatim im.DataTypeIntMax(data_type: number) -> int_max: number [in Lua 5] \endverbatim * \ingroup datatypeutl

imDataTypeIntMin
long imDataTypeIntMin(int data_type)

Returns the minimum value of an integer data type. For floating point returns 0. * * \verbatim im.DataTypeIntMin(data_type: number) -> int_min: number [in Lua 5] \endverbatim * \ingroup datatypeutl

imDataTypeName
const(char)* imDataTypeName(int data_type)

Returns the numeric data type name given its identifier. * * \verbatim im.DataTypeName(data_type: number) -> name: string [in Lua 5] \endverbatim * \ingroup datatypeutl

imDataTypeSize
int imDataTypeSize(int data_type)

Returns the size in bytes of a specified numeric data type. * * \verbatim im.DataTypeSize(data_type: number) -> size: number [in Lua 5] \endverbatim * \ingroup datatypeutl

imImageCheckFormat
int imImageCheckFormat(int color_mode, int data_type)

Check if the combination color_mode+data_type is valid. * * \verbatim im.ImageCheckFormat(color_mode: number, data_type: number) -> check: boolean [in Lua 5] \endverbatim * \ingroup imageutil

imImageDataSize
int imImageDataSize(int width, int height, int color_mode, int data_type)

Returns the size of the data buffer. * * \verbatim im.ImageDataSize(width: number, height: number, color_mode: number, data_type: number) -> datasize: number [in Lua 5] \endverbatim * \ingroup imageutil

imImageLineCount
int imImageLineCount(int width, int color_mode)

Returns the number of elements of one line of the data buffer. \n * This depends if the components are packed. If packed includes all components, if not includes only one. * * \verbatim im.ImageLineCount(width: number, color_mode: number) -> linecount: number [in Lua 5] \endverbatim * \ingroup imageutil

imImageLineSize
int imImageLineSize(int width, int color_mode, int data_type)

Returns the size of one line of the data buffer. \n * This depends if the components are packed. If packed includes all components, if not includes only one. * * \verbatim im.ImageLineSize(width: number, color_mode: number, data_type: number) -> linesize: number [in Lua 5] \endverbatim * \ingroup imageutil

imStrCheck
int imStrCheck(const(void)* data, int count)

Check if the data is a string. * \ingroup str

imStrEqual
int imStrEqual(const(char)* str1, const(char)* str2)

Check if the two strings are equal. * \ingroup str

imStrNLen
int imStrNLen(const(char)* str, int max_len)

Calculate the size of the string but limited to max_len. * \ingroup str

Manifest constants

IM_MAXDEPTH
enum IM_MAXDEPTH;

Max depth is 4+1 (cmyk+alpha) * \ingroup colormodeutl

Meta