eLynx SDK
v3.0.1 C++ image processing API reference |
00001 //============================================================================ 00002 // ImageLocalProcessingImpl.h Image.Component package 00003 //============================================================================ 00004 // Usage : implementation of basic local to point image processing 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 __ImageLocalProcessingImpl_h__ 00019 #define __ImageLocalProcessingImpl_h__ 00020 00021 #include <elx/image/IImageLocalProcessing.h> 00022 00023 namespace eLynx { 00024 namespace Image { 00025 00029 00030 template <class Pixel> 00031 class ExportedByImage ImageLocalProcessingImpl : public IImageLocalProcessing 00032 { 00033 public: 00034 typedef Pixel Pixel_t; 00035 00038 virtual bool Convolve(AbstractImage& ioImage, 00039 const Math::ConvolutionKerneld& iKernel, 00040 bool ibAbsolute, EBorderFill iBorder, uint32 iIteration, 00041 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00042 00043 virtual bool Convolve(AbstractImage& ioImage, 00044 const Math::ConvolutionKerneld& iKernel, 00045 double iThresholdMin, double iThresholdMax, 00046 bool ibAbsolute, EBorderFill iBorder, uint32 iIteration, 00047 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00048 00049 virtual bool Convolve(AbstractImage& ioImage, 00050 const Math::ConvolutionKerneld& iKernel1, 00051 const Math::ConvolutionKerneld& iKernel2, 00052 EBorderFill iBorder, uint32 iIteration, 00053 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00054 00055 virtual bool ApplyGaussian(AbstractImage& ioImage, 00056 double iRadius, 00057 EBorderFill iBorder, uint32 iIteration, 00058 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00059 00060 virtual bool ApplyGaussian(AbstractImage& ioImage, 00061 double iRadius, double iVariance, 00062 EBorderFill iBorder, uint32 iIteration, 00063 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00064 00065 virtual bool ApplyGaussian(AbstractImage& ioImage, 00066 uint32 iWidth, uint32 iHeight, double iVariance, 00067 EBorderFill iBorder, uint32 iIteration, 00068 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00069 00070 virtual bool ApplyBoxBlur(AbstractImage& ioImage, 00071 uint32 iWidth, uint32 iHeight, 00072 EBorderFill iBorder, uint32 iIteration, 00073 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00074 00075 virtual bool ApplySelectiveBlur(AbstractImage& ioImage, 00076 EBorderFill iBorder, uint32 iIteration, 00077 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00078 00079 virtual bool ApplyBilateral(AbstractImage& ioImage, 00080 double iRadius, double iSigmaSpatial, double iSigmaRange, 00081 EBorderFill iBorder, uint32 iIteration, 00082 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00083 00084 virtual bool RemoveIsolated(AbstractImage& ioImage, 00085 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00086 00088 00091 // ---- specialized 3x3 00092 static bool Convolve3x3(ImageImpl<Pixel>& ioImage, 00093 const Math::ConvolutionKerneld& iKernel, 00094 double iThresholdMin=0.0, double iThresholdMax=1.0, 00095 bool ibAbsolute=false, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 00096 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00097 00098 // ---- specialized 5x5 00099 static bool Convolve5x5(ImageImpl<Pixel>& ioImage, 00100 const Math::ConvolutionKerneld& iKernel, 00101 double iThresholdMin=0.0, double iThresholdMax=1.0, 00102 bool ibAbsolute=false, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 00103 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00104 00105 // ---- specialized WxH 00106 static bool ConvolveWxH(ImageImpl<Pixel>& ioImage, 00107 const Math::ConvolutionKerneld& iKernel, 00108 double iThresholdMin=0.0, double iThresholdMax=1.0, 00109 bool ibAbsolute=false, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 00110 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00111 00112 // ---- optimized generic 00113 static bool Convolve(ImageImpl<Pixel>& ioImage, 00114 const Math::ConvolutionKerneld& iKernel, 00115 double iThresholdMin=0.0, double iThresholdMax=1.0, 00116 bool ibAbsolute=false, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 00117 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00118 00119 // ---- separables kernels 00120 static bool Convolve(ImageImpl<Pixel>& ioImage, 00121 const Math::ConvolutionKerneld& iKernel1, 00122 const Math::ConvolutionKerneld& iKernel2, 00123 EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 00124 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00125 00126 static bool ApplyBoxBlur(ImageImpl<Pixel>& ioImage, 00127 uint32 iWidth, uint32 iHeight, 00128 EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 00129 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00130 00131 static bool ApplySelectiveBlur(ImageImpl<Pixel>& ioImage, 00132 EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 00133 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00134 00135 static bool ApplyGaussian(ImageImpl<Pixel>& ioImage, 00136 double iRadius=1.5, 00137 EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 00138 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00139 00140 static bool ApplyGaussian(ImageImpl<Pixel>& ioImage, 00141 double iRadius, double iVariance, 00142 EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 00143 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00144 00145 static bool ApplyGaussian(ImageImpl<Pixel>& ioImage, 00146 uint32 iWidth, uint32 iHeight, double iVariance, 00147 EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 00148 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00149 00150 static bool ApplyBilateral(ImageImpl<Pixel>& ioImage, 00151 double iRadius=2.5, double iSigmaSpatial=1.0, double iSigmaRange=1.0, 00152 EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 00153 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00154 00155 static bool RemoveIsolated(ImageImpl<Pixel>& ioImage, 00156 uint32 iChannelMask, ProgressNotifier& iNotifier); 00157 00159 }; 00160 00161 } // namespace Image 00162 } // namespace eLynx 00163 00164 #endif // __ImageLocalProcessingImpl_h__