Image Storage
Detailed Description
- See im.h
Modules | |
File Format SDK | |
imImage Storage | |
File Formats | |
Data Structures | |
class | imImageFile |
C++ Wrapper for the Image File Structure. More... | |
Enumerations | |
enum | imErrorCodes { IM_ERR_NONE, IM_ERR_OPEN, IM_ERR_ACCESS, IM_ERR_FORMAT, IM_ERR_DATA, IM_ERR_COMPRESS, IM_ERR_MEM, IM_ERR_COUNTER } |
Functions | |
imFile * | imFileOpen (const char *file_name, int *error) |
imFile * | imFileOpenAs (const char *file_name, const char *format, int *error) |
imFile * | imFileNew (const char *file_name, const char *format, int *error) |
void | imFileClose (imFile *ifile) |
void * | imFileHandle (imFile *ifile, int index) |
void | imFileGetInfo (imFile *ifile, char *format, char *compression, int *image_count) |
void | imFileSetInfo (imFile *ifile, const char *compression) |
void | imFileSetAttribute (imFile *ifile, const char *attrib, int data_type, int count, const void *data) |
const void * | imFileGetAttribute (imFile *ifile, const char *attrib, int *data_type, int *count) |
void | imFileGetAttributeList (imFile *ifile, char **attrib, int *attrib_count) |
void | imFileGetPalette (imFile *ifile, long *palette, int *palette_count) |
void | imFileSetPalette (imFile *ifile, long *palette, int palette_count) |
int | imFileReadImageInfo (imFile *ifile, int index, int *width, int *height, int *file_color_mode, int *file_data_type) |
int | imFileWriteImageInfo (imFile *ifile, int width, int height, int user_color_mode, int user_data_type) |
int | imFileReadImageData (imFile *ifile, void *data, int convert2bitmap, int color_mode_flags) |
int | imFileWriteImageData (imFile *ifile, void *data) |
Enumeration Type Documentation
|
File Access Error Codes
00059 { 00060 IM_ERR_NONE, /**< No error. */ 00061 IM_ERR_OPEN, /**< Error while opening the file (read or write). */ 00062 IM_ERR_ACCESS, /**< Error while accessing the file (read or write). */ 00063 IM_ERR_FORMAT, /**< Invalid or unrecognized file format. */ 00064 IM_ERR_DATA, /**< Invalid or unsupported data. */ 00065 IM_ERR_COMPRESS, /**< Invalid or unsupported compression. */ 00066 IM_ERR_MEM, /**< Insuficient memory */ 00067 IM_ERR_COUNTER /**< Interrupted by the counter */ 00068 };
|
Function Documentation
|
Opens the file for reading. It must exists. Also reads file header. It will try to identify the file format. See also imErrorCodes.
im.FileOpen(file_name: string) -> ifile: imFile, error: number [in Lua 5] |
|
Opens the file for reading using a specific format. It must exists. Also reads file header. See also imErrorCodes and File Formats.
im.FileOpenAs(file_name, format: string) -> ifile: imFile, error: number [in Lua 5] |
|
Creates a new file for writing using a specific format. If the file exists will be replaced.
im.FileNew(file_name: string, format: string) -> ifile: imFile, error: number [in Lua 5] |
|
Closes the file
im.FileClose(ifile: imFile) [in Lua 5] ifile:Close() [in Lua 5] |
|
Returns an internal handle. index=0 returns always an imBinFile* handle, but for some formats returns NULL because they do not use imBinFile (like AVI and WMV). index=1 return an internal structure used by the format, usually is a handle to a third party library structure. This is file format dependent.
ifile:Handle() -> handle: userdata [in Lua 5] |
|
Returns file information. image_count is the number of images in a stack or the number of frames in a video/animation or the depth of a volume data.
ifile:GetInfo() -> format: string, compression: string, image_count: number [in Lua 5] |
|
Changes the write compression method.
ifile:SetInfo(compression: string) [in Lua 5] |
|
Changes an extended attribute.
ifile:SetAttribute(attrib: string, data_type: number, data: table of numbers or string) [in Lua 5] |
|
Returns an extended attribute.
ifile: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.
ifile:GetAttributeList() -> data: table of strings [in Lua 5] |
|
Returns the pallete if any.
ifile:GetPalette() -> palette: imPalette [in Lua 5] |
|
Changes the pallete.
ifile:SetPalette(palette: imPalette) [in Lua 5] |
|
Reads the image header if any and returns image information.
ifile:ReadImageInfo([index: number]) -> error: number, width: number, height: number, file_color_mode: number, file_data_type: number [in Lua 5] |
|
Writes the image header. Writes the file header at the first time it is called. Writes also the extended image attributes.
ifile:WriteImageInfo(width: number, height: number, user_color_mode: number, user_data_type: number) -> error: number [in Lua 5] |
|
Reads the image data with or without conversion.
ifile:ReadImageData(data: userdata, convert2bitmap: bool, color_mode_flags: number) -> error: number [in Lua 5] |
|
Writes the image data.
ifile:WriteImageData(data: userdata) -> error: number [in Lua 5] |