IM: imImage Storage

From IM - An Imaging Tool

imImage Storage
[Image Storage]


Detailed Description

Functions to simplify the process of reading and writting imImage structures.
See im_image.h


Functions

imImage * imFileLoadImage (imFile *ifile, int index, int *error)
void imFileLoadImageFrame (imFile *ifile, int index, imImage *image, int *error)
imImage * imFileLoadBitmap (imFile *ifile, int index, int *error)
void imFileLoadBitmapFrame (imFile *ifile, int index, imImage *image, int *error)
int imFileSaveImage (imFile *ifile, const imImage *image)
imImage * imFileImageLoad (const char *file_name, int index, int *error)
imImage * imFileImageLoadBitmap (const char *file_name, int index, int *error)
int imFileImageSave (const char *file_name, const char *format, const imImage *image)

Function Documentation

imImage* imFileLoadImage (  imFile *  ifile,
int  index,
int *  error
) 
 

Loads an image from an already open file. Returns NULL if failed.
This will call imFileReadImageInfo and imFileReadImageData.
index specifies the image number between 0 and image_count-1.
The returned imagem will be of the same color_space and data_type of the image in the file.

void imFileLoadImageFrame (  imFile *  ifile,
int  index,
imImage *  image,
int *  error
) 
 

Loads an image from an already open file. Returns NULL if failed.
This function assumes that the image in the file has the same parameters as the given image.
This will call imFileReadImageInfo and imFileReadImageData.
index specifies the image number between 0 and image_count-1.
The returned imagem will be of the same color_space and data_type of the image in the file.

imImage* imFileLoadBitmap (  imFile *  ifile,
int  index,
int *  error
) 
 

Loads an image from an already open file, but forces the image to be a bitmap.
The returned imagem will be always a Bitmap image, with color_space RGB, MAP, GRAY or BINARY, and data_type IM_BYTE.
index specifies the image number between 0 and image_count-1.
Returns NULL if failed.

void imFileLoadBitmapFrame (  imFile *  ifile,
int  index,
imImage *  image,
int *  error
) 
 

Loads an image from an already open file, but forces the image to be a bitmap.
This function assumes that the image in the file has the same parameters as the given image.
The imagem must be a Bitmap image, with color_space RGB, MAP, GRAY or BINARY, and data_type IM_BYTE.
index specifies the image number between 0 and image_count-1.
Returns NULL if failed.

int imFileSaveImage (  imFile *  ifile,
const imImage *  image
) 
 

Saves the image to an already open file.
This will call imFileWriteImageInfo and imFileWriteImageData.
Returns error code.

imImage* imFileImageLoad (  const char *  file_name,
int  index,
int *  error
) 
 

Loads an image from file. Open, loads and closes the file.
index specifies the image number between 0 and image_count-1.
Returns NULL if failed.

imImage* imFileImageLoadBitmap (  const char *  file_name,
int  index,
int *  error
) 
 

Loads an image from file, but forces the image to be a bitmap. Open, loads and closes the file.
index specifies the image number between 0 and image_count-1.
Returns NULL if failed.

int imFileImageSave (  const char *  file_name,
const char *  format,
const imImage *  image
) 
 

Saves the image to file. Open, saves and closes the file.
Returns error code.