eLynx SDK
v3.0.1 C++ image processing API reference |
00001 //============================================================================ 00002 // ImageOperatorsImpl.h Image.Component package 00003 //============================================================================ 00004 // Usage : interface for image processing operators 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 __ImageOperatorsImpl_h__ 00019 #define __ImageOperatorsImpl_h__ 00020 00021 #include <elx/image/IImageOperators.h> 00022 #include <elx/image/ImageImpl.h> 00023 #include <elx/image/Pixels.h> 00024 00025 namespace eLynx { 00026 namespace Image { 00027 00030 00031 template <class Pixel> 00032 class ExportedByImage ImageOperatorsImpl : public IImageOperators 00033 { 00034 public: 00035 typedef Pixel Pixel_t; 00036 00039 virtual bool Operator(AbstractImage& ioImage, 00040 EImageOperator iOperator, 00041 double iValue, 00042 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00043 00044 virtual bool Operator(AbstractImage& ioImage, 00045 EImageOperator iOperator, 00046 const AbstractImage& iImage, 00047 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00048 00049 virtual bool Operator(AbstractImage& ioImage, 00050 EImageOperator iOperator, 00051 const AbstractImage& iImage, 00052 const ImageLub& iImageMask, 00053 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00054 00055 virtual bool Operator(AbstractImage& ioImage, 00056 EImageOperator iOperator, 00057 const std::vector< const AbstractImage* >& iImageList, 00058 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00059 00061 virtual boost::shared_ptr< AbstractImage > CreateImage( 00062 EImageListOperator iOperator, 00063 const std::vector< const AbstractImage* >& iImageList, 00064 uint32 iChannelMask,ProgressNotifier& iNotifier) const; 00065 00066 virtual boost::shared_ptr< AbstractImage > CreateClipped( 00067 EImageListOperator iOperator, 00068 const std::vector< const AbstractImage* >& iImageList, 00069 uint32 iIteration, double iKappa, 00070 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00071 00072 virtual boost::shared_ptr< AbstractImage > CreateWeightedEntropy( 00073 const std::vector< const AbstractImage* >& iImageList, 00074 uint32 iW, uint32 iH, 00075 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00076 00078 00081 /* 00082 static bool Operator(ImageImpl<Pixel>& ioImage, 00083 EImageOperator iOperator, 00084 double iValue, 00085 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00086 */ 00087 static bool Operator(ImageImpl<Pixel>& ioImage, 00088 EImageOperator iOperator, 00089 const ImageImpl<Pixel>& iImage, 00090 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00091 00092 static bool OperatorMedian(AbstractImage& oImage, 00093 const std::vector< const AbstractImage* >& iImageList, 00094 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00095 00096 static bool OperatorMean(AbstractImage& oImage, 00097 const std::vector< const AbstractImage* >& iImageList, 00098 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00099 00101 }; 00102 00103 //---------------------------------------------------------------------------- 00104 // Operator with constant 00105 //---------------------------------------------------------------------------- 00106 template <class Pixel> 00107 bool elxOperator(ImageImpl<Pixel>& ioImage, 00108 EImageOperator iOperator, 00109 double iValue, 00110 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00111 00112 //---------------------------------------------------------------------------- 00113 // Operator with another image with same size 00114 //---------------------------------------------------------------------------- 00115 template <class Pixel> 00116 bool elxOperator(ImageImpl<Pixel>& ioImage, 00117 EImageOperator iOperator, 00118 const ImageImpl<Pixel>& iImage, 00119 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00120 00121 //---------------------------------------------------------------------------- 00122 // Create Sum image from ImageImpl<Pixel> list 00123 //---------------------------------------------------------------------------- 00124 template <class Pixel> 00125 boost::shared_ptr< ImageImpl<Pixel> > elxCreateSum( 00126 const std::vector< const ImageImpl<Pixel>* >& iImageList, 00127 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00128 00129 //---------------------------------------------------------------------------- 00130 // Create Sum image from ImageImpl<Pixel> list 00131 //---------------------------------------------------------------------------- 00132 template <class Pixel> 00133 boost::shared_ptr< ImageImpl<Pixel> > elxCreateMul( 00134 const std::vector< const ImageImpl<Pixel>* >& iImageList, 00135 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00136 00137 //---------------------------------------------------------------------------- 00138 // Create Min image from ImageImpl<Pixel> list 00139 //---------------------------------------------------------------------------- 00140 template <class Pixel> 00141 boost::shared_ptr< ImageImpl<Pixel> > elxCreateMin( 00142 const std::vector< const ImageImpl<Pixel>* >& iImageList, 00143 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00144 00145 //---------------------------------------------------------------------------- 00146 // Create Min image from ImageImpl<Pixel> list 00147 //---------------------------------------------------------------------------- 00148 template <class Pixel> 00149 boost::shared_ptr< ImageImpl<Pixel> > elxCreateMax( 00150 const std::vector< const ImageImpl<Pixel>* >& iImageList, 00151 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00152 00153 //---------------------------------------------------------------------------- 00154 // Create Median image from ImageImpl<Pixel> list 00155 //---------------------------------------------------------------------------- 00156 template <class Pixel> 00157 boost::shared_ptr< ImageImpl<Pixel> > elxCreateMedian( 00158 const std::vector< const ImageImpl<Pixel>* >& iImageList, 00159 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00160 00161 } // namespace Image 00162 } // namespace eLynx 00163 00164 #include <elx/core/CoreSort.h> 00165 #include <elx/math/Ramp.h> 00166 #include <elx/image/PixelIterator.h> 00167 #include <boost/scoped_array.hpp> 00168 00169 #endif // __ImageOperatorsImpl_h__