eLynx SDK
v3.3.0 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: 00037 virtual bool Operator(AbstractImage& ioImage, 00038 EImageOperator iOperator, 00039 double iValue, 00040 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00041 00042 virtual bool Operator(AbstractImage& ioImage, 00043 EImageOperator iOperator, 00044 const AbstractImage& iImage, 00045 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00046 00047 virtual bool Operator(AbstractImage& ioImage, 00048 EImageOperator iOperator, 00049 const AbstractImage& iImage, 00050 const ImageLub& iImageMask, 00051 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00052 00053 virtual bool Operator(AbstractImage& ioImage, 00054 EImageOperator iOperator, 00055 const std::vector< const AbstractImage* >& iImageList, 00056 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00057 00059 virtual boost::shared_ptr< AbstractImage > CreateImage( 00060 EImageListOperator iOperator, 00061 const std::vector< const AbstractImage* >& iImageList, 00062 uint32 iChannelMask,ProgressNotifier& iNotifier) const; 00063 00064 virtual boost::shared_ptr< AbstractImage > CreateClipped( 00065 EImageListOperator iOperator, 00066 const std::vector< const AbstractImage* >& iImageList, 00067 uint32 iIteration, double iKappa, 00068 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00069 00070 virtual boost::shared_ptr< AbstractImage > CreateWeightedEntropy( 00071 const std::vector< const AbstractImage* >& iImageList, 00072 uint32 iW, uint32 iH, 00073 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00074 00076 00079 /* 00080 static bool Operator(ImageImpl<Pixel>& ioImage, 00081 EImageOperator iOperator, 00082 double iValue, 00083 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00084 */ 00085 static bool Operator(ImageImpl<Pixel>& ioImage, 00086 EImageOperator iOperator, 00087 const ImageImpl<Pixel>& iImage, 00088 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00089 00090 static bool OperatorMedian(AbstractImage& oImage, 00091 const std::vector< const AbstractImage* >& iImageList, 00092 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00093 00094 static bool OperatorMean(AbstractImage& oImage, 00095 const std::vector< const AbstractImage* >& iImageList, 00096 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00097 00099 }; 00100 00101 //---------------------------------------------------------------------------- 00102 // Operator with constant 00103 //---------------------------------------------------------------------------- 00104 template <class Pixel> 00105 bool elxOperator(ImageImpl<Pixel>& ioImage, 00106 EImageOperator iOperator, 00107 typename Pixel::type iValue, 00108 //double iValue, 00109 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00110 00111 //---------------------------------------------------------------------------- 00112 // Operator with another image with same size 00113 //---------------------------------------------------------------------------- 00114 template <class Pixel> 00115 bool elxOperator(ImageImpl<Pixel>& ioImage, 00116 EImageOperator iOperator, 00117 const ImageImpl<Pixel>& iImage, 00118 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00119 00120 //---------------------------------------------------------------------------- 00121 // Create Sum image from ImageImpl<Pixel> list 00122 //---------------------------------------------------------------------------- 00123 template <class Pixel> 00124 boost::shared_ptr< ImageImpl<Pixel> > elxCreateSum( 00125 const std::vector< const ImageImpl<Pixel>* >& iImageList, 00126 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00127 00128 //---------------------------------------------------------------------------- 00129 // Create Sum image from ImageImpl<Pixel> list 00130 //---------------------------------------------------------------------------- 00131 template <class Pixel> 00132 boost::shared_ptr< ImageImpl<Pixel> > elxCreateMul( 00133 const std::vector< const ImageImpl<Pixel>* >& iImageList, 00134 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00135 00136 //---------------------------------------------------------------------------- 00137 // Create Min image from ImageImpl<Pixel> list 00138 //---------------------------------------------------------------------------- 00139 template <class Pixel> 00140 boost::shared_ptr< ImageImpl<Pixel> > elxCreateMin( 00141 const std::vector< const ImageImpl<Pixel>* >& iImageList, 00142 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00143 00144 //---------------------------------------------------------------------------- 00145 // Create Min image from ImageImpl<Pixel> list 00146 //---------------------------------------------------------------------------- 00147 template <class Pixel> 00148 boost::shared_ptr< ImageImpl<Pixel> > elxCreateMax( 00149 const std::vector< const ImageImpl<Pixel>* >& iImageList, 00150 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00151 00152 //---------------------------------------------------------------------------- 00153 // Create Median image from ImageImpl<Pixel> list 00154 //---------------------------------------------------------------------------- 00155 template <class Pixel> 00156 boost::shared_ptr< ImageImpl<Pixel> > elxCreateMedian( 00157 const std::vector< const ImageImpl<Pixel>* >& iImageList, 00158 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00159 00160 } // namespace Image 00161 } // namespace eLynx 00162 00163 #include <elx/core/CoreSort.h> 00164 #include <elx/math/Ramp.h> 00165 #include <elx/image/PixelIterator.h> 00166 #include <boost/scoped_array.hpp> 00167 00168 #endif // __ImageOperatorsImpl_h__