eLynx SDK
v3.3.0 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: 00037 virtual bool Normalize(AbstractImage& ioImage, 00038 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00039 00040 virtual bool EqualizeHistogram(AbstractImage& ioImage, 00041 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00042 00043 virtual bool AutoBrightness(AbstractImage& ioImage, 00044 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00045 00046 virtual bool AutoContrast(AbstractImage& ioImage, 00047 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00048 00049 virtual bool AutoColor(AbstractImage& ioImage, 00050 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00051 00052 virtual bool AutoBalance(AbstractImage& ioImage, 00053 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00054 00055 virtual bool DeconvolveRL(AbstractImage& ioImage, 00056 const IImagePSF &iPSF, uint32 iIterations, EBorderFill iBorder, 00057 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00058 00059 virtual bool ApplyFFT(AbstractImage& ioImage, 00060 const AbstractImage& iFilter, 00061 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00062 00063 virtual bool ApplyFFTLowPass(AbstractImage& ioImage, 00064 double iCutoff=0.5, uint32 iRank=2, 00065 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00067 00069 static bool Normalize(ImageImpl<Pixel>& ioImage, 00070 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00071 00072 static bool EqualizeHistogram(ImageImpl<Pixel>& ioImage, 00073 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00074 00075 static bool AutoBrightness(ImageImpl<Pixel>& ioImage, 00076 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00077 00078 static bool DeconvolveRL(ImageImpl<Pixel>& ioImage, 00079 const IImagePSF &iPSF, uint32 iIterations, EBorderFill iBorder, 00080 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier = ProgressNotifier_NULL); 00081 00082 static bool ApplyFFT(ImageImpl<Pixel>& ioImage, 00083 const ImageImpl< PixelL<typename ResolutionTypeTraits<typename Pixel::type>::Floating_type> >& iFilter, 00084 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00085 00086 static bool ApplyFFTLowPass(ImageImpl<Pixel>& ioImage, 00087 double iCutoff=0.5, uint32 iRank=2, 00088 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00089 00091 /* 00092 private: 00093 00094 static bool ConvolveWithPSF(ImageImpl<Pixel> &ioImage, 00095 const IImagePSF &iPSF, uint32 &ioProgress, uint32 iTotalProgress, 00096 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier = ProgressNotifier_NULL); 00097 00098 static void ConvolvePixelWithPSF(const ImageImpl<Pixel> &iImage, 00099 const IImagePSF &iPSF, uint32 iX, uint32 iY, uint32 iChannelMask, Pixel &result); 00100 00102 static void DivideBy(const ImageImpl<Pixel> &iImage1, ImageImpl<Pixel> &ioImage2, 00103 uint32 iChannelMask); 00104 00106 static void MultiplyBy(ImageImpl<Pixel> &ioImage1, const ImageImpl<Pixel> &iImage2, 00107 uint32 iChannelMask); 00108 */ 00109 }; 00110 00111 // should be in LocalToPoint / ConvolvePSF.inl 00112 // should be rename as Convolve 00113 // uint32 iTotalProgress should be removed 00114 template <class Pixel> 00115 bool elxConvolveWithPSF( 00116 ImageImpl<Pixel> &ioImage, 00117 const IImagePSF &iPSF, uint32 &ioProgress, 00118 uint32 iTotalProgress, 00119 EBorderFill iBorder, 00120 uint32 iChannelMask, 00121 ProgressNotifier& iNotifier); 00122 00123 //---------------------------------------------------------------------------- 00124 // 00125 // should be in LocalToPoint / ConvolvePSF.inl 00126 template <class Pixel> 00127 void elxConvolvePixelWithPSF( 00128 const ImageImpl<Pixel> &iImage, 00129 const IImagePSF &iPSF, 00130 uint32 iX, uint32 iY, 00131 uint32 iChannelMask, 00132 Pixel & oResult); 00133 00134 } // namespace Image 00135 } // namespace eLynx 00136 00137 #endif // __ImageGlobalProcessingImpl_h__