luxos/SysCore/video/color/color.h

66 lines
2.3 KiB
C

#ifndef __COLOR__H__
#define __COLOR__H__
/**RGB color structure.*/
typedef struct {
unsigned char R,G,B;
} RGBColor;
/**\Monochrome (black and white)*/
typedef bool Color_1Bpp;
/**CGA 2 bits per pixel indexed color.\n\n\Notes: Cannot be converted to/from RGB.*/
typedef unsigned char Color_2Bpp;
/**16 color VGA.
* \n\n\Format: Uses 1-1-1 bit format, highest bit is intensity.
* \n\n\Notes: Unused bits are ignored (should be 0).*/
typedef unsigned char Color_4Bpp;
/**64 color EGA.
* \n\n\Format: Uses 2-2-2 bit format.
* \n\n\Notes: High 2 bits are ignored (should be 0).*/
typedef unsigned char Color_6Bpp;
/**256 color VGA.
* \n\n\Format: Uses 3-3-2 bit format
* \n\n\Notes: The palette must be changed before usable.*/
typedef unsigned char Color_8Bpp;
/**SVGA Highcolor palette.
* \n\n\Format: Uses 5-5-5 bit format.
* \n\n\Notes: Unused high bit is ignored (should be 0).*/
typedef unsigned short Color_15Bpp;
/**SVGA Highcolor palette.
* \n\n\Format: Uses 5-6-5 bit format.*/
typedef unsigned short Color_16Bpp;
/**VGA 18-bit RGB
* \n\n\Format: Uses the RGBColor structure, with the R, G and B components.
* \n\n\Notes: High 2 bits of each component are ignored, should be 0.*/
typedef RGBColor Color_18Bpp;
/**24-bit Truecolor
* \n\n\Format: Uses the RGBColor structure, with the R, G and B components.*/
typedef RGBColor Color_24Bpp;
/**Few functions to convert values from one format to another.*/
extern RGBColor Convert_1bpp_to_RGB(Color_1Bpp c);
extern RGBColor Convert_4bpp_to_RGB(Color_4Bpp c);
extern RGBColor Convert_6bpp_to_RGB(Color_6Bpp c);
extern RGBColor Convert_8bpp_to_RGB(Color_8Bpp c);
extern RGBColor Convert_15bpp_to_RGB(Color_15Bpp c);
extern RGBColor Convert_16bpp_to_RGB(Color_16Bpp c);
extern RGBColor Convert_18bpp_to_RGB(Color_18Bpp c);
extern RGBColor Convert_24bpp_to_RGB(Color_24Bpp c);
extern Color_1Bpp Convert_RGB_to_1bpp(RGBColor c);
extern Color_4Bpp Convert_RGB_to_4bpp(RGBColor c);
extern Color_6Bpp Convert_RGB_to_6bpp(RGBColor c);
extern Color_8Bpp Convert_RGB_to_8bpp(RGBColor c);
extern Color_15Bpp Convert_RGB_to_15bpp(RGBColor c);
extern Color_16Bpp Convert_RGB_to_16bpp(RGBColor c);
extern Color_18Bpp Convert_RGB_to_18bpp(RGBColor c);
extern Color_24Bpp Convert_RGB_to_24bpp(RGBColor c);
#endif