gml_Bitmap_IO.h File Reference


Detailed Description

API for loading and saving image files, using gml_TBitmaps.

Uses ImageMagick to handle a variety of formats, including but not limited to: PNG, TIFF, JPEG, PPM...

Todo:
provide means to control compression and quality.

#include "gml/base/gml_Errors.h"
#include "gml/base/gml_Types.h"
#include "gml/image/gml_Bitmap.h"

Go to the source code of this file.


Functions

GML_EXTERN_C gml_TError gml_BitmapIO_File_Load (gml_TBitmap *bitmap, char *format, char *filename)
 Loads an image from a file to a bitmap structure.
GML_EXTERN_C gml_TError gml_BitmapIO_Memory_Load (gml_TBitmap *bitmap, char *format, gml_TPointer data, UInt32 bytes)
 Loads an image from a memory blob to a bitmap structure.
GML_EXTERN_C gml_TError gml_BitmapIO_File_Save (gml_TBitmap *bitmap, char *format, UInt32 parameter, char *filename)
 Copy an image from a bitmap structure to a file.
GML_EXTERN_C gml_TError gml_BitmapIO_Memory_Save (gml_TBitmap *bitmap, char *format, UInt32 parameter, gml_TPointer data, UInt32 *bytes)
 Copy an image from a bitmap structure to a memory blob.

Variables

gml_TError gml_gBitmap_unknownFormat
gml_TError gml_gBitmap_badFormat

Function Documentation

GML_EXTERN_C gml_TError gml_BitmapIO_File_Load ( gml_TBitmap bitmap,
char *  format,
char *  filename 
)

Loads an image from a file to a bitmap structure.

The format is infered from format parameter, if not NULL, else, if possible, from the filename, else from the first few bytes of the file.

Parameters:
bitmap an allocated, uninitialized bitmap. Upon successful return, contains the loaded image.
format the three-character code of the format to use, e.g. "JPG" or "TIF".
filename the path to the file.

GML_EXTERN_C gml_TError gml_BitmapIO_Memory_Load ( gml_TBitmap bitmap,
char *  format,
gml_TPointer  data,
UInt32  bytes 
)

Loads an image from a memory blob to a bitmap structure.

The format is infered from format parameter, else from the first few bytes of the blob. Most parameters are the same as for gml_BitmapIO_File_Load.

Parameters:
data the block of memory from which to load
bytes the number of bytes in the block of memory

GML_EXTERN_C gml_TError gml_BitmapIO_File_Save ( gml_TBitmap bitmap,
char *  format,
UInt32  parameter,
char *  filename 
)

Copy an image from a bitmap structure to a file.

The format is infered from format parameter, if not NULL, else from the filename.

Parameters:
bitmap is the image in memory to be saved.
format the three-character code of the format to use, e.g. "JPG" or "TIF".
parameter for JPEG or TIFF/JPEG formats, the least 8 bits must be an integer between 0 and 100 that will be used as the JPEG "quality" setting.
filename is the path to the file.

GML_EXTERN_C gml_TError gml_BitmapIO_Memory_Save ( gml_TBitmap bitmap,
char *  format,
UInt32  parameter,
gml_TPointer  data,
UInt32 bytes 
)

Copy an image from a bitmap structure to a memory blob.

The format is infered from format parameter. Most parameters are the same as for gml_BitmapIO_File_Save.

Parameters:
data points to the block of encoded data. This block should be allocated by the caller.
bytes at call time, the available bytes in data. upon successful return, points to the number of bytes of encoded data.

Generated on Tue Jun 12 14:03:28 2007 for gml by Doxygen 1.5.2.