eLynx SDK
v3.3.0 C++ image processing API reference |
00001 //============================================================================ 00002 // PixelServices.h Image.Component package 00003 //============================================================================ 00004 // Usage : define common definition for pixel format 00005 //---------------------------------------------------------------------------- 00006 // Copyright (C) 2009 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 __PixelServices_h__ 00019 #define __PixelServices_h__ 00020 00021 #include <elx/core/CoreTypes.h> 00022 #include <elx/image/ImageLib.h> 00023 00024 namespace eLynx { 00025 namespace Image { 00026 00030 ExportedByImage const char * elxToString(EColorToGreyConversion iMethod); 00031 00035 ExportedByImage const char * elxToString(EGreyToColorConversion iMethod); 00036 00037 00040 00044 ExportedByImage const char * elxToString(EPixelFormat iFormat); 00045 00049 ExportedByImage const char * elxToString(EPixelType iPixelType); 00050 00054 ExportedByImage const char * elxToString(EPixelMode iPixelMode); 00055 00059 ExportedByImage const char * elxToString(EColorSpace iColorSpace); 00060 00065 ExportedByImage const char * elxToString(EPixelFormat iFormat, uint32 iChannelIndex); 00067 00068 00071 00075 ExportedByImage EResolution elxGetResolution(EPixelFormat iFormat); 00076 00080 ExportedByImage EPixelMode elxGetPixelMode(EPixelFormat iFormat); 00081 00085 ExportedByImage EPixelType elxGetPixelType(EPixelFormat iFormat); 00086 00090 ExportedByImage EColorSpace elxGetColorSpace(EPixelFormat iFormat); 00091 00095 ExportedByImage uint32 elxGetChannelCount(EPixelFormat iFormat); 00096 00100 ExportedByImage uint32 elxSizeofPixel(EPixelFormat iFormat); 00101 00105 ExportedByImage EResolution elxBitsPerPixel(EPixelFormat iFormat); 00106 00110 ExportedByImage uint32 elxChannelsPerPixel(EPixelFormat iFormat); 00111 00115 ExportedByImage uint32 elxBitsPerChannel(EPixelFormat iFormat); 00116 00120 ExportedByImage bool elxHasAlpha(EPixelFormat iFormat); 00121 00126 ExportedByImage EPixelFormat elxGetPixelFormat( 00127 EPixelFormat iFormat, EResolution iResolution); 00128 00135 ExportedByImage EPixelFormat elxGetPixelFormat( 00136 EPixelMode iPixelMode, EResolution iResolution, 00137 EColorSpace iColorSpace = CS_Undefined, bool ibHasAlpha = false); 00138 00143 ExportedByImage EPixelFormat elxGetPixelFormat( 00144 EPixelType iPixelType, EResolution iResolution); 00145 00146 //--- Resolution ------------------------------------------------------------- 00147 ExportedByImage bool elxIsUInt8(EPixelFormat iFormat); 00148 ExportedByImage bool elxIsUInt16(EPixelFormat iFormat); 00149 ExportedByImage bool elxIsInt32(EPixelFormat iFormat); 00150 ExportedByImage bool elxIsFloat(EPixelFormat iFormat); 00151 ExportedByImage bool elxIsDouble(EPixelFormat iFormat); 00152 00153 //--- Pixel type ------------------------------------------------------------- 00154 ExportedByImage bool elxIsColor(EPixelFormat iFormat); 00155 ExportedByImage bool elxIsGrey(EPixelFormat iFormat); 00156 ExportedByImage bool elxIsComplex(EPixelFormat iFormat); 00157 00158 //----- Pixel format without resolution -------------------------------------- 00159 ExportedByImage bool elxIsL(EPixelFormat iFormat); 00160 ExportedByImage bool elxIsLA(EPixelFormat iFormat); 00161 ExportedByImage bool elxIsRGB(EPixelFormat iFormat); 00162 ExportedByImage bool elxIsRGBA(EPixelFormat iFormat); 00163 ExportedByImage bool elxIsHLS(EPixelFormat iFormat); 00164 ExportedByImage bool elxIsXYZ(EPixelFormat iFormat); 00165 ExportedByImage bool elxIsLuv(EPixelFormat iFormat); 00166 ExportedByImage bool elxIsLab(EPixelFormat iFormat); 00167 ExportedByImage bool elxIsLch(EPixelFormat iFormat); 00168 ExportedByImage bool elxIsHLab(EPixelFormat iFormat); 00169 00170 //---------------------------------------------------------------------------- 00171 ExportedByImage bool elxIsMasking(EPixelFormat iFormat, uint32 iChannelMask); 00172 00174 00177 template<class Pixel> 00178 struct LuminanceCell 00179 { 00180 typedef typename Pixel::type T; 00181 T _luminance; 00182 Pixel _pixel; 00183 }; 00185 00186 } // namespace Image 00187 } // namespace eLynx 00188 00189 #include "inl/Pixel/PixelServices.inl" 00190 00191 #endif // __PixelServices_h__