gml_RGBColor.h File Reference


Detailed Description

Defines the gml_TRGBColor struct: a structure for representing color and converting from the canonical RGB representation to other representations.

#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.


Classes

struct  gml_TRGBColor
 High-resolution (48-bit) colors. More...

Defines

#define GML_CCOLORARRAYNBELEM   50
 number of predefined colors

Functions

GML_EXTERN_C gml_TError gml_RGBColorPixelValue (gml_TRGBColor *c, gml_TPixelEncoding encoding, void *value)
 Converts the color c into a pixel value according to the encoding encoding.
GML_EXTERN_C gml_TError gml_RGBColorSetFromValue (gml_TRGBColor *c, gml_TPixelEncoding encoding, void *value)
 Sets the color c from the pixel value at address value.

Variables

GML_EXTERN_C gml_TRGBColor gml_gRGBColor_DefaultArray [GML_CCOLORARRAYNBELEM]
 array of predefined colors
GML_EXTERN_C gml_TRGBColor gml_gRGBColor_White
GML_EXTERN_C gml_TRGBColor gml_gRGBColor_Black
GML_EXTERN_C gml_TRGBColor gml_gRGBColor_Red
GML_EXTERN_C gml_TRGBColor gml_gRGBColor_Green
GML_EXTERN_C gml_TRGBColor gml_gRGBColor_Blue

Function Documentation

GML_EXTERN_C gml_TError gml_RGBColorPixelValue ( gml_TRGBColor c,
gml_TPixelEncoding  encoding,
void *  value 
)

Converts the color c into a pixel value according to the encoding encoding.

Stores the result at the address value. The size of what is pointed to by value varies depends on encoding:

  • 4 bytes per pixel encodings translate to an UInt32
  • 3 bytes per pixel encodings translate to an UInt32 (the high order byte is 0)
  • 2 bytes per pixel encodings translate to an UInt16
  • 1 bytes per pixel encodings translate to an UInt8

GML_EXTERN_C gml_TError gml_RGBColorSetFromValue ( gml_TRGBColor c,
gml_TPixelEncoding  encoding,
void *  value 
)

Sets the color c from the pixel value at address value.

Conversion is done according to the encoding of the pixel. See gml_RGBColorPixelValue() for a discussion on the size of value.

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