00001
00112 #ifndef INC_MI32_COLRCONV_H
00113 #define INC_MI32_COLRCONV_H
00114
00115 #ifndef INC_MI32_COLORSPC_H
00116 #include <mi32/colorspc.h>
00117 #endif
00118
00119 #ifndef INC_MI32_NUMTYPE_H
00120 #include <mi32/numtype.h>
00121 #endif
00122
00123 #ifndef INC_RVC_IMAGE_H
00124 #include <rvc/image.h>
00125 #endif
00126
00127
00128 #ifndef GENERATING_DOXYGEN_OUTPUT
00129 class COLOR_ARRAY;
00130 struct CBPARMS;
00131 struct DISPLAYINFO;
00132 class CONTRASTPARM;
00133 namespace MGD {
00134 class DEVICE;
00135 }
00136 #endif
00137
00138
00139
00140
00141
00142 enum COLORCOMPFLAGS {
00143 COLORCOMPFLAG_None = 0,
00144 COLORCOMPFLAG_DoContrast = 0x00000001,
00145 COLORCOMPFLAG_UseColMap = 0x00000002,
00146 COLORCOMPFLAG_Out32For24 = 0x00000004,
00147 COLORCOMPFLAG_ScaleInt255 = 0x00000008,
00148 COLORCOMPFLAG_ScaleSat255 = 0x00000010,
00149 COLORCOMPFLAG_ScaleHue255 = 0x00000020,
00150 COLORCOMPFLAG_AdjustInt4 = 0x00000040,
00151 COLORCOMPFLAG_OutPixel = 0x00000080,
00152 COLORCOMPFLAG_DoBlendMask = 0x00000100,
00153 COLORCOMPFLAG_MaskToAlpha = 0x00000200,
00154 };
00155 #ifndef GENERATING_DOXYGEN_OUTPUT
00156 DEFINE_ENUM_OP_BITWISE(COLORCOMPFLAGS)
00157 #endif
00158
00159 #define CONVCOMP_DoContrast COLORCOMPFLAG_DoContrast
00160 #define CONVCOMP_UseColMap COLORCOMPFLAG_UseColMap
00161 #define CONVCOMP_Out32For24 COLORCOMPFLAG_Out32For24
00162 #define CONVCOMP_ScaleInt255 COLORCOMPFLAG_ScaleInt255
00163 #define CONVCOMP_ScaleSat255 COLORCOMPFLAG_ScaleSat255
00164 #define CONVCOMP_ScaleHue255 COLORCOMPFLAG_ScaleHue255
00165 #define CONVCOMP_AdjustInt4 COLORCOMPFLAG_AdjustInt4
00166 #define CONVCOMP_OutPixel COLORCOMPFLAG_OutPixel
00167 #define CONVCOMP_DoBlendMask COLORCOMPFLAG_DoBlendMask
00168 #define CONVCOMP_MaskToAlpha COLORCOMPFLAG_MaskToAlpha
00169
00170
00173 #define COLOR_BLEND_RGBI_HIS 1
00174 #define COLOR_BLEND_RGBI_HBS 2
00175 #define COLOR_BLEND_RGBI_Ratio 3
00176 #define COLOR_BLEND_RGBI_Brovey 4
00177 #define COLOR_BLEND_RGBI_LAST 4
00178
00180 enum COLORCOMPDEST {
00181 COLORCOMPDEST_ColorMapped = 1,
00182 COLORCOMPDEST_RGB = 2,
00183 COLORCOMPDEST_Pixel = 3,
00184 COLORCOMPDEST_Image = 4
00185 };
00186
00187
00188
00189
00190
00191
00192 struct COLORCOMPSRCPARM {
00193 UINT8 CompType;
00194 UINT8 BlendMode;
00195 UINT8 BlendFactor;
00196 UINT32 flags;
00197 const CONTRASTPARM *PtrsContrastParm[4];
00198 UINT32 CellType[4];
00199 int NumColors;
00200 const COLOR* colmap;
00201 };
00202
00203
00204
00205
00206
00207 struct COLORCOMPSTRUCT;
00208
00209
00210
00211
00212
00213
00215 int ColorCompConvMtoS (
00216 COLORCOMPSTRUCT *ccp,
00217 void *odata,
00218 UINT8 *omask,
00219 const void *idata1,
00220 const void *idata2,
00221 const void *idata3,
00222 const void *idata4,
00223 const UINT8 *imask,
00224 INT32 inpcols
00225 );
00226
00228 int ColorCompConvStoRGB (
00229 COLORCOMPSTRUCT *ccp,
00230 UINT8 *ored,
00231 UINT8 *ogrn,
00232 UINT8 *oblu,
00233 UINT8 *omask,
00234 const void *idata,
00235 const UINT8 *imask,
00236 INT32 inpcols
00237 );
00238
00240 int ColorCompConvStoS (
00241 COLORCOMPSTRUCT *ccp,
00242 void *odata,
00243 UINT8 *omask,
00244 const void *idata,
00245 const UINT8 *imask,
00246 INT32 inpcols
00247 );
00248
00250 int ColorCompCreate (
00251 COLORCOMPSTRUCT **rethandle
00252 );
00253
00255 void ColorCompDestroy (
00256 COLORCOMPSTRUCT *ccp
00257 );
00258
00260 int ColorCompSetColorBalance (
00261 COLORCOMPSTRUCT *ccp,
00262 CBPARMS *cbparm
00263 );
00264
00266 int ColorCompSetDestRGB (
00267 COLORCOMPSTRUCT *ccp,
00268 int type = 0,
00269 UINT32 flags = 0
00270 );
00271
00273 int ColorCompSetDestSingle (
00274 COLORCOMPSTRUCT *ccp,
00275 COLORCOMPDEST desttype,
00276 const DISPLAYINFO *pDisplayInfo,
00277 const COLOR_ARRAY *pColorMap = 0,
00278 const void *notused = 0,
00279 UINT32 flags = 0
00280 );
00281
00283 int ColorCompSetDestSingle (
00284 COLORCOMPSTRUCT *ccp,
00285 COLORSPACE ColorSpace,
00286 const COLOR_ARRAY *colormap = 0,
00287 UINT32 flags = 0
00288 );
00289
00291 int ColorCompSetDestSingle (
00292 COLORCOMPSTRUCT *ccp,
00293 MGD::DEVICE& dev
00294 );
00295
00297 inline int ColorCompSetDestSingle (
00298 COLORCOMPSTRUCT *ccp,
00299 COLORCOMPDEST desttype,
00300 const DISPLAYINFO *pDisplayInfo,
00301 UINT32 flags
00302 ) {
00303 return (ColorCompSetDestSingle(ccp, desttype, pDisplayInfo, static_cast<COLOR_ARRAY*>(0), 0, flags));
00304 }
00305
00307 int ColorCompSetSrcParm (
00308 COLORCOMPSTRUCT *ccp,
00309 COLORCOMPSRCPARM *parm
00310 );
00311
00313 ERRVALUE ColorCompSetSrcSingle (
00314 COLORCOMPSTRUCT *ccp,
00315 COLORSPACE ColorSpace,
00316 const COLOR_ARRAY *pColorMap,
00317 const CONTRASTPARM *pContrastParm,
00318 COLORCOMPFLAGS flags = COLORCOMPFLAG_None
00319 );
00320
00322 ERRVALUE ColorCompSetSrcSingle (
00323 COLORCOMPSTRUCT *ccp,
00324 RVC::IMAGE::CELLTYPE CellType,
00325 const COLOR_ARRAY *pColorMap,
00326 const CONTRASTPARM *pContrastParm,
00327 COLORCOMPFLAGS flags = COLORCOMPFLAG_None
00328 );
00329
00331 ERRVALUE ColorCompSetSrcSingle (
00332 COLORCOMPSTRUCT *ccp,
00333 NUMTYPE NumType,
00334 const COLOR_ARRAY *pColorMap,
00335 const CONTRASTPARM *pContrastParm,
00336 COLORCOMPFLAGS flags = COLORCOMPFLAG_None
00337 );
00338
00340 int ColorCompStart (
00341 COLORCOMPSTRUCT *ccp,
00342 INT32 maxcols
00343 );
00344
00346 void ColorCompStop (
00347 COLORCOMPSTRUCT *ccp
00348 );
00349
00350
00351 #endif // INC_MI32_COLRCONV_H