eLynx SDK
v3.0.1 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 00102 //@TODO 00106 ExportedByImage EResolution elxBitsPerPixel(EPixelFormat iFormat); 00107 00108 ExportedByImage EResolution elxChannelsPerPixel(EPixelFormat iFormat); 00109 00110 ExportedByImage EResolution elxBitsPerChannel(EPixelFormat iFormat); 00111 00115 ExportedByImage bool elxHasAlpha(EPixelFormat iFormat); 00116 00121 ExportedByImage EPixelFormat elxGetPixelFormat( 00122 EPixelFormat iFormat, EResolution iResolution); 00123 00130 ExportedByImage EPixelFormat elxGetPixelFormat( 00131 EPixelMode iPixelMode, EResolution iResolution, 00132 EColorSpace iColorSpace = CS_Undefined, bool ibHasAlpha = false); 00133 00138 ExportedByImage EPixelFormat elxGetPixelFormat( 00139 EPixelType iPixelType, EResolution iResolution); 00140 00141 //--- Resolution ------------------------------------------------------------- 00142 ExportedByImage bool elxIsUInt8(EPixelFormat iFormat); 00143 ExportedByImage bool elxIsUInt16(EPixelFormat iFormat); 00144 ExportedByImage bool elxIsInt32(EPixelFormat iFormat); 00145 ExportedByImage bool elxIsFloat(EPixelFormat iFormat); 00146 ExportedByImage bool elxIsDouble(EPixelFormat iFormat); 00147 00148 //--- Pixel type ------------------------------------------------------------- 00149 ExportedByImage bool elxIsColor(EPixelFormat iFormat); 00150 ExportedByImage bool elxIsGrey(EPixelFormat iFormat); 00151 ExportedByImage bool elxIsComplex(EPixelFormat iFormat); 00152 00153 //----- Pixel format without resolution -------------------------------------- 00154 ExportedByImage bool elxIsL(EPixelFormat iFormat); 00155 ExportedByImage bool elxIsLA(EPixelFormat iFormat); 00156 ExportedByImage bool elxIsRGB(EPixelFormat iFormat); 00157 ExportedByImage bool elxIsRGBA(EPixelFormat iFormat); 00158 ExportedByImage bool elxIsHLS(EPixelFormat iFormat); 00159 ExportedByImage bool elxIsXYZ(EPixelFormat iFormat); 00160 ExportedByImage bool elxIsLuv(EPixelFormat iFormat); 00161 ExportedByImage bool elxIsLab(EPixelFormat iFormat); 00162 ExportedByImage bool elxIsLch(EPixelFormat iFormat); 00163 ExportedByImage bool elxIsHLab(EPixelFormat iFormat); 00164 00165 //---------------------------------------------------------------------------- 00166 ExportedByImage bool elxIsMasking(EPixelFormat iFormat, uint32 iChannelMask); 00167 00169 00172 template<class Pixel> 00173 struct LuminanceCell 00174 { 00175 typedef Pixel Pixel_t; 00176 typedef typename Pixel_t::type type_t; 00177 type_t _luminance; 00178 Pixel_t _pixel; 00179 }; 00181 00182 } // namespace Image 00183 } // namespace eLynx 00184 00185 #include "inl/Pixel/PixelServices.inl" 00186 00187 #endif // __PixelServices_h__