imImage
[Image Representation]
Detailed Description
- Base definitions and functions for image representation.
Only the image processing operations depends on these definitions, Image Storage and Image Capture are completely independent.
- You can also initialize a structure with your own memory buffer, see imImageInit. To release the structure without releasing the buffer, set "data[0]" to NULL before calling imImageDestroy.
- See im_image.h
Modules | |
Image Conversion | |
Data Structures | |
struct | _imImage |
imImage Structure Definition. More... | |
Defines | |
#define | imPutBitmap(_image, _x, _y, _w, _h, _xmin, _xmax, _ymin, _ymax) |
Typedefs | |
typedef _imImage | imImage |
Functions | |
imImage * | imImageCreate (int width, int height, int color_space, int data_type) |
imImage * | imImageInit (int width, int height, int color_space, int data_type, void *data_buffer, long *palette, int palette_count) |
imImage * | imImageCreateBased (imImage *image, int width, int height, int color_space, int data_type) |
void | imImageDestroy (imImage *image) |
void | imImageAddAlpha (imImage *image) |
void | imImageReshape (imImage *image, int width, int height) |
void | imImageCopy (const imImage *src_image, imImage *dst_image) |
void | imImageCopyData (const imImage *src_image, imImage *dst_image) |
imImage * | imImageDuplicate (const imImage *image) |
imImage * | imImageClone (const imImage *image) |
void | imImageSetAttribute (imImage *image, const char *attrib, int data_type, int count, const void *data) |
const void * | imImageGetAttribute (const imImage *image, const char *attrib, int *data_type, int *count) |
void | imImageGetAttributeList (const imImage *image, char **attrib, int *attrib_count) |
void | imImageClear (imImage *image) |
int | imImageIsBitmap (const imImage *image) |
void | imImageSetPalette (imImage *image, long *palette, int palette_count) |
void | imImageCopyAttributes (const imImage *src_image, imImage *dst_image) |
int | imImageMatchSize (const imImage *image1, const imImage *image2) |
int | imImageMatchColor (const imImage *image1, const imImage *image2) |
int | imImageMatchDataType (const imImage *image1, const imImage *image2) |
int | imImageMatchColorSpace (const imImage *image1, const imImage *image2) |
int | imImageMatch (const imImage *image1, const imImage *image2) |
void | imImageSetBinary (imImage *image) |
void | imImageMakeBinary (imImage *image) |
Define Documentation
|
Value: { \ if (_image->color_space == IM_RGB) \ { \ if (image->has_alpha) \ cdPutImageRectRGBA(_image->width, _image->height, \ (unsigned char*)_image->data[0], \ (unsigned char*)_image->data[1], \ (unsigned char*)_image->data[2], \ (unsigned char*)_image->data[3], \ _x, _y, _w, _h, _xmin, _xmax, _ymin, _ymax); \ else \ cdPutImageRectRGB(_image->width, _image->height, \ (unsigned char*)_image->data[0], \ (unsigned char*)_image->data[1], \ (unsigned char*)_image->data[2], \ _x, _y, _w, _h, _xmin, _xmax, _ymin, _ymax); \ } \ else \ cdPutImageRectMap(_image->width, _image->height, \ (unsigned char*)_image->data[0], _image->palette, \ _x, _y, _w, _h, _xmin, _xmax, _ymin, _ymax); \ } |
Typedef Documentation
|
imImage Structure Definition.
|
Function Documentation
|
Creates a new image.
im.ImageCreate(width: number, height: number, color_space: number, data_type: number) -> image: imImage [in Lua 5] |
|
Initializes the image structure but does not allocates image data. |
|
Creates a new image based on an existing one.
im.ImageCreateBased(image: imImage, [width: number], [height: number], [color_space: number], [data_type: number]) -> image: imImage [in Lua 5] |
|
Destroys the image and frees the memory used. image data is destroyed only if its data[0] is not NULL.
im.ImageDestroy(image: imImage) [in Lua 5] image:Destroy() [in Lua 5] |
|
Adds an alpha channel plane.
image:AddAlpha() [in Lua 5] |
|
Changes the buffer size. Reallocate internal buffers if the new size is larger than the original.
image:Reshape(width: number, height: number) [in Lua 5] |
|
Copy image data and attributes from one image to another.
image:Copy(dst_image: imImage) [in Lua 5] |
|
Copy image data only fom one image to another.
image:CopyData(dst_image: imImage) [in Lua 5] |
|
Creates a copy of the image.
image:Duplicate() -> new_image: imImage [in Lua 5] |
|
Creates a clone of the image. i.e. same attributes but ignore contents.
image:Clone() -> new_image: imImage [in Lua 5] |
|
Changes an extended attribute.
image:SetAttribute(attrib: string, data_type: number, data: table of numbers or string) [in Lua 5] |
|
Returns an extended attribute.
image:GetAttribute(attrib: string, [as_string: boolean]) -> data: table of numbers or string, data_type: number [in Lua 5] |
|
Returns a list of the attribute names.
image:GetAttributeList() -> data: table of strings [in Lua 5] |
|
Sets all image data to zero.
image:Clear() [in Lua 5] |
|
Indicates that the image can be viewed in common graphic devices. Data type must be IM_BYTE. Color mode can be IM_RGB, IM_MAP, IM_GRAY or IM_BINARY.
image:IsBitmap() -> is_bitmap: boolean [in Lua 5] |
|
Changes the image palette. This will destroy the existing palette and replace it with the given palette buffer.
image:SetPalette(palette: imPalette) [in Lua 5] |
|
Copies the image attributes from src to dst.
image:CopyAttributes(dst_image: imImage) [in Lua 5] |
|
Returns 1 if the images match width and height. Returns 0 otherwise.
image:MatchSize(image2: imImage) -> match: boolean [in Lua 5] |
|
Returns 1 if the images match color mode and data type. Returns 0 otherwise.
image:MatchColor(image2: imImage) -> match: boolean [in Lua 5] |
|
Returns 1 if the images match width, height and data type. Returns 0 otherwise.
image:MatchDataType(image2: imImage) -> match: boolean [in Lua 5] |
|
Returns 1 if the images match width, height and color space. Returns 0 otherwise.
image:MatchColorSpace(image2: imImage) -> match: boolean [in Lua 5] |
|
Returns 1 if the images match in width, height, data type and color space. Returns 0 otherwise.
image:Match(image2: imImage) -> match: boolean [in Lua 5] |
|
Changes the image space from gray to binary by just changing color_space and the palette.
image:SetBinary() [in Lua 5] |
|
Changes a gray data into a binary data, done in-place.
image:MakeBinary() [in Lua 5] |