colorspc.h File Reference

<mi32/colorspc.h> Definitions colorspaces More...

#include <mi32/stddefns.h>

Include dependency graph for colorspc.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Classes

struct  COLORHIS
 Structure for Hue-Intensity/Brightness-Saturation color model. More...
struct  COLORHSV
 Structure for Hue-Saturation-Value (USGS Munsell color model). More...

Enumerations

enum  COLORSPACE {
  COLORSPACE_Unknown = 0, COLORSPACE_Gray8 = 3, COLORSPACE_Gray16 = 4, COLORSPACE_Gray32 = 5,
  COLORSPACE_Indexed8 = 6, COLORSPACE_Indexed16 = 7, COLORSPACE_R8_G8_B8 = 8, COLORSPACE_B8_G8_R8 = 9,
  COLORSPACE_R8_G8_B8_X8 = 16, COLORSPACE_X8_R8_G8_B8 = 17, COLORSPACE_B8_G8_R8_X8 = 18, COLORSPACE_X8_B8_G8_R8 = 19,
  COLORSPACE_R8_G8_B8_A8 = 20, COLORSPACE_A8_R8_G8_B8 = 21, COLORSPACE_B8_G8_R8_A8 = 22, COLORSPACE_A8_B8_G8_R8 = 23,
  COLORSPACE_C8_M8_Y8 = 31, COLORSPACE_C8_M8_Y8_X8 = 32, COLORSPACE_C8_M8_Y8_K8 = 33, COLORSPACE_X8_C8_M8_Y8 = 34,
  COLORSPACE_K8_C8_M8_Y8 = 35, COLORSPACE_Indexed4 = 36, COLORSPACE_Packed8_Binary_LowFirst = 101, COLORSPACE_Packed8_Binary_HighFirst = 102,
  COLORSPACE_Packed8_Gray4_LowFirst = 103, COLORSPACE_Packed8_Gray4_HighFirst = 104, COLORSPACE_Packed8_Indexed4_LowFirst = 105, COLORSPACE_Packed8_Indexed4_HighFirst = 106,
  COLORSPACE_Packed16_X1_R5_G5_B5 = 201, COLORSPACE_Packed16_X1_B5_G5_R5 = 202, COLORSPACE_R16_G16_B16 = 300, COLORSPACE_X16_Y16_Z16 = 301,
  COLORSPACE_L16_a16_b16 = 302
}

Functions

void HBStoRGB (COLORHIS *his, COLOR *rgb)
void historgb (UINT8 *rgb, int *his)
void HIStoRGB (const COLORHIS *his, COLOR *rgb)
void historgb3 (int *red, int *grn, int *blu, int h, int i, int s)
void HSVtoRGB (COLORHSV *hsv, COLOR *rgb)
void RGBtoHBS (COLOR *rgb, COLORHIS *his)
void rgbtohis (UINT8 *rgb, int *his)
void RGBtoHIS (const COLOR *rgb, COLORHIS *his)
void rgbtohis3 (int red, int grn, int blu, int *h, int *i, int *s)
void RGBtoHSV (COLOR *rgb, COLORHSV *hsv)


Detailed Description

<mi32/colorspc.h> Definitions colorspaces

Definition in file colorspc.h.


Enumeration Type Documentation

enum COLORSPACE
 

Color space enumeration, used to described how image/color data is stored in a memory buffer.

Some colorspace values such as those having 'alpha' component may be treated identically to the similar values having a 'skip' component in the same position. In addition, some processes may treat gray and indexed colorspaces identically.

Enumeration values:
COLORSPACE_Unknown 
COLORSPACE_Gray8  Grayscale 1 byte/pixel.

Each component is accessed sequentially in the data using data elements of the size (in bits) specified. For components of more than 8 bits this is assumed to be in the NATIVE byte order of the machine and thus byte swapping may need to be performed when accessing from external sources.

COLORSPACE_Gray16  Grayscale 2 bytes/pixel.
COLORSPACE_Gray32  Grayscale 4 bytes/pixel.
COLORSPACE_Indexed8  Indexed 1 byte/pixel.
COLORSPACE_Indexed16  Indexed 2 bytes/pixel.
COLORSPACE_R8_G8_B8  Red, Green, Blue, 1 byte each.
COLORSPACE_B8_G8_R8  Blue, Green, Red, 1 byte each.
COLORSPACE_R8_G8_B8_X8  Red, Green, Blue, Skip, 1 byte each.
COLORSPACE_X8_R8_G8_B8  Skip, Red, Green, Blue, 1 byte each.
COLORSPACE_B8_G8_R8_X8  Blue, Green, Red, Skip, 1 byte each.
COLORSPACE_X8_B8_G8_R8  Skip, Blue, Green, Red, 1 byte each.
COLORSPACE_R8_G8_B8_A8  Red, Green, Blue, Alpha, 1 byte each.
COLORSPACE_A8_R8_G8_B8  Alpha, Red, Green, Blue, 1 byte each.
COLORSPACE_B8_G8_R8_A8  Blue, Green, Red, Alpha, 1 byte each.
COLORSPACE_A8_B8_G8_R8  Alpha, Blue, Green, Red, 1 byte each.
COLORSPACE_C8_M8_Y8  Cyan, Magenta, Yellow, 1 byte each.
COLORSPACE_C8_M8_Y8_X8  Cyan, Magenta, Yellow, Skip, 1 byte each.
COLORSPACE_C8_M8_Y8_K8  Cyan, Magenta, Yellow, Black, 1 byte each.
COLORSPACE_X8_C8_M8_Y8  Skip, Cyan, Magenta, Yellow, 1 byte each.
COLORSPACE_K8_C8_M8_Y8  Black, Cyan, Magenta, Yellow, 1 byte each.
COLORSPACE_Indexed4  4-bits per pixel colormapped
COLORSPACE_Packed8_Binary_LowFirst  1 bit/pixel, low bit first along image line

More than one pixel or component is 'packed' into a data element. The number after 'Packed' indicates the size of each data element in bits. For elements larger than 8 bits this is assumed to be in the NATIVE byte order of the machine and thus byte swapping may need to be performed when accessing data. When multiple components are packed into a data element they are listed in order from most-significant bits to least.

COLORSPACE_Packed8_Binary_HighFirst  1 bit/pixel, high bit first along image line
COLORSPACE_Packed8_Gray4_LowFirst  4 bits/pixel, low nibble first along image line
COLORSPACE_Packed8_Gray4_HighFirst  4 bits/pixel, high nibble first along image line
COLORSPACE_Packed8_Indexed4_LowFirst  Indexed 4 bits/pixel, low nibble first along image line.
COLORSPACE_Packed8_Indexed4_HighFirst  Indexed 4 bits/pixel, high nibble first along image line.
COLORSPACE_Packed16_X1_R5_G5_B5  0RRRRRGGGGGBBBBB
COLORSPACE_Packed16_X1_B5_G5_R5  0BBBBBGGGGGRRRRR
COLORSPACE_R16_G16_B16  sRGB as 16-bit per sample
COLORSPACE_X16_Y16_Z16  CIE XYZ as 16-bit per sample fixed point.
COLORSPACE_L16_a16_b16  CIE Lab as 16-bit per sample fixed point.

Definition at line 50 of file colorspc.h.


Function Documentation

void HBStoRGB COLORHIS his,
COLOR rgb
 

Convert Hue-Brightness-Saturation to Red-Green-Blue.

void historgb UINT8 rgb,
int *  his
 

Convert Hue-Intensity-Saturation to Red-Green-Blue.

void HIStoRGB const COLORHIS his,
COLOR rgb
 

Convert Hue-Intensity-Saturation to Red-Green-Blue.

void historgb3 int *  red,
int *  grn,
int *  blu,
int  h,
int  i,
int  s
 

Convert Hue-Intensity-Saturation to Red-Green-Blue.

void HSVtoRGB COLORHSV hsv,
COLOR rgb
 

Convert Hue-Brightness-Saturation to Red-Green-Blue.

Hue ranges 0-360 Saturation ranges 0-208 Value ranges 0-512 ("approximately") (according to ENVI documenation & munsell.pro IDL code).

void RGBtoHBS COLOR rgb,
COLORHIS his
 

Convert Red-Green-Blue to Hue-Brightness-Saturation.

void rgbtohis UINT8 rgb,
int *  his
 

Convert Red-Green-Blue to Hue-Intensity-Saturation.

Parameters:
rgb  (range: 0-255)
his  (range: h: 0-360, i: 0-255, s: 0-255)

void RGBtoHIS const COLOR rgb,
COLORHIS his
 

Convert Red-Green-Blue to Hue-Intensity-Saturation.

void rgbtohis3 int  red,
int  grn,
int  blu,
int *  h,
int *  i,
int *  s
 

Convert Red-Green-Blue to Hue-Intensity-Saturation.

Parameters:
red  (range: 0-255)
grn  (range: 0-255)
blu  (range: 0-255)
h  (range: 0-360)
i  (range: 0-255)
s  (range: 0-255)

void RGBtoHSV COLOR rgb,
COLORHSV hsv
 

Convert Red-Green-Blue to Hue-Saturation-Value.

Hue ranges 0-360 Saturation ranges 0-208 Value ranges 0-512 ("approximately") (according to ENVI documenation & munsell.pro IDL code).


Generated on Tue Dec 14 13:18:59 2004 for TNTsdk by  doxygen 1.3.8-20040913