IM: Write Access

IM - Imaging Libray

Write Access
[Image Storage]


Detailed Description

See im.h


Functions

imFileimFileNew (const char *file_name, const char *format, int *error)
void imFileSetInfo (imFile *ifile, const char *compression)
void imFileSetPalette (imFile *ifile, long *palette, int palette_count)
int imFileWriteImageInfo (imFile *ifile, int width, int height, int user_color_mode, int user_data_type)
int imFileWriteImageData (imFile *ifile, void *data)

Function Documentation

imFile* imFileNew const char *  file_name,
const char *  format,
int *  error
 

Creates a new file for writing. If the file exists will be replaced.
It will only initialize the format driver and create the file, no data is actually written.

void imFileSetInfo imFile ifile,
const char *  compression
 

Changes the write compression method.
If the compression is not supported will return an error code when writting.
Use NULL to set the default compression. You can use the imFileGetInfo to retrieve the actual compression but only after imFileWriteImageInfo. Only a few formats allow you to change the compression between frames.

void imFileSetPalette imFile ifile,
long *  palette,
int  palette_count
 

Changes the pallete.
"palette_count" is >0 and <=256.

int imFileWriteImageInfo imFile ifile,
int  width,
int  height,
int  user_color_mode,
int  user_data_type
 

Writes the image header. Writes the file header at the first time it is called. Writes also the extended image attributes.
Must call imFileSetPalette and set other attributes before calling this function.
In some formats the color space will be converted to match file format specification.
Returns an error code. This function must be called at least once, check each format documentation.

int imFileWriteImageData imFile ifile,
void *  data
 

Writes the image data.
Returns an error code.