eLynx SDK
v3.3.0 C++ image processing API reference |
00001 //============================================================================ 00002 // BayerHandlerImpl.h Image.Component package 00003 //============================================================================ 00004 // Usage : Tool for Bayer matrix and demosaicing 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 __BayerHandlerImpl_h__ 00019 #define __BayerHandlerImpl_h__ 00020 00021 namespace eLynx { 00022 namespace Image { 00023 00024 template <typename T> 00025 class BayerHandlerImpl : public IBayerHandler 00026 { 00027 public: 00028 virtual boost::shared_ptr< AbstractImage > CreateRGB( 00029 const AbstractImage& iImage, 00030 EBayerMatrix iBayer, 00031 EBayerToColorConversion iMethod, 00032 ProgressNotifier& iNotifier) const; 00033 00034 virtual boost::shared_ptr< AbstractImage > CreateBayer( 00035 const AbstractImage& iImage, 00036 EBayerMatrix iBayer, 00037 ProgressNotifier& iNotifier) const; 00038 00039 virtual bool Balance( 00040 AbstractImage& ioImage, EBayerMatrix iBayer, 00041 double iRed, double iGreen, double iBlue) const; 00042 00043 virtual bool ComputeMean( 00044 const AbstractImage& iImage, EBayerMatrix iBayer, 00045 double& oMeanR, double& oMeanG, double& oMeanB, 00046 bool ibNormalized) const; 00047 00048 virtual bool ComputeStandardDeviation( 00049 const AbstractImage& iImage, EBayerMatrix iBayer, 00050 double& oMeanR, double& oMeanG, double& oMeanB, 00051 double& oStdDevR, double& oStdDevG, double& oStdDevB, 00052 bool ibNormalized) const; 00053 00054 virtual bool Affine( 00055 AbstractImage& ioImage, EBayerMatrix iBayer, 00056 double iScaleR, double iOffsetR, 00057 double iScaleG, double iOffsetG, 00058 double iScaleB, double iOffsetB) const; 00059 00060 // specialization 00061 static boost::shared_ptr< ImageImpl< PixelRGB<T> > > CreateRGB( 00062 const ImageImpl< PixelL<T> >& iImageL, EBayerMatrix iBayer, 00063 EBayerToColorConversion iMethod=BCC_Default, 00064 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00065 00066 static boost::shared_ptr< ImageImpl< PixelL<T> > > CreateBayer( 00067 const ImageImpl< PixelRGB<T> >& iImage, 00068 EBayerMatrix iBayer = BM_GRBG, 00069 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00070 00071 static bool Balance( 00072 ImageImpl< PixelL<T> >& ioImage, EBayerMatrix iBayer, 00073 double iRed, double iGreen, double iBlue); 00074 00075 static bool ComputeMean( 00076 const ImageImpl< PixelL<T> >& iImage, EBayerMatrix iBayer, 00077 double& oMeanR, double& oMeanG, double& oMeanB, 00078 bool ibNormalized=false); 00079 00080 static bool ComputeStandardDeviation( 00081 const ImageImpl< PixelL<T> >& iImage, EBayerMatrix iBayer, 00082 double& oMeanR, double& oMeanG, double& oMeanB, 00083 double& oStdDevR, double& oStdDevG, double& oStdDevB, 00084 bool ibNormalized=false); 00085 00086 static bool Affine( 00087 ImageImpl< PixelL<T> >& ioImage, EBayerMatrix iBayer, 00088 double iScaleR, double iOffsetR, 00089 double iScaleG, double iOffsetG, 00090 double iScaleB, double iOffsetB); 00091 }; 00092 00093 template <typename T, template <typename> class Pixel> 00094 boost::shared_ptr< ImageImpl< Pixel< typename ResolutionTypeTraits<T>::Floating_type > > > 00095 elxCreateFloatingExpanded(const ImageImpl< Pixel<T> >& iImage, uint32 iBorder); 00096 00097 } // namespace Image 00098 } // namespace eLynx 00099 00100 #endif // __BayerHandlerImpl_h__