eLynx SDK
v3.0.1 C++ image processing API reference |
00001 //============================================================================ 00002 // Pixels.h Image.Component package 00003 //============================================================================ 00004 // Usage : define common definition for pixel format 00005 //---------------------------------------------------------------------------- 00006 // Copyright (C) 2006 by eLynx project 00007 // 00008 // This library is free software; you can redistribute it and/or 00009 // modify it under the terms of the GNU Library General Public 00010 // License as published by the Free Software Foundation; either 00011 // version 2 of the License, or (at your option) any later version. 00012 // 00013 // This library is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00016 // See the GNU Library General Public License for more details. 00017 //---------------------------------------------------------------------------- 00018 #ifndef __Pixels_h__ 00019 #define __Pixels_h__ 00020 00021 #include <elx/core/CoreTypes.h> 00022 #include <elx/image/ImageLib.h> 00023 #include <elx/image/PixelBase.h> 00024 00025 namespace eLynx { 00026 namespace Image { 00027 00029 enum EPixelMode 00030 { 00031 PM_Grey, 00032 PM_Color, 00033 PM_Complex, 00034 PM_Undefined 00035 }; 00036 00042 enum EColorSpace 00043 { 00044 CS_RGB, 00045 CS_HLS, 00046 CS_CIE_XYZ, 00047 CS_CIE_Luv, 00048 CS_CIE_Lab, 00049 CS_CIE_Lch, 00050 CS_Hunter_Lab, 00051 CS_Undefined 00052 }; 00053 00055 enum EPixelType 00056 { 00057 PT_L, 00058 PT_LA, 00059 PT_Complex, 00060 PT_RGB, 00061 PT_RGBA, 00062 PT_HLS, 00063 PT_XYZ, 00064 PT_Luv, 00065 PT_Lab, 00066 PT_Lch, 00067 PT_HLab, 00068 PT_Undefined 00069 }; 00070 00072 enum EPixelFormat 00073 { 00074 PF_Lub, 00075 PF_Lus, 00076 PF_Li, 00077 PF_Lf, 00078 PF_Ld, 00079 00080 PF_LAub, 00081 PF_LAus, 00082 PF_LAi, 00083 PF_LAf, 00084 PF_LAd, 00085 00086 PF_RGBub, 00087 PF_RGBus, 00088 PF_RGBi, 00089 PF_RGBf, 00090 PF_RGBd, 00091 00092 PF_RGBAub, 00093 PF_RGBAus, 00094 PF_RGBAi, 00095 PF_RGBAf, 00096 PF_RGBAd, 00097 00099 PF_CPLXi, 00100 PF_CPLXf, 00101 PF_CPLXd, 00102 00103 PF_HLSf, 00104 PF_HLSd, 00105 00106 PF_XYZf, 00107 PF_XYZd, 00108 00109 PF_Luvf, 00110 PF_Luvd, 00111 00112 PF_Labf, 00113 PF_Labd, 00114 00115 PF_Lchf, 00116 PF_Lchd, 00117 00118 PF_HLabf, 00119 PF_HLabd, 00120 00121 PF_Undefined 00122 }; 00123 00126 enum EColorToGreyConversion 00127 { 00128 CGC_Green, 00129 CGC_Mean, 00130 CGC_Desaturate, 00131 CGC_CCIR_601, 00132 CGC_CCIR_709, 00133 CGC_ITU, 00134 CGC_Max, // do not use. 00135 00136 CGC_Default = CGC_CCIR_709 00137 }; 00138 00141 enum EGreyToColorConversion 00142 { 00143 GCC_Palettized, // 00144 GCC_FalseColor, // 00145 GCC_Max, // do not use 00146 00147 GCC_Default = GCC_Palettized 00148 }; 00149 00152 enum EGreyToComplexConversion 00153 { 00154 GCC_AsReal, 00155 GCC_AsImaginary, 00156 GCC_FFT 00157 }; 00158 00161 enum EComplexToGreyConversion 00162 { 00163 CGC_Real, 00164 CGC_Imaginary, 00165 CGC_Magnitude, 00166 CGC_LogMagnitude, 00167 CGC_Phase, 00168 CGC_IFFT 00169 }; 00170 00171 //============================================================================ 00173 //============================================================================ 00174 00178 // forward declarations 00179 template<typename T> struct PixelL; 00180 template<typename T> struct PixelLA; 00181 template<typename T> struct PixelComplex; 00182 template<typename T> struct PixelRGB; 00183 template<typename T> struct PixelHLS; 00184 template<typename T> struct PixelXYZ; 00185 template<typename T> struct PixelLuv; 00186 template<typename T> struct PixelLab; 00187 template<typename T> struct PixelLch; 00188 template<typename T> struct PixelHLab; 00189 template<typename T> struct PixelRGBA; 00191 00192 00193 template<typename T> 00194 struct ExportedByImage PixelL : public PixelBase< PixelL<T> > 00195 { 00196 typedef T type; 00197 typedef IntegerToType< ResolutionTypeTraits<T>::_bInteger > IntType; 00198 typedef LutToType< ResolutionTypeTraits<T>::_bLUT > LutType; 00199 00200 typedef typename ResolutionTypeTraits<T>::SumOverflow_type S_type; 00201 typedef typename ResolutionTypeTraits<T>::MulOverflow_type M_type; 00202 typedef typename ResolutionTypeTraits<T>::Floating_type F_type; 00203 00204 typedef PixelL<S_type> SumOverflowPixel; 00205 typedef PixelL<M_type> MulOverflowPixel; 00206 typedef PixelL<F_type> FloatingPixel; 00207 00208 static const bool _bColor = false; 00209 static const bool _bGrey = true; 00210 static const bool _bHasAlpha = false; 00211 static const uint32 _channels = 1; 00212 00213 union { 00214 T _channel[_channels]; 00215 T _luminance; 00216 }; 00217 00218 PixelL() { _luminance = T();} 00219 PixelL(T iL) { _luminance = iL; } 00220 PixelL(const PixelL& iPixel) { _luminance = iPixel._luminance; } 00221 PixelL(const PixelLA<T>& iPixel, bool ibBlendAlpha=false); 00222 PixelL(const PixelRGB<T>& iPixel, EColorToGreyConversion iMethod=CGC_Default) { _luminance = iPixel.GetLuminance(iMethod); } 00223 PixelL(const PixelRGBA<T>& iPixel, EColorToGreyConversion iMethod=CGC_Default){ _luminance = iPixel.GetLuminance(iMethod); } 00224 PixelL(const PixelHLS<T>& iPixel) { _luminance = iPixel._luminance; } 00225 PixelL(const PixelLab<T>& iPixel) { _luminance = iPixel._luminance; } 00226 00227 PixelL& operator=(const PixelL& iPixel) { _luminance = iPixel._luminance; return *this;} 00228 00229 template <typename U> 00230 PixelL(const PixelL<U>& iPixel) { _luminance = T(iPixel._luminance); } 00231 00232 template <typename U> 00233 PixelL& operator=(const PixelL<U>& iPixel) { _luminance = T(iPixel._luminance); return *this;} 00234 00235 static const PixelL Null() { static const PixelL nullPixel( T(0) ); return nullPixel; } 00236 static const PixelL Black() { static const PixelL blackPixel(SampleTypeTraits<T>::_black); return blackPixel; } 00237 static const PixelL White() { static const PixelL whitePixel(SampleTypeTraits<T>::_white); return whitePixel; } 00238 00239 T GetChannel0() const { return _luminance; } 00240 T GetLuminance() const { return _luminance; } 00241 00242 static const uint32 GetChannelCount() { return _channels; } 00243 static const uint32 GetChannelMask() { return CM_Channel0; } 00244 static bool IsFullMask(uint32 iMask) { return (CM_Channel0 == (iMask & CM_Channel0)); } 00245 static bool IsMasking(uint32 iMask) { return (0 != (iMask & CM_Channel0)); } 00246 static const EPixelMode GetPixelMode() { return PM_Grey; } 00247 static const EPixelType GetPixelType() { return PT_L; } 00248 static const EColorSpace GetColorSpace() { return CS_Undefined; } 00249 static const EResolution GetResolution() { return ResolutionTypeTraits<T>::_Resolution; } 00250 static const bool HasAlpha() { return _bHasAlpha; } 00251 static const bool IsGrey() { return _bGrey; } 00252 static const bool IsColor() { return _bColor; } 00253 static EPixelFormat GetPixelFormat(); 00254 }; 00255 00256 00257 template<typename T> 00258 struct ExportedByImage PixelLA : public PixelBase< PixelLA<T> > 00259 { 00260 typedef T type; 00261 typedef IntegerToType< ResolutionTypeTraits<T>::_bInteger > IntType; 00262 typedef LutToType< ResolutionTypeTraits<T>::_bLUT > LutType; 00263 00264 typedef typename ResolutionTypeTraits<T>::SumOverflow_type S_type; 00265 typedef typename ResolutionTypeTraits<T>::MulOverflow_type M_type; 00266 typedef typename ResolutionTypeTraits<T>::Floating_type F_type; 00267 00268 typedef PixelLA<S_type> SumOverflowPixel; 00269 typedef PixelLA<M_type> MulOverflowPixel; 00270 typedef PixelLA<F_type> FloatingPixel; 00271 00272 static const bool _bColor = false; 00273 static const bool _bGrey = true; 00274 static const bool _bHasAlpha = true; 00275 static const uint32 _channels = 2; 00276 00277 union { 00278 T _channel[_channels]; 00279 struct { 00280 T _luminance; 00281 T _alpha; 00282 }; 00283 }; 00284 00285 PixelLA() { _luminance = _alpha = T(); } 00286 PixelLA(T iL, T iA) { _luminance = iL; _alpha = iA; } 00287 PixelLA(const PixelLA& ip) { _luminance = ip._luminance; _alpha = ip._alpha; } 00288 PixelLA& operator=(const PixelLA& ip) { _luminance = ip._luminance; _alpha = ip._alpha; return *this; } 00289 00290 PixelLA(const PixelL<T>& ip) { _luminance = ip._luminance; _alpha = ResolutionTypeTraits<T>::_Norm; } 00291 PixelLA& operator=(const PixelL<T>& ip) { _luminance = ip._luminance; _alpha = ResolutionTypeTraits<T>::_Norm; return *this; } 00292 PixelLA(const PixelL<T>& ip, T iA) { _luminance = ip._luminance; _alpha = iA; } 00293 00294 template <typename U> 00295 PixelLA(const PixelLA<U>& ip) { _luminance = T(ip._luminance); _alpha = T(ip._alpha); } 00296 00297 template <typename U> 00298 PixelLA& operator=(const PixelLA<U>& ip) { _luminance = T(ip._luminance); _alpha = T(ip._alpha); return *this; } 00299 00300 static const PixelLA Null() { static const PixelLA nullPixel( T(0),T(0) ); return nullPixel; } 00301 static const PixelLA Black() { static const PixelLA blackPixel(SampleTypeTraits<T>::_black, ResolutionTypeTraits<T>::_Norm); return blackPixel; } 00302 static const PixelLA White() { static const PixelLA whitePixel(SampleTypeTraits<T>::_white, ResolutionTypeTraits<T>::_Norm); return whitePixel; } 00303 00304 T GetChannel0() const { return _luminance; } 00305 T GetChannel1() const { return _alpha; } 00306 T GetLuminance() const { return _luminance; } 00307 T GetAlpha() const { return _alpha; } 00308 00309 static const uint32 GetChannelCount() { return _channels; } 00310 static const uint32 GetChannelMask() { return CM_Channel01; } 00311 static bool IsFullMask(uint32 iMask) { return (CM_Channel01 == (iMask & CM_Channel01)); } 00312 static bool IsMasking(uint32 iMask) { return (0 != (iMask & CM_Channel01)); } 00313 static const EPixelMode GetPixelMode() { return PM_Grey; } 00314 static const EPixelType GetPixelType() { return PT_LA; } 00315 static const EColorSpace GetColorSpace() { return CS_Undefined; } 00316 static const EResolution GetResolution() { return ResolutionTypeTraits<T>::_Resolution; } 00317 static const bool HasAlpha() { return _bHasAlpha; } 00318 static const bool IsGrey() { return _bGrey; } 00319 static const bool IsColor() { return _bColor; } 00320 static EPixelFormat GetPixelFormat(); 00321 }; 00322 00323 00324 template<typename T> 00325 struct ExportedByImage PixelComplex : public PixelBase< PixelComplex<T> > 00326 { 00327 typedef T type; 00328 typedef IntegerToType< ResolutionTypeTraits<T>::_bInteger > IntType; 00329 typedef LutToType< ResolutionTypeTraits<T>::_bLUT > LutType; 00330 00331 typedef typename ResolutionTypeTraits<T>::SumOverflow_type S_type; 00332 typedef typename ResolutionTypeTraits<T>::MulOverflow_type M_type; 00333 typedef typename ResolutionTypeTraits<T>::Floating_type F_type; 00334 00335 typedef PixelComplex<S_type> SumOverflowPixel; 00336 typedef PixelComplex<M_type> MulOverflowPixel; 00337 typedef PixelComplex<F_type> FloatingPixel; 00338 00339 static const bool _bColor = false; 00340 static const bool _bGrey = false; 00341 static const bool _bHasAlpha = false; 00342 static const uint32 _channels = 2; 00343 00344 union { 00345 T _channel[_channels]; 00346 struct { 00347 T _re; 00348 T _im; 00349 }; 00350 }; 00351 00352 PixelComplex() { _re = _im = T(); } 00353 PixelComplex(T iRe, T iIm) { _re = iRe; _im = iIm; } 00354 PixelComplex(const PixelComplex& ip) { _re = ip._re; _im = ip._im; } 00355 00356 PixelComplex& operator=(const PixelComplex& ip) { _re = ip._re; _im = ip._im; return *this; } 00357 00358 template <typename U> 00359 PixelComplex(const PixelComplex<U>& ip) { _re = T(ip._re); _im = T(ip._im); } 00360 00361 template <typename U> 00362 PixelComplex& operator=(const PixelComplex<U>& ip) { _re = T(ip._re); _im = T(ip._im); return *this; } 00363 00364 static const PixelComplex Null() { static const PixelComplex nullPixel (T(0), T(0)); return nullPixel; } 00365 static const PixelComplex Black() { static const PixelComplex blackPixel(T(0), T(0)); return blackPixel; } 00366 static const PixelComplex White() { static const PixelComplex whitePixel(T(0), T(0)); return whitePixel; } 00367 00368 T GetChannel0() const { return _re; } 00369 T GetChannel1() const { return _im; } 00370 T GetReal() const { return _re; } 00371 T GetImaginary() const { return _im; } 00372 T GetLuminance() const { return 0;/*sqrt(_re*_re + _im*_im);*/ } 00373 00374 static const uint32 GetChannelCount() { return _channels; } 00375 static const uint32 GetChannelMask() { return CM_Channel01; } 00376 static bool IsFullMask(uint32 iMask) { return (CM_Channel01 == (iMask & CM_Channel01)); } 00377 static bool IsMasking(uint32 iMask) { return (0 != (iMask & CM_Channel01)); } 00378 static const EPixelMode GetPixelMode() { return PM_Complex; } 00379 static const EPixelType GetPixelType() { return PT_Complex; } 00380 static const EColorSpace GetColorSpace() { return CS_Undefined; } 00381 static const EResolution GetResolution() { return ResolutionTypeTraits<T>::_Resolution; } 00382 static const bool HasAlpha() { return _bHasAlpha; } 00383 static const bool IsGrey() { return _bGrey; } 00384 static const bool IsColor() { return _bColor; } 00385 static EPixelFormat GetPixelFormat(); 00386 }; 00387 00388 00389 template<typename T> 00390 struct ExportedByImage PixelRGB : public PixelBase< PixelRGB<T> > 00391 { 00392 typedef T type; 00393 typedef IntegerToType< ResolutionTypeTraits<T>::_bInteger > IntType; 00394 typedef LutToType< ResolutionTypeTraits<T>::_bLUT > LutType; 00395 00396 typedef typename ResolutionTypeTraits<T>::SumOverflow_type S_type; 00397 typedef typename ResolutionTypeTraits<T>::MulOverflow_type M_type; 00398 typedef typename ResolutionTypeTraits<T>::Floating_type F_type; 00399 00400 typedef PixelRGB<S_type> SumOverflowPixel; 00401 typedef PixelRGB<M_type> MulOverflowPixel; 00402 typedef PixelRGB<F_type> FloatingPixel; 00403 00404 static const bool _bColor = true; 00405 static const bool _bGrey = false; 00406 static const bool _bHasAlpha = false; 00407 static const uint32 _channels = 3; 00408 00409 union { 00410 T _channel[_channels]; 00411 struct { 00412 T _red; 00413 T _green; 00414 T _blue; 00415 }; 00416 }; 00417 00418 PixelRGB() { _red = _green = _blue = T(); } 00419 PixelRGB(T iR, T iG, T iB) { _red = iR; _green = iG; _blue = iB; } 00420 PixelRGB(const PixelRGB& ip) { _red = ip._red; _green = ip._green; _blue = ip._blue; } 00421 PixelRGB(const PixelL<T>& iPixel) { _red = _green = _blue = iPixel._luminance; } 00422 PixelRGB(const PixelLA<T>& iPixel) { _red = _green = _blue = iPixel._luminance; } 00423 PixelRGB(const PixelComplex<T>& iPixel) { elxFIXME; } 00424 PixelRGB(const PixelHLS<T>& iPixel); 00425 PixelRGB(const PixelXYZ<T>& iPixel); 00426 PixelRGB(const PixelLuv<T>& iPixel); 00427 PixelRGB(const PixelLab<T>& iPixel); 00428 PixelRGB(const PixelLch<T>& iPixel); 00429 PixelRGB(const PixelHLab<T>& iPixel); 00430 PixelRGB(const PixelRGBA<T>& iPixel, bool ibBlendAlpha=false); 00431 00432 PixelRGB& operator=(const PixelRGB& ip) { _red = ip._red; _green = ip._green; _blue = ip._blue; return *this;} 00433 00434 template <typename U> 00435 PixelRGB(const PixelRGB<U>& ip) { _red = T(ip._red); _green = T(ip._green); _blue = T(ip._blue); } 00436 00437 template <typename U> 00438 PixelRGB& operator=(const PixelRGB<U>& ip) { _red = T(ip._red); _green = T(ip._green); _blue = T(ip._blue); return *this;} 00439 00440 static const PixelRGB Null() { static const PixelRGB nullPixel( T(0),T(0),T(0) ); return nullPixel; } 00441 static const PixelRGB Black() { static const PixelRGB blackPixel(SampleTypeTraits<T>::_black, SampleTypeTraits<T>::_black, SampleTypeTraits<T>::_black); return blackPixel; } 00442 static const PixelRGB White() { static const PixelRGB whitePixel(SampleTypeTraits<T>::_white, SampleTypeTraits<T>::_white, SampleTypeTraits<T>::_white); return whitePixel; } 00443 00444 T GetChannel0() const { return _red; } 00445 T GetChannel1() const { return _green; } 00446 T GetChannel2() const { return _blue; } 00447 T GetRed() const { return _red; } 00448 T GetGreen() const { return _green; } 00449 T GetBlue() const { return _blue; } 00450 T GetLuminance(EColorToGreyConversion iMethod=CGC_Default) const; 00451 00452 static const uint32 GetChannelCount() { return _channels; } 00453 static const uint32 GetChannelMask() { return CM_Channel012; } 00454 static bool IsFullMask(uint32 iMask) { return (CM_Channel012 == (iMask & CM_Channel012)); } 00455 static bool IsMasking(uint32 iMask) { return (0 != (iMask & CM_Channel012)); } 00456 static const EPixelMode GetPixelMode() { return PM_Color; } 00457 static const EPixelType GetPixelType() { return PT_RGB; } 00458 static const EColorSpace GetColorSpace() { return CS_RGB; } 00459 static const EResolution GetResolution() { return ResolutionTypeTraits<T>::_Resolution; } 00460 static const bool HasAlpha() { return _bHasAlpha; } 00461 static const bool IsGrey() { return _bGrey; } 00462 static const bool IsColor() { return _bColor; } 00463 static EPixelFormat GetPixelFormat(); 00464 }; 00465 00466 00467 template<typename T> 00468 struct ExportedByImage PixelHLS : public PixelBase< PixelHLS<T> > 00469 { 00470 typedef T type; 00471 typedef IntegerToType< ResolutionTypeTraits<T>::_bInteger > IntType; 00472 typedef LutToType< ResolutionTypeTraits<T>::_bLUT > LutType; 00473 00474 typedef typename ResolutionTypeTraits<T>::SumOverflow_type S_type; 00475 typedef typename ResolutionTypeTraits<T>::MulOverflow_type M_type; 00476 typedef typename ResolutionTypeTraits<T>::Floating_type F_type; 00477 00478 typedef PixelHLS<S_type> SumOverflowPixel; 00479 typedef PixelHLS<M_type> MulOverflowPixel; 00480 typedef PixelHLS<F_type> FloatingPixel; 00481 00482 static const bool _bColor = true; 00483 static const bool _bGrey = false; 00484 static const bool _bHasAlpha = false; 00485 static const uint32 _channels = 3; 00486 00487 union { 00488 T _channel[_channels]; 00489 struct { 00490 T _hue; 00491 T _luminance; 00492 T _saturation; 00493 }; 00494 }; 00495 00496 PixelHLS() { _hue = _luminance = _saturation = T(); } 00497 PixelHLS(T iH, T iL, T iS) { _hue = iH; _luminance = iL; _saturation = iS; } 00498 PixelHLS(const PixelL<T>& iPixel); 00499 PixelHLS(const PixelLA<T>& iPixel); 00500 PixelHLS(const PixelComplex<T>& iPixel) { elxFIXME; } 00501 PixelHLS(const PixelRGB<T>& iPixel); 00502 PixelHLS(const PixelXYZ<T>& iPixel); 00503 PixelHLS(const PixelLuv<T>& iPixel); 00504 PixelHLS(const PixelLab<T>& iPixel); 00505 PixelHLS(const PixelLch<T>& iPixel); 00506 PixelHLS(const PixelHLab<T>& iPixel); 00507 PixelHLS(const PixelRGBA<T>& iPixel) { elxFIXME; } 00508 PixelHLS(const PixelHLS& ip) { _hue = ip._hue; _luminance = ip._luminance; _saturation = ip._saturation; } 00509 00510 PixelHLS& operator=(const PixelHLS& ip) { _hue = ip._hue; _luminance = ip._luminance; _saturation = ip._saturation; return *this;} 00511 00512 template <typename U> 00513 PixelHLS(const PixelHLS<U>& ip) { _hue = T(ip._hue); _luminance = T(ip._luminance); _saturation = T(ip._saturation); } 00514 00515 template <typename U> 00516 PixelHLS& operator=(const PixelHLS<U>& ip) { _hue = T(ip._hue); _luminance = T(ip._luminance); _saturation = T(ip._saturation); return *this;} 00517 00518 static const PixelHLS Null() { static const PixelHLS nullPixel( T(0),T(0),T(0) ); return nullPixel; } 00519 static const PixelHLS Black() { static const PixelHLS blackPixel(T(0), SampleTypeTraits<T>::_black, T(0)); return blackPixel; } 00520 static const PixelHLS White() { static const PixelHLS whitePixel(T(0), SampleTypeTraits<T>::_white, T(0)); return whitePixel; } 00521 00522 T GetChannel0() const { return _hue; } 00523 T GetChannel1() const { return _luminance; } 00524 T GetChannel2() const { return _saturation; } 00525 T GetHue() const { return _hue; } 00526 T GetLuminance() const { return _luminance; } 00527 T GetSaturation() const { return _saturation; } 00528 00529 static const uint32 GetChannelCount() { return _channels; } 00530 static const uint32 GetChannelMask() { return CM_Channel012; } 00531 static bool IsFullMask(uint32 iMask) { return (CM_Channel012 == (iMask & CM_Channel012)); } 00532 static bool IsMasking(uint32 iMask) { return (0 != (iMask & CM_Channel012)); } 00533 static const EPixelMode GetPixelMode() { return PM_Color; } 00534 static const EPixelType GetPixelType() { return PT_HLS; } 00535 static const EColorSpace GetColorSpace() { return CS_HLS; } 00536 static const EResolution GetResolution() { return ResolutionTypeTraits<T>::_Resolution; } 00537 static const bool HasAlpha() { return _bHasAlpha; } 00538 static const bool IsGrey() { return _bGrey; } 00539 static const bool IsColor() { return _bColor; } 00540 static EPixelFormat GetPixelFormat(); 00541 }; 00542 00543 00544 template<typename T> 00545 struct ExportedByImage PixelXYZ : public PixelBase< PixelXYZ<T> > 00546 { 00547 typedef T type; 00548 typedef IntegerToType< ResolutionTypeTraits<T>::_bInteger > IntType; 00549 typedef LutToType< ResolutionTypeTraits<T>::_bLUT > LutType; 00550 00551 typedef typename ResolutionTypeTraits<T>::SumOverflow_type S_type; 00552 typedef typename ResolutionTypeTraits<T>::MulOverflow_type M_type; 00553 typedef typename ResolutionTypeTraits<T>::Floating_type F_type; 00554 00555 typedef PixelXYZ<S_type> SumOverflowPixel; 00556 typedef PixelXYZ<M_type> MulOverflowPixel; 00557 typedef PixelXYZ<F_type> FloatingPixel; 00558 00559 static const bool _bColor = true; 00560 static const bool _bGrey = false; 00561 static const bool _bHasAlpha = false; 00562 static const uint32 _channels = 3; 00563 00564 union { 00565 T _channel[_channels]; 00566 struct { 00567 T _X; 00568 T _Y; 00569 T _Z; 00570 }; 00571 }; 00572 00573 PixelXYZ() { _X = _Y = _Z = T(); } 00574 PixelXYZ(T iX, T iY, T iZ) { _X = iX; _Y = iY; _Z = iZ; } 00575 PixelXYZ(const PixelXYZ& ip) { _X = ip._X; _Y = ip._Y; _Z = ip._Z; } 00576 PixelXYZ(const PixelRGB<T>& iPixel); 00577 PixelXYZ(const PixelHLS<T>& iPixel); 00578 PixelXYZ(const PixelLuv<T>& iPixel); 00579 PixelXYZ(const PixelLab<T>& iPixel); 00580 PixelXYZ(const PixelLch<T>& iPixel); 00581 PixelXYZ(const PixelHLab<T>& iPixel); 00582 00583 PixelXYZ& operator=(const PixelXYZ& ip) { _X = ip._X; _Y = ip._Y; _Z = ip._Z; return *this;} 00584 00585 template <typename U> 00586 PixelXYZ(const PixelXYZ<U>& ip) { _X = T(ip._X); _Y = T(ip._Y); _Z = T(ip._Z); } 00587 00588 template <typename U> 00589 PixelXYZ& operator=(const PixelXYZ<U>& ip) { _X = T(ip._X); _Y = T(ip._Y); _Z = T(ip._Z); return *this;} 00590 00591 static const PixelXYZ Null() { static const PixelXYZ nullPixel( T(0), T(0), T(0) ); return nullPixel; } 00592 static const PixelXYZ Black() { static const PixelXYZ blackPixel(T(0), T(0), T(0) ); return blackPixel; } 00593 static const PixelXYZ White() { static const PixelXYZ whitePixel(T(0.95045599999999997), T(1), T(1.088754) ); return whitePixel; } 00594 00595 T GetChannel0() const { return _X; } 00596 T GetChannel1() const { return _Y; } 00597 T GetChannel2() const { return _Z; } 00598 T GetX() const { return _X; } 00599 T GetY() const { return _Y; } 00600 T GetZ() const { return _Z; } 00601 T GetLuminance() const { return _Y; } 00602 00603 static const uint32 GetChannelCount() { return _channels; } 00604 static const uint32 GetChannelMask() { return CM_Channel012; } 00605 static bool IsFullMask(uint32 iMask) { return (CM_Channel012 == (iMask & CM_Channel012)); } 00606 static bool IsMasking(uint32 iMask) { return (0 != (iMask & CM_Channel012)); } 00607 static const EPixelMode GetPixelMode() { return PM_Color; } 00608 static const EPixelType GetPixelType() { return PT_XYZ; } 00609 static const EColorSpace GetColorSpace() { return CS_CIE_XYZ; } 00610 static const EResolution GetResolution() { return ResolutionTypeTraits<T>::_Resolution; } 00611 static const bool HasAlpha() { return _bHasAlpha; } 00612 static const bool IsGrey() { return _bGrey; } 00613 static const bool IsColor() { return _bColor; } 00614 static EPixelFormat GetPixelFormat(); 00615 }; 00616 00617 00618 template<typename T> 00619 struct ExportedByImage PixelLuv : public PixelBase< PixelLuv<T> > 00620 { 00621 typedef T type; 00622 typedef IntegerToType< ResolutionTypeTraits<T>::_bInteger > IntType; 00623 typedef LutToType< ResolutionTypeTraits<T>::_bLUT > LutType; 00624 00625 typedef typename ResolutionTypeTraits<T>::SumOverflow_type S_type; 00626 typedef typename ResolutionTypeTraits<T>::MulOverflow_type M_type; 00627 typedef typename ResolutionTypeTraits<T>::Floating_type F_type; 00628 00629 typedef PixelLuv<S_type> SumOverflowPixel; 00630 typedef PixelLuv<M_type> MulOverflowPixel; 00631 typedef PixelLuv<F_type> FloatingPixel; 00632 00633 static const bool _bColor = true; 00634 static const bool _bGrey = false; 00635 static const bool _bHasAlpha = false; 00636 static const uint32 _channels = 3; 00637 00638 union { 00639 T _channel[_channels]; 00640 struct { 00641 T _luminance; 00642 T _u; 00643 T _v; 00644 }; 00645 }; 00646 00647 PixelLuv() { _luminance = _u = _v = T(); } 00648 PixelLuv(T iL, T iU, T iV) { _luminance = iL; _u = iU; _v = iV; } 00649 PixelLuv(const PixelLuv<T>& iPixel) { _luminance = iPixel._luminance; _u = iPixel._u; _v = iPixel._v; } 00650 PixelLuv(const PixelRGB<T>& iPixel); 00651 PixelLuv(const PixelHLS<T>& iPixel); 00652 PixelLuv(const PixelXYZ<T>& iPixel); 00653 PixelLuv(const PixelLab<T>& iPixel); 00654 PixelLuv(const PixelLch<T>& iPixel); 00655 PixelLuv(const PixelHLab<T>& iPixel); 00656 00657 PixelLuv& operator=(const PixelLuv& ip) { _luminance = ip._luminance; _u = ip._u; _v = ip._v; return *this;} 00658 00659 template <typename U> 00660 PixelLuv(const PixelLuv<U>& ip) { _luminance = T(ip._luminance); _u = T(ip._u); _v = T(ip._v); } 00661 00662 template <typename U> 00663 PixelLuv& operator=(const PixelLuv<U>& ip) { _luminance = T(ip._luminance); _u = T(ip._u); _v = T(ip._v); return *this;} 00664 00665 static const PixelLuv Null() { static const PixelLuv nullPixel( T(0), T(0), T(0) ); return nullPixel; } 00666 static const PixelLuv Black() { static const PixelLuv blackPixel(T(0), T(0), T(0) ); return blackPixel; } 00667 static const PixelLuv White() { static const PixelLuv whitePixel(T(1), T(0), T(0) ); return whitePixel; } 00668 00669 T GetChannel0() const { return _luminance; } 00670 T GetChannel1() const { return _u; } 00671 T GetChannel2() const { return _v; } 00672 T GetLuminance() const { return _luminance; } 00673 T GetU() const { return _u; } 00674 T GetV() const { return _v; } 00675 00676 static const uint32 GetChannelCount() { return _channels; } 00677 static const uint32 GetChannelMask() { return CM_Channel012; } 00678 static bool IsFullMask(uint32 iMask) { return (CM_Channel012 == (iMask & CM_Channel012)); } 00679 static bool IsMasking(uint32 iMask) { return (0 != (iMask & CM_Channel012)); } 00680 static const EPixelMode GetPixelMode() { return PM_Color; } 00681 static const EPixelType GetPixelType() { return PT_Luv; } 00682 static const EColorSpace GetColorSpace() { return CS_CIE_Luv; } 00683 static const EResolution GetResolution() { return ResolutionTypeTraits<T>::_Resolution; } 00684 static const bool HasAlpha() { return _bHasAlpha; } 00685 static const bool IsGrey() { return _bGrey; } 00686 static const bool IsColor() { return _bColor; } 00687 static EPixelFormat GetPixelFormat(); 00688 }; 00689 00690 00691 template<typename T> 00692 struct ExportedByImage PixelLab : public PixelBase< PixelLab<T> > 00693 { 00694 typedef T type; 00695 typedef IntegerToType< ResolutionTypeTraits<T>::_bInteger > IntType; 00696 typedef LutToType< ResolutionTypeTraits<T>::_bLUT > LutType; 00697 00698 typedef typename ResolutionTypeTraits<T>::SumOverflow_type S_type; 00699 typedef typename ResolutionTypeTraits<T>::MulOverflow_type M_type; 00700 typedef typename ResolutionTypeTraits<T>::Floating_type F_type; 00701 00702 typedef PixelLab<S_type> SumOverflowPixel; 00703 typedef PixelLab<M_type> MulOverflowPixel; 00704 typedef PixelLab<F_type> FloatingPixel; 00705 00706 static const bool _bColor = true; 00707 static const bool _bGrey = false; 00708 static const bool _bHasAlpha = false; 00709 static const uint32 _channels = 3; 00710 00711 union { 00712 T _channel[_channels]; 00713 struct { 00714 T _luminance; 00715 T _a; 00716 T _b; 00717 }; 00718 }; 00719 00720 PixelLab() { _luminance = _a = _b = T(); } 00721 PixelLab(T iL, T iA, T iB) { _luminance = iL; _a = iA; _b = iB; } 00722 PixelLab(const PixelLab<T>& iPixel) { _luminance = iPixel._luminance; _a = iPixel._a; _b = iPixel._b; } 00723 PixelLab(const PixelL<T>& iPixel); 00724 PixelLab(const PixelLA<T>& iPixel); 00725 PixelLab(const PixelRGB<T>& iPixel); 00726 PixelLab(const PixelRGBA<T>& iPixel); 00727 PixelLab(const PixelHLS<T>& iPixel); 00728 PixelLab(const PixelXYZ<T>& iPixel); 00729 PixelLab(const PixelLuv<T>& iPixel); 00730 PixelLab(const PixelLch<T>& iPixel); 00731 PixelLab(const PixelHLab<T>& iPixel); 00732 00733 PixelLab& operator=(const PixelLab& ip) { _luminance = ip._luminance; _a = ip._a; _b = ip._b; return *this;} 00734 00735 template <typename U> 00736 PixelLab(const PixelLab<U>& ip) { _luminance = T(ip._luminance); _a = T(ip._a); _b = T(ip._b); } 00737 00738 template <typename U> 00739 PixelLab& operator=(const PixelLab<U>& ip) { _luminance = T(ip._luminance); _a = T(ip._a); _b = T(ip._b); return *this;} 00740 00741 static const PixelLab Null() { static const PixelLab nullPixel( T(0), T(0), T(0) ); return nullPixel; } 00742 static const PixelLab Black() { static const PixelLab blackPixel(T(0), T(0), T(0) ); return blackPixel; } 00743 static const PixelLab White() { static const PixelLab whitePixel(T(100), T(0), T(0) ); return whitePixel; } 00744 00745 T GetChannel0() const { return _luminance; } 00746 T GetChannel1() const { return _a; } 00747 T GetChannel2() const { return _b; } 00748 T GetLuminance() const { return _luminance; } 00749 T GetA() const { return _a; } 00750 T GetB() const { return _b; } 00751 00752 static const uint32 GetChannelCount() { return _channels; } 00753 static const uint32 GetChannelMask() { return CM_Channel012; } 00754 static bool IsFullMask(uint32 iMask) { return (CM_Channel012 == (iMask & CM_Channel012)); } 00755 static bool IsMasking(uint32 iMask) { return (0 != (iMask & CM_Channel012)); } 00756 static const EPixelMode GetPixelMode() { return PM_Color; } 00757 static const EPixelType GetPixelType() { return PT_Lab; } 00758 static const EColorSpace GetColorSpace() { return CS_CIE_Lab; } 00759 static const EResolution GetResolution() { return ResolutionTypeTraits<T>::_Resolution; } 00760 static const bool HasAlpha() { return _bHasAlpha; } 00761 static const bool IsGrey() { return _bGrey; } 00762 static const bool IsColor() { return _bColor; } 00763 static EPixelFormat GetPixelFormat(); 00764 }; 00765 00766 template<typename T> 00767 struct ExportedByImage PixelLch : public PixelBase< PixelLch<T> > 00768 { 00769 typedef T type; 00770 typedef IntegerToType< ResolutionTypeTraits<T>::_bInteger > IntType; 00771 typedef LutToType< ResolutionTypeTraits<T>::_bLUT > LutType; 00772 00773 typedef typename ResolutionTypeTraits<T>::SumOverflow_type S_type; 00774 typedef typename ResolutionTypeTraits<T>::MulOverflow_type M_type; 00775 typedef typename ResolutionTypeTraits<T>::Floating_type F_type; 00776 00777 typedef PixelLch<S_type> SumOverflowPixel; 00778 typedef PixelLch<M_type> MulOverflowPixel; 00779 typedef PixelLch<F_type> FloatingPixel; 00780 00781 static const bool _bColor = true; 00782 static const bool _bGrey = false; 00783 static const bool _bHasAlpha = false; 00784 static const uint32 _channels = 3; 00785 00786 union { 00787 T _channel[_channels]; 00788 struct { 00789 T _luminance; 00790 T _c; 00791 T _h; 00792 }; 00793 }; 00794 00795 PixelLch() { _luminance = _c = _h = T(); } 00796 PixelLch(T iL, T iC, T iH) { _luminance = iL; _c = iC; _h = iH; } 00797 PixelLch(const PixelLch<T>& iPixel) { _luminance = iPixel._luminance; _c = iPixel._c; _h = iPixel._h; } 00798 PixelLch(const PixelRGB<T>& iPixel); 00799 PixelLch(const PixelHLS<T>& iPixel); 00800 PixelLch(const PixelXYZ<T>& iPixel); 00801 PixelLch(const PixelLuv<T>& iPixel); 00802 PixelLch(const PixelLab<T>& iPixel); 00803 PixelLch(const PixelHLab<T>& iPixel); 00804 00805 PixelLch& operator=(const PixelLch& ip) { _luminance = ip._luminance; _c = ip._c; _h = ip._h; return *this;} 00806 00807 template <typename U> 00808 PixelLch(const PixelLch<U>& ip) { _luminance = T(ip._luminance); _c = T(ip._c); _h = T(ip._h); } 00809 00810 template <typename U> 00811 PixelLch& operator=(const PixelLch<U>& ip) { _luminance = T(ip._luminance); _c = T(ip._c); _h = T(ip._h); return *this;} 00812 00813 static const PixelLch Null() { static const PixelLch nullPixel( T(0), T(0), T(0) ); return nullPixel; } 00814 static const PixelLch Black() { static const PixelLch blackPixel(T(0), T(0), T(0) ); return blackPixel; } 00815 static const PixelLch White() { static const PixelLch whitePixel(T(100), T(0), T(0) ); return whitePixel; } 00816 00817 T GetChannel0() const { return _luminance; } 00818 T GetChannel1() const { return _c; } 00819 T GetChannel2() const { return _h; } 00820 T GetLuminance() const { return _luminance; } 00821 T GetC() const { return _c; } 00822 T GetH() const { return _h; } 00823 00824 static const uint32 GetChannelCount() { return _channels; } 00825 static const uint32 GetChannelMask() { return CM_Channel012; } 00826 static bool IsFullMask(uint32 iMask) { return (CM_Channel012 == (iMask & CM_Channel012)); } 00827 static bool IsMasking(uint32 iMask) { return (0 != (iMask & CM_Channel012)); } 00828 static const EPixelMode GetPixelMode() { return PM_Color; } 00829 static const EPixelType GetPixelType() { return PT_Lch; } 00830 static const EColorSpace GetColorSpace() { return CS_CIE_Lch; } 00831 static const EResolution GetResolution() { return ResolutionTypeTraits<T>::_Resolution; } 00832 static const bool HasAlpha() { return _bHasAlpha; } 00833 static const bool IsGrey() { return _bGrey; } 00834 static const bool IsColor() { return _bColor; } 00835 static EPixelFormat GetPixelFormat(); 00836 }; 00837 00838 template<typename T> 00839 struct ExportedByImage PixelHLab : public PixelBase< PixelHLab<T> > 00840 { 00841 typedef T type; 00842 typedef IntegerToType< ResolutionTypeTraits<T>::_bInteger > IntType; 00843 typedef LutToType< ResolutionTypeTraits<T>::_bLUT > LutType; 00844 00845 typedef typename ResolutionTypeTraits<T>::SumOverflow_type S_type; 00846 typedef typename ResolutionTypeTraits<T>::MulOverflow_type M_type; 00847 typedef typename ResolutionTypeTraits<T>::Floating_type F_type; 00848 00849 typedef PixelHLab<S_type> SumOverflowPixel; 00850 typedef PixelHLab<M_type> MulOverflowPixel; 00851 typedef PixelHLab<F_type> FloatingPixel; 00852 00853 static const bool _bColor = true; 00854 static const bool _bGrey = false; 00855 static const bool _bHasAlpha = false; 00856 static const uint32 _channels = 3; 00857 00858 union { 00859 T _channel[_channels]; 00860 struct { 00861 T _luminance; 00862 T _a; 00863 T _b; 00864 }; 00865 }; 00866 00867 PixelHLab() { _luminance = _a = _b = T(); } 00868 PixelHLab(T iL, T iA, T iB) { _luminance = iL; _a = iA; _b = iB; } 00869 PixelHLab(const PixelHLab<T>& iPixel) { _luminance = iPixel._luminance; _a = iPixel._a; _b = iPixel._b; } 00870 PixelHLab(const PixelRGB<T>& iPixel); 00871 PixelHLab(const PixelHLS<T>& iPixel); 00872 PixelHLab(const PixelXYZ<T>& iPixel); 00873 PixelHLab(const PixelLuv<T>& iPixel); 00874 PixelHLab(const PixelLab<T>& iPixel); 00875 PixelHLab(const PixelLch<T>& iPixel); 00876 00877 PixelHLab& operator=(const PixelHLab& ip) { _luminance = ip._luminance; _a = ip._a; _b = ip._b; return *this;} 00878 00879 template <typename U> 00880 PixelHLab(const PixelHLab<U>& ip) { _luminance = T(ip._luminance); _a = T(ip._a); _b = T(ip._b); } 00881 00882 template <typename U> 00883 PixelHLab& operator=(const PixelHLab<U>& ip) { _luminance = T(ip._luminance); _a = T(ip._a); _b = T(ip._b); return *this;} 00884 00885 static const PixelHLab Null() { static const PixelHLab nullPixel( T(0), T(0), T(0) ); return nullPixel; } 00886 static const PixelHLab Black() { static const PixelHLab blackPixel(T(0), T(0), T(0) ); return blackPixel; } 00887 static const PixelHLab White() { static const PixelHLab whitePixel(T(100), T(0), T(0) ); return whitePixel; } 00888 00889 T GetChannel0() const { return _luminance; } 00890 T GetChannel1() const { return _a; } 00891 T GetChannel2() const { return _b; } 00892 T GetLuminance() const { return _luminance; } 00893 T GetA() const { return _a; } 00894 T GetB() const { return _b; } 00895 00896 static const uint32 GetChannelCount() { return _channels; } 00897 static const uint32 GetChannelMask() { return CM_Channel012; } 00898 static bool IsFullMask(uint32 iMask) { return (CM_Channel012 == (iMask & CM_Channel012)); } 00899 static bool IsMasking(uint32 iMask) { return (0 != (iMask & CM_Channel012)); } 00900 static const EPixelMode GetPixelMode() { return PM_Color; } 00901 static const EPixelType GetPixelType() { return PT_HLab; } 00902 static const EColorSpace GetColorSpace() { return CS_Hunter_Lab; } 00903 static const EResolution GetResolution() { return ResolutionTypeTraits<T>::_Resolution; } 00904 static const bool HasAlpha() { return _bHasAlpha; } 00905 static const bool IsGrey() { return _bGrey; } 00906 static const bool IsColor() { return _bColor; } 00907 static EPixelFormat GetPixelFormat(); 00908 }; 00909 00910 template<typename T> 00911 struct ExportedByImage PixelRGBA : public PixelBase< PixelRGBA<T> > 00912 { 00913 typedef T type; 00914 typedef IntegerToType< ResolutionTypeTraits<T>::_bInteger > IntType; 00915 typedef LutToType< ResolutionTypeTraits<T>::_bLUT > LutType; 00916 00917 typedef typename ResolutionTypeTraits<T>::SumOverflow_type S_type; 00918 typedef typename ResolutionTypeTraits<T>::MulOverflow_type M_type; 00919 typedef typename ResolutionTypeTraits<T>::Floating_type F_type; 00920 00921 typedef PixelRGBA<S_type> SumOverflowPixel; 00922 typedef PixelRGBA<M_type> MulOverflowPixel; 00923 typedef PixelRGBA<F_type> FloatingPixel; 00924 00925 static const bool _bColor = true; 00926 static const bool _bGrey = false; 00927 static const bool _bHasAlpha = true; 00928 static const uint32 _channels = 4; 00929 00930 union { 00931 T _channel[_channels]; 00932 struct { 00933 T _red; 00934 T _green; 00935 T _blue; 00936 T _alpha; 00937 }; 00938 }; 00939 00940 PixelRGBA() { _red = _green = _blue = _alpha = T(); } 00941 PixelRGBA(T iR, T iG, T iB, T iA) { _red = iR; _green = iG; _blue = iB; _alpha = iA; } 00942 PixelRGBA(const PixelRGBA& ip) { _red = ip._red; _green = ip._green; _blue = ip._blue; _alpha = ip._alpha; } 00943 00944 PixelRGBA(const PixelL<T>& iPixel) { _red = _green = _blue = iPixel._luminance; _alpha = ResolutionTypeTraits<T>::_Norm; } 00945 PixelRGBA(const PixelLA<T>& iPixel) { _red = _green = _blue = iPixel._luminance; _alpha = iPixel._alpha; } 00946 PixelRGBA(const PixelComplex<T>& iPixel) { elxFIXME; } 00947 PixelRGBA(const PixelRGB<T>& iPixel) { _red = iPixel._red; _green = iPixel._green; _blue = iPixel._blue; _alpha = ResolutionTypeTraits<T>::_Norm; } 00948 PixelRGBA(const PixelRGB<T>& iPixel, T iA) { _red = iPixel._red; _green = iPixel._green; _blue = iPixel._blue; _alpha = iA; } 00949 PixelRGBA(const PixelXYZ<T>& iPixel) { elxFIXME; } 00950 PixelRGBA(const PixelHLS<T>& iPixel) { elxFIXME; } 00951 PixelRGBA(const PixelLab<T>& iPixel) { elxFIXME; } 00952 PixelRGBA(const PixelLuv<T>& iPixel) { elxFIXME; } 00953 PixelRGBA(const PixelLch<T>& iPixel) { elxFIXME; } 00954 PixelRGBA(const PixelHLab<T>& iPixel) { elxFIXME; } 00955 00956 PixelRGBA& operator=(const PixelRGBA& ip){ _red = ip._red; _green = ip._green; _blue = ip._blue; _alpha = ip._alpha; return *this;} 00957 00958 template <typename U> 00959 PixelRGBA(const PixelRGBA<U>& ip) { _red = T(ip._red); _green = T(ip._green); _blue = T(ip._blue); _alpha = T(ip._alpha); } 00960 00961 template <typename U> 00962 PixelRGBA& operator=(const PixelRGBA<U>& ip) { _red = T(ip._red); _green = T(ip._green); _blue = T(ip._blue); _alpha = T(ip._alpha); return *this;} 00963 00964 static const PixelRGBA Null() { static const PixelRGBA nullPixel( T(0),T(0),T(0),T(0) ); return nullPixel; } 00965 static const PixelRGBA Black() { static const PixelRGBA blackPixel(SampleTypeTraits<T>::_black, SampleTypeTraits<T>::_black, SampleTypeTraits<T>::_black, ResolutionTypeTraits<T>::_Norm); return blackPixel; } 00966 static const PixelRGBA White() { static const PixelRGBA whitePixel(SampleTypeTraits<T>::_white, SampleTypeTraits<T>::_white, SampleTypeTraits<T>::_white, ResolutionTypeTraits<T>::_Norm); return whitePixel; } 00967 00968 T GetChannel0() const { return _red; } 00969 T GetChannel1() const { return _green; } 00970 T GetChannel2() const { return _blue; } 00971 T GetChannel3() const { return _alpha; } 00972 T GetRed() const { return _red; } 00973 T GetGreen() const { return _green; } 00974 T GetBlue() const { return _blue; } 00975 T GetAlpha() const { return _alpha; } 00976 T GetLuminance(EColorToGreyConversion iMethod=CGC_Default) const; 00977 00978 static const uint32 GetChannelCount() { return _channels; } 00979 static const uint32 GetChannelMask() { return CM_Channel0123; } 00980 static bool IsFullMask(uint32 iMask) { return (CM_Channel0123 == (iMask & CM_Channel0123)); } 00981 static bool IsMasking(uint32 iMask) { return (0 != (iMask & CM_Channel0123)); } 00982 static const EPixelMode GetPixelMode() { return PM_Color; } 00983 static const EPixelType GetPixelType() { return PT_RGBA; } 00984 static const EColorSpace GetColorSpace() { return CS_RGB; } 00985 static const EResolution GetResolution() { return ResolutionTypeTraits<T>::_Resolution; } 00986 static const bool HasAlpha() { return _bHasAlpha; } 00987 static const bool IsGrey() { return _bGrey; } 00988 static const bool IsColor() { return _bColor; } 00989 static EPixelFormat GetPixelFormat(); 00990 }; 00991 00992 00995 // declare all suitable pixel types. 00996 typedef PixelL<uint8> PixelLub; 00997 typedef PixelL<uint16> PixelLus; 00998 typedef PixelL<int32> PixelLi; 00999 typedef PixelL<int64> PixelLl; 01000 typedef PixelL<float> PixelLf; 01001 typedef PixelL<double> PixelLd; 01002 01003 typedef PixelLA<uint8> PixelLAub; 01004 typedef PixelLA<uint16> PixelLAus; 01005 typedef PixelLA<int32> PixelLAi; 01006 typedef PixelLA<int64> PixelLAl; 01007 typedef PixelLA<float> PixelLAf; 01008 typedef PixelLA<double> PixelLAd; 01009 01010 typedef PixelRGB<uint8> PixelRGBub; 01011 typedef PixelRGB<uint16> PixelRGBus; 01012 typedef PixelRGB<int32> PixelRGBi; 01013 typedef PixelRGB<int64> PixelRGBl; 01014 typedef PixelRGB<float> PixelRGBf; 01015 typedef PixelRGB<double> PixelRGBd; 01016 01017 typedef PixelRGBA<uint8> PixelRGBAub; 01018 typedef PixelRGBA<uint16> PixelRGBAus; 01019 typedef PixelRGBA<int32> PixelRGBAi; 01020 typedef PixelRGBA<int64> PixelRGBAl; 01021 typedef PixelRGBA<float> PixelRGBAf; 01022 typedef PixelRGBA<double> PixelRGBAd; 01023 01024 typedef PixelComplex<int32> PixelComplexi; 01025 typedef PixelComplex<float> PixelComplexf; 01026 typedef PixelComplex<double> PixelComplexd; 01027 01028 typedef PixelHLS<float> PixelHLSf; 01029 typedef PixelHLS<double> PixelHLSd; 01030 01031 typedef PixelXYZ<float> PixelXYZf; 01032 typedef PixelXYZ<double> PixelXYZd; 01033 01034 typedef PixelLab<float> PixelLabf; 01035 typedef PixelLab<double> PixelLabd; 01036 01037 typedef PixelLuv<float> PixelLuvf; 01038 typedef PixelLuv<double> PixelLuvd; 01039 01040 typedef PixelLch<float> PixelLchf; 01041 typedef PixelLch<double> PixelLchd; 01042 01043 typedef PixelHLab<float> PixelHLabf; 01044 typedef PixelHLab<double> PixelHLabd; 01045 01047 01048 } // namespace Image 01049 } // namespace eLynx 01050 01051 #include "inl/Pixel/Pixels.inl" 01052 01053 #endif // __Pixels_h__