eLynx SDK
v3.3.0 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 virtual bool AdjustBrightness(AbstractImage& ioImage, 00035 double iBrightness, 00036 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00037 00038 virtual bool AdjustContrast(AbstractImage& ioImage, 00039 double iContrast, 00040 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00041 00042 virtual bool AdjustGamma(AbstractImage& ioImage, 00043 double iGamma, 00044 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00045 00046 virtual bool AdjustBCG(AbstractImage& ioImage, 00047 double iBrightness, double iContrast, double iGamma, 00048 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00049 00050 virtual bool AdjustMidtone(AbstractImage& ioImage, 00051 double iMidtone, 00052 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00053 00054 virtual bool AdjustSigmoid(AbstractImage& ioImage, 00055 double iAlpha, double iBeta, 00056 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00057 00058 virtual bool AdjustHueSaturation(AbstractImage& ioImage, 00059 double iHue, double iSaturation, 00060 ProgressNotifier& iNotifier) const; 00061 00062 virtual bool AdjustShadowHighlight(AbstractImage& ioImage, 00063 double iShadow, double iHighlight, 00064 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00065 00066 virtual bool Balance(AbstractImage& ioImage, 00067 double iRed, double iGreen, double iBlue, 00068 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00069 00070 virtual bool Posterize(AbstractImage& ioImage, 00071 uint32 iLevels, 00072 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00073 00074 virtual bool Solarize(AbstractImage& ioImage, 00075 double iThreshold, 00076 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00077 00078 virtual bool Colorize(AbstractImage& ioImage, 00079 double iHue, double iSaturation, 00080 ProgressNotifier& iNotifier) const; 00081 00082 virtual bool Desaturate(AbstractImage& ioImage, 00083 double iFactor, 00084 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00085 00086 virtual bool Blend(AbstractImage& ioImage, 00087 const AbstractImage& iImage, 00088 double iScalar, 00089 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00090 00092 virtual boost::shared_ptr< AbstractImage > CreateBinarized( 00093 const AbstractImage& iImage, 00094 double iThreshold, bool ibNegative, 00095 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00097 00100 static bool AdjustBrightness(ImageImpl<Pixel>& ioImage, 00101 double iBrightness, 00102 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00103 00104 static bool AdjustContrast(ImageImpl<Pixel>& ioImage, 00105 double iContrast, 00106 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00107 00108 static bool AdjustGamma(ImageImpl<Pixel>& ioImage, 00109 double iGamma, 00110 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00111 00112 static bool AdjustBCG(ImageImpl<Pixel>& ioImage, 00113 double iBrightness, double iContrast, double iGamma, 00114 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00115 00116 static bool AdjustHue(ImageImpl<Pixel>& ioImage, 00117 double iHue, 00118 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00119 00120 static bool AdjustSaturation(ImageImpl<Pixel>& ioImage, 00121 double iSaturation, 00122 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00123 00124 static bool AdjustHueSaturation(ImageImpl<Pixel>& ioImage, 00125 double iHue, double iSaturation, 00126 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00127 00128 static bool AdjustShadowHighlight(ImageImpl<Pixel>& ioImage, 00129 double iShadow=0.0, double iHighlight=1.0, 00130 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00131 00132 static bool AdjustMidtone(ImageImpl<Pixel>& ioImage, 00133 double iMidtone, 00134 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00135 00136 static bool AdjustSigmoid(ImageImpl<Pixel>& ioImage, 00137 double iAlpha, double iBeta, 00138 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00139 00140 static bool Balance(ImageImpl<Pixel>& ioImage, 00141 double iChannel0, double iChannel1, double iChannel2, 00142 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00143 00144 static bool Posterize(ImageImpl<Pixel>& ioImage, 00145 uint32 iLevels, 00146 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00147 00148 static bool Solarize(ImageImpl<Pixel>& ioImage, 00149 double iThreshold, 00150 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00151 00152 static bool Colorize(ImageImpl<Pixel>& ioImage, 00153 double iHue, double iSaturation, 00154 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00155 00156 static bool Desaturate(ImageImpl<Pixel>& ioImage, 00157 double iFactor=0.3, 00158 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00159 00160 static bool Blend(ImageImpl<Pixel>& ioImage, 00161 const ImageImpl<Pixel>& iImage, 00162 double iScalar, 00163 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00165 }; 00166 00167 00168 //---------------------------------------------------------------------------- 00169 // elxCreateBinarized 00170 //---------------------------------------------------------------------------- 00171 template <typename T, template <typename> class Pixel> 00172 ExportedByImage 00173 boost::shared_ptr< ImageLub > 00174 elxCreateBinarized( 00175 const ImageImpl< Pixel<T> >& iImage, 00176 T iThreshold, bool ibNegative, 00177 uint32 iChannelMask, ProgressNotifier& iNotifier); 00178 00179 template <typename T> 00180 ExportedByImage 00181 boost::shared_ptr< ImageLub > 00182 elxCreateBinarized( 00183 const ImageImpl< PixelL<T> >& iImage, 00184 T iThreshold, bool ibNegative=false, 00185 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00186 00187 template <typename T> 00188 ExportedByImage 00189 boost::shared_ptr< ImageRGBub > 00190 elxCreateBinarized( 00191 const ImageImpl< PixelRGB<T> >& iImage, 00192 T iThreshold, bool ibNegative=false, 00193 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00194 00195 } // namespace Image 00196 } // namespace eLynx 00197 00198 #endif // __ImagePointProcessingImpl_h__