eLynx SDK
v3.3.0 C++ image processing API reference |
00001 //============================================================================ 00002 // IImageGeometry.h Image.Component package 00003 //============================================================================ 00004 // Usage : image geometry Interface 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 __IImageGeometry_h__ 00019 #define __IImageGeometry_h__ 00020 00021 #include <elx/core/ProgressNotifier.h> 00022 #include <elx/math/ResampleFilterImpls.h> 00023 #include <elx/image/AbstractImage.h> 00024 #include <elx/image/ImageLib.h> 00025 #include <boost/shared_ptr.hpp> 00026 00027 namespace eLynx { 00028 namespace Image { 00029 00031 enum EBinningMethod 00032 { 00033 BM_Mean, 00034 BM_Median, 00035 BM_Sum, 00036 BM_Min, 00037 BM_Max 00038 }; 00039 00043 ExportedByImage const char * elxToString(EBinningMethod iBinningMethod); 00044 00048 ExportedByImage EBinningMethod elxToEBinningMethod(const char * iprBinningMethod); 00049 00050 enum EFlipPlane 00051 { 00052 FP_Horizontal, 00053 FP_Vertical, 00054 FP_Both, 00055 FP_None 00056 }; 00057 00061 ExportedByImage const char * elxToString(EFlipPlane iFlipPlane); 00062 00066 ExportedByImage EFlipPlane elxToEFlipPlane(const char * iprFlipPlane); 00067 00068 enum ERightRotation 00069 { 00070 RR_0, 00071 RR_90Left, 00072 RR_180, 00073 RR_90Right 00074 }; 00075 00079 ExportedByImage const char * elxToString(ERightRotation iRightRotation); 00080 00084 ExportedByImage ERightRotation elxToERightRotation(const char * iprRightRotation); 00085 00086 enum 00087 { 00088 RF_Expand = 0x01, 00089 RF_Interpolation = 0x02, 00090 RF_Antialiasing = 0x04, 00091 RF_Default = RF_Expand | RF_Interpolation | RF_Antialiasing 00092 }; 00093 00097 ExportedByImage const char * elxEGeometryFlagToString(int32 iFlag); 00098 00102 ExportedByImage int32 elxToEGeometryFlag(const char * iprFlag); 00103 00109 class ExportedByImage IImageGeometry 00110 { 00111 public: 00114 virtual ~IImageGeometry(); 00115 00118 00129 virtual bool Flip( 00130 AbstractImage& ioImage, 00131 EFlipPlane iFlipPlane, 00132 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const = 0; 00133 00139 virtual boost::shared_ptr<AbstractImage> 00140 CreateFlipped( 00141 const AbstractImage& iImage, 00142 EFlipPlane iFlipPlane, 00143 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const = 0; 00145 00146 00149 00161 virtual bool Rotate( 00162 AbstractImage& ioImage, 00163 ERightRotation iRotation, 00164 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const = 0; 00165 00172 virtual bool Rotate( 00173 AbstractImage& ioImage, 00174 double iDegrees, 00175 int32 iFlags = RF_Default, 00176 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const = 0; 00177 00183 virtual boost::shared_ptr<AbstractImage> CreateRotated(const AbstractImage& iImage, 00184 ERightRotation iRotation, 00185 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const = 0; 00186 00193 virtual boost::shared_ptr<AbstractImage> 00194 CreateRotated( 00195 const AbstractImage& iImage, 00196 double iDegrees, 00197 int32 iFlags = RF_Default, 00198 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const = 0; 00200 00201 00204 00217 virtual bool Crop( 00218 AbstractImage& ioImage, 00219 uint32 iX, 00220 uint32 iY, 00221 uint32 iWidth, 00222 uint32 iHeight, 00223 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const = 0; 00224 00229 virtual bool AutoCrop( 00230 AbstractImage& ioImage, 00231 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const = 0; 00232 00247 virtual bool AddBorder( 00248 AbstractImage& ioImage, 00249 uint32 iLeft, 00250 uint32 iRight, 00251 uint32 iTop, 00252 uint32 iBottom, 00253 bool ibBlack, 00254 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const = 0; 00255 00266 virtual bool Resize( 00267 AbstractImage& ioImage, 00268 uint32 iWidth, 00269 uint32 iHeight, 00270 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const = 0; 00271 00281 virtual bool Zoom( 00282 AbstractImage& ioImage, 00283 uint32 iZoom, 00284 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const = 0; 00285 00299 virtual bool Bin( 00300 AbstractImage& ioImage, 00301 uint32 iDim, 00302 EBinningMethod iMethod, 00303 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const = 0; 00304 00313 virtual boost::shared_ptr<AbstractImage> 00314 CreateSubImage( 00315 const AbstractImage& iImage, 00316 uint32 iX, 00317 uint32 iY, 00318 uint32 iWidth, 00319 uint32 iHeight, 00320 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const = 0; 00321 00331 virtual boost::shared_ptr<AbstractImage> 00332 CreateEnlarged( 00333 const AbstractImage& iImage, 00334 uint32 iLeft, 00335 uint32 iRight, 00336 uint32 iTop, 00337 uint32 iBottom, 00338 bool ibBlack, 00339 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const = 0; 00340 00347 virtual boost::shared_ptr<AbstractImage> 00348 CreateResized( 00349 const AbstractImage& iImage, 00350 uint32 iWidth, 00351 uint32 iHeight, 00352 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const = 0; 00353 00359 virtual boost::shared_ptr<AbstractImage> 00360 CreateZoomed( 00361 const AbstractImage& iImage, 00362 uint32 iZoom, 00363 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const = 0; 00364 00371 virtual boost::shared_ptr<AbstractImage> 00372 CreateBinned( 00373 const AbstractImage& iImage, 00374 uint32 iDim, 00375 EBinningMethod iMethod, 00376 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const = 0; 00377 00378 virtual boost::shared_ptr<AbstractImage> 00379 CreateResampled( 00380 const AbstractImage& iImage, 00381 uint32 iWidth, 00382 uint32 iHeight, 00383 Math::EResampleFilter iFilter, 00384 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const = 0; 00385 00386 00398 virtual bool Resample( 00399 AbstractImage& ioImage, 00400 uint32 iWidth, 00401 uint32 iHeight, 00402 Math::EResampleFilter iFilter, 00403 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const = 0; 00404 00405 virtual bool Insert( 00406 AbstractImage& ioImage, 00407 const AbstractImage& iInserted, 00408 int32 iX, 00409 int32 iY, 00410 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const = 0; 00412 00415 00427 virtual bool Shift( 00428 AbstractImage& ioImage, 00429 int32 iHorizontal, 00430 int32 iVertical, 00431 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const = 0; 00432 00439 virtual bool Shift( 00440 AbstractImage& ioImage, 00441 double iHorizontal, 00442 double iVertical, 00443 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const = 0; 00444 00445 virtual boost::shared_ptr<AbstractImage> 00446 CreateShifted( 00447 const AbstractImage& iImage, 00448 int32 iHorizontal, 00449 int32 iVertical, 00450 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const = 0; 00451 00452 virtual boost::shared_ptr<AbstractImage> 00453 CreateShifted( 00454 const AbstractImage& iImage, 00455 double iHorizontal, 00456 double iVertical, 00457 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const = 0; 00458 00459 virtual boost::shared_ptr<AbstractImage> 00460 CreateExpanded( 00461 const AbstractImage& iImage, 00462 uint32 iBorder, 00463 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const = 0; 00464 }; 00465 00466 } // namespace Image 00467 } // namespace eLynx 00468 00469 #endif // __IImageGeometry_h__