Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

VideoScaler.h

Go to the documentation of this file.
00001 // VideoScaler.h - interface of class VideoScaler
00002 //
00003 // Copyright (c) 2003, Roku, LLC.
00004 //
00006 
00007 #ifndef _ROKU_INCLUDE_DESCHUTES_LIBRARIES_HDMACHINEX225_VIDEOSCALER_H
00008 #define _ROKU_INCLUDE_DESCHUTES_LIBRARIES_HDMACHINEX225_VIDEOSCALER_H
00009 
00010 #include <cascade/graphics/CascadeRect.h>
00011 #include <cascade/graphics/CascadeDims.h>
00012 
00014 // class VideoScaler
00015 class VideoScaler
00016 {
00017 public: 
00018     VideoScaler();
00019     virtual ~VideoScaler();
00020 
00021 public:
00022     typedef enum ScalerColorFormat
00023     {
00024         kColorFormatInvalid     = -1,
00025         kColorFormatARGB888     = 0,
00026         kColorFormatARGB4888    = 1,
00027         kColorFormatARGB4444    = 2,
00028         kColorFormatARGB1555    = 3,
00029         kColorFormatRGB565      = 4,
00030         kColorFormatARGB8888_32 = 6,
00031         kColorFormatVYUY422     = 11,
00032         kColorFormatYVYU422     = 12,
00033         kColorFormatYOverV      = 13,
00034         kColorFormatVBID_Raw    = 20
00035     };
00036 
00037     bool Open( ScalerColorFormat format = kColorFormatVYUY422 );
00038         // scaler is opened disabled
00039         // only open the scaler when you are about to use it.
00040         // scaler defaults to VYUY422 color
00041 
00042     bool Close();
00043         // scaler is closed
00044         // close the scaler as soon as you are done with it so it can be used 
00045         // by other clients.
00046 
00047     bool IsOpen();
00048         // returns true if scaler is open
00049 
00050     bool SetSourceWindow(const CascadeDims & sourceWindowDims, 
00051                          u32 & outPitch );
00052         // sets the source window dimensions, returning the scaler's required
00053         // pitch.  You must allocate video memory whose line width (in pixels)
00054         // is the pitch, or the scaler won't function correctly.  Allocate
00055         // that memory by calling AllocateScalerVRAM, then pass the resulting
00056         // pointer to SetSourceVRAM()
00057 
00058     bool SetSourceVRAM( u8 * pVRAMSourceWindow );
00059         // sets the memory location from which the scaler is to read.  You
00060         // should call SetSourceWindow() first to get the pitch, then
00061         // AllocateScalerVRAM(), then pass the allocated pointer in here.
00062 
00063     bool SetDestWindow(const CascadeRect & destWindowRect, 
00064                        bool bPreserveAspectRatio);
00065         // sets the scaler's dest window to destWindowRect
00066 
00067     bool SetCropWindow(const CascadeRect & cropWindowRect);
00068         // sets the scaler's crop window to cropWindowRect
00069 
00070     typedef enum ScalerColorConversionFormat
00071     {
00072         kColorConversionInvalid = 0,
00073         kColorConversionRGB,
00074         kColorConversionYCbCr709,
00075         kColorConversionYCbCr601,
00076         kColorConversionYCbCr240,
00077         kColorConversionYCbCr444
00078     };
00079 
00080     bool SetSourceColorConversionFormat( ScalerColorConversionFormat format );
00081         // sets the scaler's color converter source format
00082     
00083     u8 * AllocateScalerVRAM(u32 nBytes);
00084         // returns pointer to newly allocated video memory for use in 
00085         // SetSourceWindow
00086     
00087     bool FreeScalerVRAM(u8 * pVRAM);
00088         // frees previously allocated scaler memory
00089 
00090     typedef enum ScalerBlendMode
00091     {
00092         kBlendModeAdd,
00093         kBlendModeMultiply
00094     };
00095 
00096     bool Show( ScalerBlendMode mode = kBlendModeMultiply );
00097         // shows an open scaler, setting the blend mode of the 
00098         // GUI overlay to the specified blend.  Multiply is recommended
00099         // when compositing onto video.
00100 
00101     bool Hide();
00102         // hides an open scaler
00103     
00104     bool IsShowing();
00105         // returns true if open scaler is enabled
00106 
00107 private:
00108     void * m_pScalerInternal;
00109 };
00110 
00111 #endif // #ifndef _ROKU_INCLUDE_DESCHUTES_LIBRARIES_HDMACHINEX225_VIDEOSCALER_H
00112 
00114 //  LOG
00116 //  29-Jun-03   dwoodward   created
00117 //  02-Jul-03   mjkobb      Modified SetSourceWindow and added SetSourceVRAM,
00118 //                          to take into account the pitch requirements
00119 //                          of the scaler
00120 //  21-Aug-03   mjkobb      Added SetSourceColorFormat
00121 //  11-Dec-03   mjkobb      Rename Enable/Disable as Show/Hide.
00122 //                          Move alpha mode setting to Show/Hide.
00123 //                          Make Open take a parameter for the source format.
00124 //                          Make Show take a blend mode.
00125 //                          Rename source color conversion functions & enum

Generated on Sun Jul 24 14:27:17 2005 for Cascade Library by  doxygen 1.4.1