Graphics
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. | |
#define | G_COEF 242 |
Green component sensivity. | |
#define | B_COEF 107 |
Blue component sensivity. | |
Eye sensivity to different color components, squared | |
#define | R_COEF_SQ 299 |
Red component sensivity, squared. | |
#define | G_COEF_SQ 587 |
Green component sensivity, squared. | |
#define | B_COEF_SQ 114 |
Blue component sensivity, squared. | |
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. | |
void | csDiscardPackedRGB (const uint8 *rgb) |
Frees memory possibly allocated by csPackRGBcolorToRGB(). | |
const csRGBcolor * | csUnpackRGBtoRGBcolor (const uint8 *rgb, int numPixels) |
Unpack a RGB byte array into an array of csRGBcolor. | |
void | csDiscardUnpackedRGBcolor (const csRGBcolor *pixels) |
Frees memory possibly allocated by csUnpackRGBtoRGBcolor(). | |
const uint8 * | csPackRGBpixelToRGBA (const csRGBpixel *pixels, int numPixels) |
Pack an array of csRGBpixel into a RGBA byte array. | |
void | csDiscardPackedRGBA (const uint8 *rgba) |
Frees memory possibly allocated by csPackRGBpixelToRGBA(). | |
const csRGBpixel * | csUnpackRGBAtoRGBpixel (const uint8 *rgba, int numPixels) |
Unpack a RGBA byte array into an array of csRGBpixel. | |
csRGBpixel * | csCopyUnpackRGBAtoRGBpixel (const uint8 *rgba, int numPixels) |
Unpack a RGBA byte array into an array of csRGBpixel. | |
void | csDiscardUnpackedRGBpixel (const csRGBpixel *pixels) |
Frees memory possibly allocated by csUnpackRGBAtoRGBpixel(). | |
uint8 * | csPackRGBpixelToRGB (const csRGBpixel *pixels, int numPixels) |
Pack an array of csRGBpixel into a RGB byte array. | |
csRGBcolor * | csUnpackRGBAtoRGBcolor (const uint8 *rgba, int numPixels) |
Unpack a RGBA byte array into an array of csRGBcolor. | |
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. |
Define Documentation
|
Blue component sensivity.
Definition at line 208 of file rgbpixel.h. |
|
Blue component sensivity, squared.
Definition at line 217 of file rgbpixel.h. |
|
Green component sensivity.
Definition at line 206 of file rgbpixel.h. |
|
Green component sensivity, squared.
Definition at line 215 of file rgbpixel.h. |
|
Red component sensivity.
Definition at line 204 of file rgbpixel.h. |
|
Red component sensivity, squared.
Definition at line 213 of file rgbpixel.h. |
Function Documentation
|
Unpack a RGBA byte array into an array of csRGBpixel.
Definition at line 250 of file packrgb.h. References csUnpackRGBAtoRGBpixel(). |
|
Create an iImage with a nice XOR pattern with 2^
|
|
Frees memory possibly allocated by csPackRGBcolorToRGB().
|
|
Frees memory possibly allocated by csPackRGBpixelToRGBA().
|
|
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, and csRGBcolor::red. |
|
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, and csRGBpixel::red. |
|
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, and csRGBpixel::red. |
|
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, and csRGBcolor::red. |
|
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, and csRGBpixel::red. 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, and csRGBcolor::red. |
Generated for Crystal Space by doxygen 1.2.18