eLynx SDK
v3.3.0 C++ image processing API reference |
00001 //============================================================================ 00002 // AbstractImage.h Image.Component package 00003 //============================================================================ 00004 // Usage : abstract image class definition 00005 //---------------------------------------------------------------------------- 00006 // Inheritance : - 00007 //---------------------------------------------------------------------------- 00008 // Copyright (C) 2006 by eLynx project 00009 // 00010 // This library is free software; you can redistribute it and/or 00011 // modify it under the terms of the GNU Library General Public 00012 // License as published by the Free Software Foundation; either 00013 // version 2 of the License, or (at your option) any later version. 00014 // 00015 // This library is distributed in the hope that it will be useful, 00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00018 // See the GNU Library General Public License for more details. 00019 //---------------------------------------------------------------------------- 00020 #ifndef __AbstractImage_h__ 00021 #define __AbstractImage_h__ 00022 00023 #include <elx/image/Pixels.h> 00024 #include <elx/image/IPixelIterator.h> 00025 #include <elx/math/Geometry.h> 00026 00027 #include <boost/shared_ptr.hpp> 00028 00029 namespace eLynx { 00030 namespace Image { 00031 00043 class ExportedByImage AbstractImage 00044 { 00047 protected: 00052 AbstractImage(uint32 iWidth = 0, uint32 iHeight = 0); 00053 00057 AbstractImage(const AbstractImage& iImage); 00058 00059 private: 00063 const AbstractImage& operator = (const AbstractImage& iImage); 00064 00065 public: 00068 virtual ~AbstractImage(); 00070 00071 00074 00077 virtual EPixelFormat GetPixelFormat() const = 0; 00078 00081 EPixelMode GetPixelMode() const; 00082 00085 EPixelType GetPixelType() const; 00086 00089 EColorSpace GetColorSpace() const; 00090 00093 uint32 GetChannelCount() const; 00094 00097 EResolution GetResolution() const; 00098 00101 uint32 sizeofPixel() const; 00102 00105 uint32 GetBitsPerPixel() const; 00106 00109 bool IsColor() const; 00110 00113 bool IsGrey() const; 00114 00117 bool IsComplex() const; 00118 00121 bool HasAlpha() const; 00122 00125 bool IsL() const; 00126 00129 bool IsLA() const; 00130 00133 bool IsRGB() const; 00134 00137 bool IsRGBA() const; 00138 00141 bool IsHLS() const; 00142 00145 bool IsXYZ() const; 00146 00149 bool IsLuv() const; 00150 00153 bool IsLab() const; 00154 00157 bool IsLch() const; 00158 00161 bool IsHLab() const; 00162 00163 bool IsMasking(uint32 iChannelMask) const; 00164 00165 bool IsUInt8() const; 00166 bool IsUInt16() const; 00167 bool IsInt32() const; 00168 bool IsFloat() const; 00169 bool IsDouble() const; 00170 00171 bool IsLub() const; 00172 bool IsLus() const; 00173 bool IsLi() const; 00174 bool IsLf() const; 00175 bool IsLd() const; 00176 bool IsLAub() const; 00177 bool IsLAus() const; 00178 bool IsLAi() const; 00179 bool IsLAf() const; 00180 bool IsLAd() const; 00181 bool IsComplexi() const; 00182 bool IsComplexf() const; 00183 bool IsComplexd() const; 00184 bool IsRGBub() const; 00185 bool IsRGBus() const; 00186 bool IsRGBi() const; 00187 bool IsRGBf() const; 00188 bool IsRGBd() const; 00189 bool IsRGBAub() const; 00190 bool IsRGBAus() const; 00191 bool IsRGBAi() const; 00192 bool IsRGBAf() const; 00193 bool IsRGBAd() const; 00194 bool IsHLSf() const; 00195 bool IsHLSd() const; 00196 bool IsXYZf() const; 00197 bool IsXYZd() const; 00198 bool IsLuvf() const; 00199 bool IsLuvd() const; 00200 bool IsLabf() const; 00201 bool IsLabd() const; 00202 bool IsLchf() const; 00203 bool IsLchd() const; 00204 bool IsHLabf() const; 00205 bool IsHLabd() const; 00206 00208 00211 00214 virtual bool IsValid() const; 00215 00218 uint32 GetWidth() const; 00219 00222 uint32 GetHeight() const; 00223 00226 uint32 GetPixelCount() const; 00227 00230 uint32 GetSampleCount() const; 00231 00234 uint32 sizeofMap() const; 00236 00239 /* 00240 * The implementation of all iterator related methods must live in the 00241 * ImageImpl.inl file because of cycle inclusions 00242 */ 00245 virtual boost::shared_ptr<IPixelIterator> Begin() = 0; 00246 00249 virtual boost::shared_ptr<IPixelIterator> Begin() const = 0; 00250 00253 virtual boost::shared_ptr<IPixelIterator> End() = 0; 00254 00257 virtual boost::shared_ptr<IPixelIterator> End() const = 0; 00259 00260 protected: 00263 uint32 _width; 00266 uint32 _height; 00267 }; 00268 00269 00273 template <class Image> 00274 bool elxUseable(const Image * iprImage); 00275 00276 00277 } // namespace Image 00278 } // namespace eLynx 00279 00280 #include "inl/AbstractImage.inl" 00281 00282 #endif // __AbstractImage_h__