Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

algorithm.hh

00001 /*
00002  * PIAVE - PIAVE Is A Video Editor
00003  *
00004  * Copyright (C) 2002 Rolf Dubitzky, rolf@dubitzky.de
00005  */
00006 
00007 /*
00008  * This program is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * This program 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.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software Foundation,
00020  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00021  */
00022 
00037 #if ! defined ( ALGORITHM_HH )
00038 #define ALGORITHM_HH
00039 
00040 // std c
00041 #include <stdint.h>
00042 
00043 // std c++
00044 
00045 // PIAVE
00046 
00047 namespace PIAVE {
00048 
00049     class Color;
00050 
00051     /*   \class Algorithm this is a collection of usefull algorithms
00052      *   for video scaling and colorspace conversion Algorithm defines
00053      *   the interface which has a reference implementation in
00054      *   C(++). At some point there should be other implementations
00055      *   for specific architectures like MMX 3DNOW, SSE, SSE2,
00056      *   AltiVec, you name it.  Those can inherit Algorithm_C if they
00057      *   don't implement all functions.
00058      *
00059      *   It is also possible to mplement _fast and/or _good versions
00060      *   of the algoritms.
00061      */
00062 
00063     class Algorithm 
00064     {
00065       public:
00066         /*
00067          *     color spaces
00068          */
00069         virtual Color RGB2YCbCr( Color rgb ) const = 0;
00070 
00071         /*
00072          *     Algos on frames FRAMES
00073          */
00074         virtual int yuyv2yuyv( int x_src,  int y_src,  uint8_t * src,
00075                                int x_dest, int y_dest, uint8_t * dest) const = 0;
00076         virtual int rgb242yuyv( int x_src,  int y_src,  uint8_t * src,
00077                                 int x_dest, int y_dest, uint8_t * dest) const = 0;
00078 
00079     };
00080 
00081 
00082     class Algorithm_C : public Algorithm
00083     {
00084       public:
00085         Algorithm_C();
00086 
00087         virtual Color RGB2YCbCr( Color rgb ) const;
00088 
00089         virtual int yuyv2yuyv( int x_src,  int y_src,  uint8_t * src,
00090                                int x_dest, int y_dest, uint8_t * dest) const;
00091         virtual int rgb242yuyv( int x_src,  int y_src,  uint8_t * src,
00092                                 int x_dest, int y_dest, uint8_t * dest) const;
00093 
00094       private:
00095         void init_RGB2YCbCr();
00096 
00097         static int32_t RGBYCbCr02570[256], RGBYCbCr05040[256], RGBYCbCr00980[256];
00098         static int32_t RGBYCbCr01480[256], RGBYCbCr02910[256], RGBYCbCr04390[256];
00099         static int32_t RGBYCbCr03680[256], RGBYCbCr00710[256];
00100 
00101     };
00102 
00103 
00104 };
00105 
00106 #endif 

Generated on Tue Oct 14 20:45:36 2003 for piave by doxygen1.2.18