PixelType.h File Reference


Enumerations

enum  PixelType {
  MASK, MONO, RGBx, RGB,
  RGBA, RGB32, ARGB32, RGBM,
  MRGB32
}

Functions

int depth (PixelType t)

Detailed Description


Enumeration Type Documentation

enum PixelType
 

Enumeration describing how colors are stored in an array of bytes that is a pixel. This is used as an argument for drawimage(), readimage(), and Image.

Notice that the order of the bytes in memory of ARGB32 or RGB32 is a,r,g,b on a little-endian machine and b,g,r,a on a big-endian machine. Due to the use of these types by Windows, this is often the fastest form of data, if you have a choice. To convert an Color to RGB32, shift it right by 8 (for ARGB32 shift the alpha left 24 and or it in).

More types may be added in the future. The set is as minimal as possible while still covering the types I have actually encountered.

Enumeration values:
MASK  1 byte of inverted mask, filled with current color
MONO  1 byte of gray scale
RGBx  bytes in r,g,b,a,r,g,b,a... order, a byte is ignored
RGB  bytes in r,g,b,r,g,b... order
RGBA  bytes in r,g,b,a,r,g,b,a... order
RGB32  32-bit words containiing 0xaarrggbb (aa is ignored)
ARGB32  32-bit words containing 0xaarrggbb
RGBM  unpremultiplied bytes in r,g,b,a order
MRGB32  unpremultiplied 0xaarrggbb


Function Documentation

int depth PixelType  t  )  [inline]
 

Turn a PixelType into the number of bytes needed to hold a pixel.


Sun Jan 7 00:55:17 2007. FLTK ©2006 Bill Spitzak and others.
Permission is granted to reproduce this manual or any portion for any purpose, provided this copyright and permission notice are preserved.