00001
00058 #ifndef INC_MI32_COLORSPC_H
00059 #define INC_MI32_COLORSPC_H
00060
00061 #ifndef INC_MI32_STDDEFNS_H
00062 #include <mi32/stddefns.h>
00063 #endif
00064
00065 #ifndef GENERATING_DOXYGEN_OUTPUT
00066
00067 struct COLOR;
00068 #endif
00069
00070
00087 enum COLORSPACE {
00088 COLORSPACE_Unknown = 0,
00089
00090
00091
00092 COLORSPACE_Gray8 = 3,
00093 COLORSPACE_Gray16 = 4,
00094 COLORSPACE_Gray32 = 5,
00095
00096 COLORSPACE_Indexed8 = 6,
00097 COLORSPACE_Indexed16 = 7,
00098 COLORSPACE_R8_G8_B8 = 8,
00099 COLORSPACE_B8_G8_R8 = 9,
00100 COLORSPACE_R8_G8_B8_X8 = 16,
00101 COLORSPACE_X8_R8_G8_B8 = 17,
00102 COLORSPACE_B8_G8_R8_X8 = 18,
00103 COLORSPACE_X8_B8_G8_R8 = 19,
00104 COLORSPACE_R8_G8_B8_A8 = 20,
00105 COLORSPACE_A8_R8_G8_B8 = 21,
00106 COLORSPACE_B8_G8_R8_A8 = 22,
00107 COLORSPACE_A8_B8_G8_R8 = 23,
00108
00109 COLORSPACE_C8_M8_Y8 = 31,
00110 COLORSPACE_C8_M8_Y8_X8 = 32,
00111 COLORSPACE_C8_M8_Y8_K8 = 33,
00112 COLORSPACE_X8_C8_M8_Y8 = 34,
00113 COLORSPACE_K8_C8_M8_Y8 = 35,
00114 COLORSPACE_Indexed4 = 36,
00115
00116
00117
00118 COLORSPACE_Packed8_Binary_LowFirst = 101,
00119 COLORSPACE_Packed8_Binary_HighFirst = 102,
00120 COLORSPACE_Packed8_Gray4_LowFirst = 103,
00121 COLORSPACE_Packed8_Gray4_HighFirst = 104,
00122 COLORSPACE_Packed8_Indexed4_LowFirst = 105,
00123 COLORSPACE_Packed8_Indexed4_HighFirst = 106,
00124
00125 COLORSPACE_Packed16_X1_R5_G5_B5 = 201,
00126 COLORSPACE_Packed16_X1_B5_G5_R5 = 202,
00127
00128 COLORSPACE_R16_G16_B16 = 300,
00129 COLORSPACE_X16_Y16_Z16 = 301,
00130 COLORSPACE_L16_a16_b16 = 302
00131
00132 };
00133
00134
00135
00136
00138 struct COLORHIS {
00139 float Hue;
00140 float Intensity;
00141 float Saturation;
00142 };
00143
00145 struct COLORHSV {
00146 float Hue;
00147 float Saturation;
00148 float Value;
00149 };
00150
00151
00153
00154
00155 #if defined(__cplusplus)
00156 extern "C" {
00157 #endif
00158
00161 bool ConvertHBStoColor (
00162 double hue,
00163 double brightness,
00164 double saturation,
00165 COLOR& color
00166 );
00167
00170 bool ConvertHBStoRGB (
00171 double hue,
00172 double brightness,
00173 double saturation,
00174 double MaxRGB,
00175 double& red,
00176 double& green,
00177 double& blue
00178 );
00179
00182 bool ConvertHIStoColor (
00183 double hue,
00184 double intensity,
00185 double saturation,
00186 COLOR& color
00187 );
00188
00191 bool ConvertHIStoRGB (
00192 double hue,
00193 double intensity,
00194 double saturation,
00195 double MaxRGB,
00196 double& red,
00197 double& green,
00198 double& blue
00199 );
00200
00203 bool ConvertColorToHBS (
00204 const COLOR& color,
00205 double& hue,
00206 double& brightness,
00207 double& saturation
00208 );
00209
00212 bool ConvertColorToHIS (
00213 const COLOR& color,
00214 double& hue,
00215 double& intensity,
00216 double& saturation
00217 );
00218
00221 bool ConvertRGBtoHBS (
00222 double MaxRGB,
00223 double red,
00224 double green,
00225 double blue,
00226 double& hue,
00227 double& brightness,
00228 double& saturation
00229 );
00230
00233 bool ConvertRGBtoHIS (
00234 double MaxRGB,
00235 double red,
00236 double green,
00237 double blue,
00238 double& hue,
00239 double& intensity,
00240 double& saturation
00241 );
00242
00249 void HSVtoRGB (
00250 const COLORHSV *hsv,
00251 COLOR *rgb
00252 );
00253
00260 void RGBtoHSV (
00261 const COLOR *rgb,
00262 COLORHSV *hsv
00263 );
00264
00265
00266 #ifndef NO_DEPRECATED
00267
00270 DEPRECATED void HBStoRGB (
00271 const COLORHIS *his,
00272 COLOR *rgb
00273 );
00274
00277 DEPRECATED void HIStoRGB (
00278 const COLORHIS *his,
00279 COLOR *rgb
00280 );
00281
00284 DEPRECATED void RGBtoHBS (
00285 const COLOR *rgb,
00286 COLORHIS *his
00287 );
00288
00291 DEPRECATED void RGBtoHIS (
00292 const COLOR *rgb,
00293 COLORHIS *his
00294 );
00295
00296 #endif // NO_DEPRECATED
00297
00298 #if defined(__cplusplus)
00299 }
00300 #endif
00301
00302 #endif // INC_MI32_COLORSPC_H