![]() |
Public API Reference |
Modules | |
2D | |
3D | |
Compounds | |
class | csColorQuantizer |
Color quantizer. More... | |
struct | csRGBcolor |
An RGB color. More... | |
struct | csRGBpixel |
An RGB pixel. More... | |
Eye sensivity to different color components | |
Eye sensivity to different color components, from NTSC grayscale equation.
The coefficients are multiplied by 100 and rounded towards nearest integer, to facilitate integer math. The squared coefficients are also multiplied by 100 and rounded to nearest integer (thus 173 == 1.73, 242 == 2.42 etc). | |
#define | R_COEF 173 |
Red component sensivity. More... | |
#define | G_COEF 242 |
Green component sensivity. More... | |
#define | B_COEF 107 |
Blue component sensivity. More... | |
Eye sensivity to different color components, squared | |
#define | R_COEF_SQ 299 |
Red component sensivity, squared. More... | |
#define | G_COEF_SQ 587 |
Green component sensivity, squared. More... | |
#define | B_COEF_SQ 114 |
Blue component sensivity, squared. More... | |
Pixel packing | |
When using csRGBcolor or csRGBpixel, don't assume that sizeof(csRGBcolor) == 3, sizeof(csRGBpixel) == 4 or that those struct are stored as a packed RGB/RGBA byte array.
If you need such packed RGB/RGBA data (e.g. for use with external libraries) use the functions here to convert from csRGBcolor/csRGBpixel to RGB/RGBA and vice versa. If no copy of the data is needed, they are free on platforms where sizeof(csRGBcolor) == 3, sizeof(csRGBpixel) == 4 are true. In any other case copying/packing the data is handled appropriately. | |
uint8 * | csPackRGBcolorToRGB (const csRGBcolor *pixels, int numPixels) |
Pack an array of csRGBcolor into a RGB byte array. More... | |
void | csDiscardPackedRGB (const uint8 *rgb) |
Frees memory possibly allocated by csPackRGBcolorToRGB(). More... | |
const csRGBcolor * | csUnpackRGBtoRGBcolor (const uint8 *rgb, int numPixels) |
Unpack a RGB byte array into an array of csRGBcolor. More... | |
void | csDiscardUnpackedRGBcolor (const csRGBcolor *pixels) |
Frees memory possibly allocated by csUnpackRGBtoRGBcolor(). More... | |
const uint8 * | csPackRGBpixelToRGBA (const csRGBpixel *pixels, int numPixels) |
Pack an array of csRGBpixel into a RGBA byte array. More... | |
void | csDiscardPackedRGBA (const uint8 *rgba) |
Frees memory possibly allocated by csPackRGBpixelToRGBA(). More... | |
const csRGBpixel * | csUnpackRGBAtoRGBpixel (const uint8 *rgba, int numPixels) |
Unpack a RGBA byte array into an array of csRGBpixel. More... | |
csRGBpixel * | csCopyUnpackRGBAtoRGBpixel (const uint8 *rgba, int numPixels) |
Unpack a RGBA byte array into an array of csRGBpixel. More... | |
void | csDiscardUnpackedRGBpixel (const csRGBpixel *pixels) |
Frees memory possibly allocated by csUnpackRGBAtoRGBpixel(). More... | |
uint8 * | csPackRGBpixelToRGB (const csRGBpixel *pixels, int numPixels) |
Pack an array of csRGBpixel into a RGB byte array. More... | |
csRGBcolor * | csUnpackRGBAtoRGBcolor (const uint8 *rgba, int numPixels) |
Unpack a RGBA byte array into an array of csRGBcolor. More... | |
Functions | |
csPtr< iImage > | csCreateXORPatternImage (int width, int height, int recdepth, float red=1.0f, float green=1.0f, float blue=1.0f) |
Create an iImage with a nice XOR pattern with 2^recdepth shades of from white to black. More... |
|
Blue component sensivity.
Definition at line 198 of file rgbpixel.h. |
|
Blue component sensivity, squared.
Definition at line 207 of file rgbpixel.h. |
|
Green component sensivity.
Definition at line 196 of file rgbpixel.h. |
|
Green component sensivity, squared.
Definition at line 205 of file rgbpixel.h. |
|
Red component sensivity.
Definition at line 194 of file rgbpixel.h. |
|
Red component sensivity, squared.
Definition at line 203 of file rgbpixel.h. |
|
Unpack a RGBA byte array into an array of csRGBpixel.
Definition at line 250 of file packrgb.h. References csUnpackRGBAtoRGBpixel, and uint8. |
|
Create an iImage with a nice XOR pattern with 2^
|
|
Frees memory possibly allocated by csPackRGBcolorToRGB().
Definition at line 116 of file packrgb.h. References uint8. |
|
Frees memory possibly allocated by csPackRGBpixelToRGBA().
Definition at line 229 of file packrgb.h. References uint8. |
|
Frees memory possibly allocated by csUnpackRGBtoRGBcolor().
|
|
Frees memory possibly allocated by csUnpackRGBAtoRGBpixel().
|
|
Pack an array of csRGBcolor into a RGB byte array.
Definition at line 101 of file packrgb.h. References csRGBcolor::blue, csRGBcolor::green, csRGBcolor::red, and uint8. |
|
Pack an array of csRGBpixel into a RGB byte array. Alpha information is discarded!
Definition at line 272 of file packrgb.h. References csRGBpixel::blue, csRGBpixel::green, csRGBpixel::red, and uint8. |
|
Pack an array of csRGBpixel into a RGBA byte array.
Definition at line 213 of file packrgb.h. References csRGBpixel::alpha, csRGBpixel::blue, csRGBpixel::green, csRGBpixel::red, and uint8. |
|
Unpack a RGBA byte array into an array of csRGBcolor. Alpha information is discarded!
Definition at line 296 of file packrgb.h. References csRGBcolor::blue, csRGBcolor::green, csRGBcolor::red, and uint8. |
|
Unpack a RGBA byte array into an array of csRGBpixel.
Definition at line 234 of file packrgb.h. References csRGBpixel::alpha, csRGBpixel::blue, csRGBpixel::green, csRGBpixel::red, and uint8. Referenced by csCopyUnpackRGBAtoRGBpixel. |
|
Unpack a RGB byte array into an array of csRGBcolor.
Definition at line 121 of file packrgb.h. References csRGBcolor::blue, csRGBcolor::green, csRGBcolor::red, and uint8. |