eLynx SDK
v3.0.1 C++ image processing API reference |
00001 //============================================================================ 00002 // ImagePointProcessingImpl.h Image.Component package 00003 //============================================================================ 00004 // Usage : implementation of basic point 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 __ImagePointProcessingImpl_h__ 00019 #define __ImagePointProcessingImpl_h__ 00020 00021 #include <elx/image/IImagePointProcessing.h> 00022 #include <elx/image/ImageImpl.h> 00023 00024 namespace eLynx { 00025 namespace Image { 00026 00030 template <class Pixel> 00031 class ExportedByImage ImagePointProcessingImpl : public IImagePointProcessing 00032 { 00033 public: 00034 typedef Pixel Pixel_t; 00035 00036 virtual bool AdjustBrightness(AbstractImage& ioImage, 00037 double iBrightness, 00038 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00039 00040 virtual bool AdjustContrast(AbstractImage& ioImage, 00041 double iContrast, 00042 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00043 00044 virtual bool AdjustGamma(AbstractImage& ioImage, 00045 double iGamma, 00046 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00047 00048 virtual bool AdjustBCG(AbstractImage& ioImage, 00049 double iBrightness, double iContrast, double iGamma, 00050 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00051 00052 virtual bool AdjustMidtone(AbstractImage& ioImage, 00053 double iMidtone, 00054 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00055 00056 virtual bool AdjustSigmoid(AbstractImage& ioImage, 00057 double iAlpha, double iBeta, 00058 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00059 00060 virtual bool AdjustHueSaturation(AbstractImage& ioImage, 00061 double iHue, double iSaturation, ProgressNotifier& iNotifier) const; 00062 00063 virtual bool Balance(AbstractImage& ioImage, 00064 double iChannel0, double iChannel1, double iChannel2, 00065 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00066 00067 virtual bool Posterize(AbstractImage& ioImage, 00068 uint32 iLevels, 00069 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00070 00071 virtual bool Solarize(AbstractImage& ioImage, 00072 double iThreshold, 00073 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00074 00075 virtual bool Colorize(AbstractImage& ioImage, 00076 double iHue, double iSaturation, 00077 ProgressNotifier& iNotifier) const; 00078 00079 virtual bool Desaturate(AbstractImage& ioImage, 00080 double iFactor, 00081 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00082 00083 virtual bool Blend(AbstractImage& ioImage, 00084 const AbstractImage& iImage, 00085 double iScalar, 00086 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00087 00089 virtual boost::shared_ptr< AbstractImage > CreateBinarized( 00090 const AbstractImage& iImage, 00091 double iThreshold, bool ibNegative, 00092 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00094 00097 static bool AdjustBrightness(ImageImpl<Pixel>& ioImage, 00098 double iBrightness, 00099 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00100 00101 static bool AdjustContrast(ImageImpl<Pixel>& ioImage, 00102 double iContrast, 00103 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00104 00105 static bool AdjustGamma(ImageImpl<Pixel>& ioImage, 00106 double iGamma, 00107 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00108 00109 static bool AdjustBCG(ImageImpl<Pixel>& ioImage, 00110 double iBrightness, double iContrast, double iGamma, 00111 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00112 00113 static bool AdjustHue(ImageImpl<Pixel>& ioImage, 00114 double iHue, 00115 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00116 00117 static bool AdjustSaturation(ImageImpl<Pixel>& ioImage, 00118 double iSaturation, 00119 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00120 00121 static bool AdjustHueSaturation(ImageImpl<Pixel>& ioImage, 00122 double iHue, double iSaturation, 00123 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00124 00125 static bool AdjustMidtone(ImageImpl<Pixel>& ioImage, 00126 double iMidtone, 00127 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00128 00129 static bool AdjustSigmoid(ImageImpl<Pixel>& ioImage, 00130 double iAlpha, double iBeta, 00131 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00132 00133 static bool Balance(ImageImpl<Pixel>& ioImage, 00134 double iChannel0, double iChannel1, double iChannel2, 00135 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00136 00137 static bool Posterize(ImageImpl<Pixel>& ioImage, 00138 uint32 iLevels, 00139 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00140 00141 static bool Solarize(ImageImpl<Pixel>& ioImage, 00142 double iThreshold, 00143 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00144 00145 static bool Colorize(ImageImpl<Pixel>& ioImage, 00146 double iHue, double iSaturation, 00147 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00148 00149 static bool Desaturate(ImageImpl<Pixel>& ioImage, 00150 double iFactor=0.3, 00151 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00152 00153 static bool Blend(ImageImpl<Pixel>& ioImage, 00154 const ImageImpl<Pixel>& iImage, 00155 double iScalar, 00156 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00158 }; 00159 00160 00161 //---------------------------------------------------------------------------- 00162 // elxCreateBinarized 00163 //---------------------------------------------------------------------------- 00164 template <typename T, template <typename> class Pixel> 00165 ExportedByImage 00166 boost::shared_ptr< ImageLub > 00167 elxCreateBinarized( 00168 const ImageImpl< Pixel<T> >& iImage, 00169 double iThreshold, bool ibNegative, 00170 uint32 iChannelMask, ProgressNotifier& iNotifier); 00171 00172 template <typename T> 00173 ExportedByImage 00174 boost::shared_ptr< ImageLub > 00175 elxCreateBinarized( 00176 const ImageImpl< PixelL<T> >& iImage, 00177 double iThreshold, bool ibNegative=false, 00178 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00179 00180 template <typename T> 00181 ExportedByImage 00182 boost::shared_ptr< ImageRGBub > 00183 elxCreateBinarized( 00184 const ImageImpl< PixelRGB<T> >& iImage, 00185 double iThreshold, bool ibNegative=false, 00186 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00187 00188 } // namespace Image 00189 } // namespace eLynx 00190 00191 #endif // __ImagePointProcessingImpl_h__