gml_Bitmap_base.h File Reference


Detailed Description

Basic operation on gml_TBitmaps: allocation, de-allocation.

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

Go to the source code of this file.


Defines

#define GML_BITMAP_PADDING_AUTO   (-1)
 When used as the rowOffset parameter of gml_BitmapInit(), specifies that the created bitmap should have 32-bit word-aligned lines.
#define GML_BITMAP_PADDING_NONE   (-2)
 When used as the rowOffset parameter of gml_BitmapInit(), specifies that the created bitmap should have unaligned lines.

Functions

GML_EXTERN_C void gml_BitmapInitialize ()
 Initialize gml_TBitmap error codes.
GML_EXTERN_C gml_TError gml_BitmapInit (gml_TBitmap *bitmap, int width, int height, gml_TPixelEncoding encoding, int rowOffset, int fromTop)
 Initialize the fields of a gml_TBitmap and allocates the memory for the pixels.
GML_EXTERN_C void gml_BitmapDispose (gml_TBitmap *bitmap)
 Release the bitmap's buffer.
GML_EXTERN_C void gml_BitmapZero (gml_TBitmap *bitmap)
 Set all bitmap fields to 0.
GML_EXTERN_C gml_TError gml_BitmapAllocAndInit (gml_TBitmap **bitmap, int width, int height, gml_TPixelEncoding encoding, int rowOffset, int fromTop)
 Same as gml_BitmapInit but the bitmap structure is first allocated.
GML_EXTERN_C void gml_BitmapTestDisposeAndFree (gml_TBitmap **bitmap)
 Same as gml_BitmapDispose but returns immediately if the pointer to the bitmap is NULL, and if not, the bitmap structure is finally freed (and its pointer set to NULL).
GML_EXTERN_C void * gml_BitmapPixel (gml_TBitmap *bitmap, int x, int y)
 Return the address of the pixel at (x,y) in the argument bitmap.

Variables

gml_TError gml_gBitmap_rowOffsetTooSmall
gml_TError gml_gBitmap_notSameSize
gml_TError gml_gBitmap_invalidROI
gml_TError gml_gBitmap_unknownEncoding
gml_TError gml_gBitmap_unsupportedEncoding
gml_TError gml_gBitmap_wrongChannelNumber

Function Documentation

GML_EXTERN_C void gml_BitmapInitialize (  ) 

Initialize gml_TBitmap error codes.

Must be called in order to associate error messages to error codes. Can be called many times (simply returns if already initialized).

GML_EXTERN_C gml_TError gml_BitmapInit ( gml_TBitmap bitmap,
int  width,
int  height,
gml_TPixelEncoding  encoding,
int  rowOffset,
int  fromTop 
)

Initialize the fields of a gml_TBitmap and allocates the memory for the pixels.

bitmap must be allocated (but not initialized).

If rowOffset is GML_BITMAP_PADDING_AUTO, it is computed by gml_BitmapInit as the smallest possible multiple of 4.

If rowOffset is GML_BITMAP_PADDING_NONE, it is computed by gml_BitmapInit as the smallest possible value (no padding between lines).

GML_EXTERN_C void* gml_BitmapPixel ( gml_TBitmap bitmap,
int  x,
int  y 
)

Return the address of the pixel at (x,y) in the argument bitmap.

Will call abort() if (x,y) is outside the bitmap boundaries. Warning: calling this is slow, don't use in a tight loop!

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