Main Page   Class Hierarchy   Compound List   File List   Compound Members  

KrRGBA Union Reference

The basic color and pixel structure. More...

#include <color.h>

List of all members.

Public Methods

float Redf () const
 Color accessor, for OpenGL.

void Set (U8 _red, U8 _green, U8 _blue, U8 _alpha=255)
 Set all the members at once - a convenience method.

void FromString (const char *str)
 Reads a color in the rrggbbaa or rrggbb format. More...


Detailed Description

The basic color and pixel structure.

This may be the greatest number of interpretations of the least amount of data.

Color is one byte each of red, green, blue, and alpha. Sometimes its useful to think of these as bytes (the components), sometimes as an array, and sometimes as one 32 bit value. This is accomplisted, of course, with a union.

Nothing is guarenteed about the order of red, green, blue, and alpha, and ifdefs may be used to change this on various systems.

In order to access the color that you want via 'array', an enumeration is defined.

Addtionally, assuming no system will ever have the alpha in between the other colors, you can iterate through 'array' from START to < END to get all the colors without alpha.

Note:
There is no constructor -- it is oppressive in debug mode to have the constructor getting called on huge blocks of memory. Use 'Set' for an initializer.
Note:
A constructor will screw up memory pool allocation in KrRleSegment.


Member Function Documentation

void KrRGBA::FromString const char *    str
 

Reads a color in the rrggbbaa or rrggbb format.

Used for parsing the XML files.


The documentation for this union was generated from the following file:
Generated on Mon Sep 15 12:01:11 2003 for Kyra by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001