Main Page   Compound List   File List   Compound Members  

imagetools.H

00001 #ifndef _IMAGETOOLS_H
00002 #define _IMAGETOOLS_H
00003 #include "image.H"
00054 
00073 enum TypeConv8bits { NORMAL, LN1, VAR1,SCALE,VAR2, EGAL, EXP, LOG, EXPINV,LOGINV, SIN, COS };
00074 
00087 enum YUVTransfo { NOSPEC=0, ITU709, UNSPEC, RESERVED, FCC, ITU6244, SMPTE170M, SMPTE240M };
00088 
00097 enum YUVSize { S420=0, S422, S444};
00099 
00103 #define octet unsigned char
00104 
00106 class RGB {
00107 public:
00109   RGB():R(0),G(0),B(0) {};
00110 
00115   RGB(octet r,octet g,octet b):R(r),G(g),B(b) {};
00116 
00119   RGB(octet gris):R(gris),G(gris),B(gris) {};
00120 
00124   inline RGB & operator=(const RGB &pix) { R=pix.R; G=pix.G; B=pix.B; return(*this); };
00125 
00127   octet R;
00128 
00130   octet G;
00131 
00133   octet B;
00134 };
00136 
00138 template <class T>
00139 class ImageTools {
00140 public:
00141 
00149   static T bilinear(const Image<T> &image,const double yy,const double xx);
00150 
00154   static T getMax(const Image<T> &image);
00155 
00160   static double getPSNR(const Image<T> &image1,const Image<T> &image2);
00161 
00164   static void compacte(Image<T> &image);
00165 
00169   static void dilate(Image<T> &in_image,const int taille);
00170 
00176   static Image<octet> convertTo8bits(const Image<T> &image1,const TypeConv8bits type=NORMAL,const double param=1.);
00177 
00182   static Image<octet> functionHisto(const Image<T> &image1,const TypeConv8bits type=EGAL);
00183 
00193   static void RGBtoYUV(const Image<T> &ima, float *&imay,float *&imau,float *&imav,int &h,int &w,YUVSize size=S420,YUVTransfo typetransfo=SMPTE170M) {exit(-1);}; // vide par defaut
00194 
00203   static Image<T> YUVtoRGB(const float *const imay,const float *const imau,const float *const imav,
00204                            const int h,const int w,
00205                            YUVTransfo typetransfo=SMPTE170M,YUVSize size=S420) {
00206     exit(-1);
00207     return(Image<T>(0,0));
00208   };
00210 };
00212 
00213 #include "imagetools.cpp"
00214 
00215 #endif

Generated on Wed Sep 10 17:07:05 2003 by doxygen1.3-rc2