eLynx SDK
v3.0.1 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, 00042 uint32 iChannelMask) const; 00043 00044 virtual bool ComputeMean( 00045 const AbstractImage& iImage, EBayerMatrix iBayer, 00046 double& oMeanR, double& oMeanG, double& oMeanB, 00047 bool ibNormalized) const; 00048 00049 virtual bool ComputeStandardDeviation( 00050 const AbstractImage& iImage, EBayerMatrix iBayer, 00051 double& oMeanR, double& oMeanG, double& oMeanB, 00052 double& oStdDevR, double& oStdDevG, double& oStdDevB, 00053 bool ibNormalized) const; 00054 00055 virtual bool Affine( 00056 AbstractImage& ioImage, EBayerMatrix iBayer, 00057 double iScaleR, double iOffsetR, 00058 double iScaleG, double iOffsetG, 00059 double iScaleB, double iOffsetB) const; 00060 00061 // specialization 00062 static boost::shared_ptr< ImageImpl< PixelRGB<T> > > CreateRGB( 00063 const ImageImpl< PixelL<T> >& iImageL, EBayerMatrix iBayer, 00064 EBayerToColorConversion iMethod=BCC_Default, 00065 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00066 00067 static boost::shared_ptr< ImageImpl< PixelL<T> > > CreateBayer( 00068 const ImageImpl< PixelRGB<T> >& iImage, 00069 EBayerMatrix iBayer = BM_GRBG, 00070 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00071 00072 static bool Balance( 00073 ImageImpl< PixelL<T> >& ioImage, EBayerMatrix iBayer, 00074 double iRed, double iGreen, double iBlue, 00075 uint32 iChannelMask); 00076 00077 static bool ComputeMean( 00078 const ImageImpl< PixelL<T> >& iImage, EBayerMatrix iBayer, 00079 double& oMeanR, double& oMeanG, double& oMeanB, 00080 bool ibNormalized=false); 00081 00082 static bool ComputeStandardDeviation( 00083 const ImageImpl< PixelL<T> >& iImage, EBayerMatrix iBayer, 00084 double& oMeanR, double& oMeanG, double& oMeanB, 00085 double& oStdDevR, double& oStdDevG, double& oStdDevB, 00086 bool ibNormalized=false); 00087 00088 static bool Affine( 00089 ImageImpl< PixelL<T> >& ioImage, EBayerMatrix iBayer, 00090 double iScaleR, double iOffsetR, 00091 double iScaleG, double iOffsetG, 00092 double iScaleB, double iOffsetB); 00093 }; 00094 00095 template <typename T, template <typename> class Pixel> 00096 boost::shared_ptr< ImageImpl< Pixel< typename ResolutionTypeTraits<T>::Floating_type > > > 00097 elxCreateFloatingExpanded(const ImageImpl< Pixel<T> >& iImage, uint32 iBorder); 00098 00099 } // namespace Image 00100 } // namespace eLynx 00101 00102 #endif // __BayerHandlerImpl_h__