Image Representation Structure. More...
Data Fields | |
int | width |
int | height |
int | color_space |
int | data_type |
int | has_alpha |
int | depth |
int | line_size |
int | plane_size |
int | size |
int | count |
void ** | data |
long * | palette |
int | palette_count |
void * | attributes_table |
int _imImage::width |
Number of columns. image:Width() -> width: number [in Lua 5].
int _imImage::height |
Number of lines. image:Height() -> height: number [in Lua 5].
Color space descriptor. See also imColorSpace. image:ColorSpace() -> color_space: number [in Lua 5].
Data type descriptor. See also imDataType. image:DataType() -> data_type: number [in Lua 5].
Indicates that there is an extra channel with alpha. image:HasAlpha() -> has_alpha: boolean [in Lua 5].
It will not affect the secondary parameters, i.e. the number of planes will be in fact depth+1.
It is always 0 unless imImageAddAlpha is called. Alpha is automatically added in image loading functions.
int _imImage::depth |
Number of planes (ColorSpaceDepth) image:Depth() -> depth: number [in Lua 5].
Number of bytes per line in one plane (width * DataTypeSize)
Number of bytes per plane. (line_size * height)
int _imImage::size |
Number of bytes occupied by the image (plane_size * depth)
int _imImage::count |
Number of pixels per plane (width * height)
void** _imImage::data |
Image data organized as a 2D matrix with several planes.
But plane 0 is also a pointer to the full data.
The remaining planes are: "data[i] = data[0] + i*plane_size".
In Lua, data indexing is possible using: "image[plane][line][column]".
Also in Lua, is possible to set all pixels using a table calling "image:SetPixels(table)" and get all pixels using "table = image:GetPixels()" (Since 3.9).
long* _imImage::palette |
Color palette. image:GetPalette() -> palette: imPalette [in Lua 5].
Used only when depth=1. Otherwise is NULL.
The palette is always 256 colors allocated, but can have less colors used.
in fact is an imAttribTable, but we hide this here