eLynx SDK
v3.0.1 C++ image processing API reference |
00001 //============================================================================ 00002 // ImageGlobalProcessingImpl.h Image.Component package 00003 //============================================================================ 00004 // Usage : implementation of basic global 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 __ImageGlobalProcessingImpl_h__ 00019 #define __ImageGlobalProcessingImpl_h__ 00020 00021 #include "IImageGlobalProcessing.h" 00022 #include <elx/image/ImageImpl.h> 00023 00024 namespace eLynx { 00025 namespace Image { 00026 00030 00031 template <class Pixel> 00032 class ExportedByImage ImageGlobalProcessingImpl : public IImageGlobalProcessing 00033 { 00034 public: 00035 typedef Pixel Pixel_t; 00036 00039 virtual bool Normalize(AbstractImage& ioImage, 00040 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00041 00042 virtual bool EqualizeHistogram(AbstractImage& ioImage, 00043 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00044 00045 virtual bool AutoBrightness(AbstractImage& ioImage, 00046 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00047 00048 virtual bool AutoContrast(AbstractImage& ioImage, 00049 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00050 00051 virtual bool AutoColor(AbstractImage& ioImage, 00052 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00053 00054 virtual bool AutoBalance(AbstractImage& ioImage, 00055 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00056 00057 virtual bool DeconvolveRL(AbstractImage& ioImage, 00058 const IImagePSF &iPSF, uint32 iIterations, EBorderFill iBorder, 00059 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00060 00061 virtual bool ApplyFFT(AbstractImage& ioImage, 00062 const AbstractImage& iFilter, 00063 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00064 00065 virtual bool ApplyFFTLowPass(AbstractImage& ioImage, 00066 double iCutoff=0.5, uint32 iRank=2, 00067 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00069 00071 static bool Normalize(ImageImpl<Pixel>& ioImage, 00072 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00073 00074 static bool EqualizeHistogram(ImageImpl<Pixel>& ioImage, 00075 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00076 00077 static bool AutoBrightness(ImageImpl<Pixel>& ioImage, 00078 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00079 00080 static bool DeconvolveRL(ImageImpl<Pixel>& ioImage, 00081 const IImagePSF &iPSF, uint32 iIterations, EBorderFill iBorder, 00082 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier = ProgressNotifier_NULL); 00083 00084 static bool ApplyFFT(ImageImpl<Pixel>& ioImage, 00085 const ImageImpl< PixelL<typename ResolutionTypeTraits<typename Pixel::type>::Floating_type> >& iFilter, 00086 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00087 00088 static bool ApplyFFTLowPass(ImageImpl<Pixel>& ioImage, 00089 double iCutoff=0.5, uint32 iRank=2, 00090 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00091 00093 /* 00094 private: 00095 00096 static bool ConvolveWithPSF(ImageImpl<Pixel> &ioImage, 00097 const IImagePSF &iPSF, uint32 &ioProgress, uint32 iTotalProgress, 00098 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier = ProgressNotifier_NULL); 00099 00100 static void ConvolvePixelWithPSF(const ImageImpl<Pixel> &iImage, 00101 const IImagePSF &iPSF, uint32 iX, uint32 iY, uint32 iChannelMask, Pixel &result); 00102 00104 static void DivideBy(const ImageImpl<Pixel> &iImage1, ImageImpl<Pixel> &ioImage2, 00105 uint32 iChannelMask); 00106 00108 static void MultiplyBy(ImageImpl<Pixel> &ioImage1, const ImageImpl<Pixel> &iImage2, 00109 uint32 iChannelMask); 00110 */ 00111 }; 00112 00113 // should be in LocalToPoint / ConvolvePSF.inl 00114 // should be rename as Convolve 00115 // uint32 iTotalProgress should be removed 00116 template <class Pixel> 00117 bool elxConvolveWithPSF( 00118 ImageImpl<Pixel> &ioImage, 00119 const IImagePSF &iPSF, uint32 &ioProgress, 00120 uint32 iTotalProgress, 00121 EBorderFill iBorder, 00122 uint32 iChannelMask, 00123 ProgressNotifier& iNotifier); 00124 00125 //---------------------------------------------------------------------------- 00126 // 00127 // should be in LocalToPoint / ConvolvePSF.inl 00128 template <class Pixel> 00129 void elxConvolvePixelWithPSF( 00130 const ImageImpl<Pixel> &iImage, 00131 const IImagePSF &iPSF, 00132 uint32 iX, uint32 iY, 00133 uint32 iChannelMask, 00134 Pixel & oResult); 00135 00136 } // namespace Image 00137 } // namespace eLynx 00138 00139 #endif // __ImageGlobalProcessingImpl_h__