Main Page | Namespace List | Compound List | File List | Compound Members | File Members

pfspdfe.h

Go to the documentation of this file.
00001 /*--------------------------------------------------------------------
00002  *
00003  * (C) Copyright Koninklijke Philips Electronics NV 2006. 
00004  * All rights reserved. This software is licensed under the terms of
00005  * version 2.1 of the GNU Lesser General Public License as published 
00006  * by the Free Software Foundation. For licensing and warranty
00007  * information, see the file COPYING in the main directory.
00008  *
00009  *------------------------------------------------------------------*/
00010 
00011 #ifndef PFSPDFE_H
00012 #define PFSPDFE_H
00013 
00014 #include "yapi.h"
00015 #include "vya.h"
00016 #include "cpfspd.h"
00017 
00018 #define PFSPD_BITS         8 // PFSPD uses 8 bits per pixel
00019 #define UV_OFFSET        128 // PFSPD expects U and V to range from 0..255
00020 #define Y_RGB_CVBS_MIN     0 // minimum Y value
00021 #define Y_RGB_CVBS_MAX   255 // maximum Y value
00022 #define UV_MIN          -128 // minimum UV value
00023 #define UV_MAX           127 // maximum UV value
00024 
00025 typedef unsigned char   byte;
00026 
00027 class pfspdFE : public VYAprocess
00028 {
00029 public:
00030     // constructor
00031     pfspdFE(
00032         const Id&             n,
00033         VYAbitPrecision       Y_RGB_CVBSoutPrecision,
00034         VYAbitPrecision       UVoutPrecision,
00035 
00036         In<VYAfileName>&      fileNameInF,
00037         In<pT_header>&        seqInfoInF,
00038         Out<VYApixel>&        Y_R_CVBSoutF,
00039         Out<VYApixel>&        U_GoutF,
00040         Out<VYApixel>&        V_BoutF,
00041         Out<VYAimageWidth>&   Y_RGBimgWidthOutF,
00042         Out<VYAimageHeight>&  Y_RGBimgHeightOutF,
00043         Out<VYAimageWidth>&   UVimgWidthOutF,
00044         Out<VYAimageHeight>&  UVimgHeightOutF,
00045         Out<VYAimageType>&    Y_YUV_RGBimgTypeOutF
00046     );
00047 
00048     //destructors
00049 
00050     //type member function
00051     const char* type() const { return "pfspdFE"; }
00052 
00053     //main member function
00054     void main ();
00055 
00056 private:
00057     // input ports
00058     InPort<VYAfileName>        fileNameInP;
00059     InPort<pT_header>          seqInfoInP;
00060 
00061     //output ports
00062     OutPort<VYApixel>          Y_R_CVBSoutP;
00063     OutPort<VYApixel>          U_GoutP;
00064     OutPort<VYApixel>          V_BoutP;
00065     OutPort<VYAimageWidth>     Y_RGBimgWidthOutP;
00066     OutPort<VYAimageHeight>    Y_RGBimgHeightOutP;
00067     OutPort<VYAimageWidth>     UVimgWidthOutP;
00068     OutPort<VYAimageHeight>    UVimgHeightOutP;
00069     OutPort<VYAimageType>      Y_YUV_RGBimgTypeOutP;
00070     
00071     // member variables
00072     VYAbitPrecision            Y_RGB_CVBSoutPrec, UVoutPrec;
00073     VYAfileName                fileNameIn;
00074 
00075     // member functions
00076     void checkSequenceInfo(int nrInFrames, int nrOutFrames, int startFrame);
00077     void printInfo(bool interlaced, pT_color colorFormat, int nrOutFrames,
00078             int Y_RGBframeWidth, int Y_RGBframeHeight,
00079             int Y_RGB_CVBSscaleFactor, int UVscaleFactor);
00080     void createLineBuffers(pT_color colorFormat,
00081             int Y_RGBimgWidth, int UVimgWidth,
00082             VYApixel **Y_R_CVBSbuf, VYApixel **U_Gbuf, VYApixel **V_Bbuf);
00083     void createImageBuffers(pT_color colorFormat,
00084             int Y_RGBimgWidth, int Y_RGBimgHeight,
00085             int UVimgWidth, int UVimgHeight,
00086             byte **CVBSbuf, byte **Ybuf, byte **Ubuf, byte **Vbuf, byte **UVbuf,
00087             byte **Rbuf, byte **Gbuf, byte **Bbuf);
00088     void deleteLineBuffers(pT_color colorFormat,
00089             VYApixel **Y_R_CVBSbuf, VYApixel **U_Gbuf, VYApixel **V_Bbuf);
00090     void deleteImageBuffers(pT_color colorFormat,
00091             byte **CVBSbuf, byte **Ybuf, byte **Ubuf, byte **Vbuf, byte **UVbuf,
00092             byte **Rbuf, byte **Gbuf, byte **Bbuf);
00093 };
00094 
00095 #endif

Generated on Wed Feb 15 14:52:43 2006 for pfspdfebe by doxygen 1.3.2