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

CascadeScreen.h

Go to the documentation of this file.
00001 //
00002 // CascadeScreen.h - header file for class CascadeScreen
00003 //
00004 // Copyright (c) 2003, Roku, LLC.  All rights reserved.
00005 //
00008 
00009 #ifndef _ROKU_INCLUDE_CASCADE_GRAPHICS_CASCADESCREEN_H
00010 #define _ROKU_INCLUDE_CASCADE_GRAPHICS_CASCADESCREEN_H
00011 
00012 #include <cascade/graphics/CascadeBitmap.h>
00013 
00015 // class CascadeScreen
00016 /*
00017 */
00018 
00050 class CascadeScreen : public CascadeBitmap
00051 {
00052 public:
00053         CascadeScreen();
00057     virtual ~CascadeScreen();
00061 public:
00062     virtual void LockScreen();
00068     virtual void UnlockScreen();
00074 
00075 public:
00076     enum VideoConnector {
00077         kVGA            = 0, 
00078         kComponent      = 1, 
00079         kSVideo         = 2, 
00080         kComposite      = 3,  
00081         kNumConnectors = kComposite + 1,
00082     };
00088     
00089     enum VideoMode {
00090         kNTSC           = 0, 
00091         kPAL        = 1, 
00092         kRGB        = 2, 
00093         kNumModes = kRGB + 1,
00094     };
00100 
00101 public:
00102     virtual bool SetScreenResolution(u32 index);
00120     virtual void GetCurrentScreenResolution(u32 & index);
00128     virtual u32 GetNumScreenResolutionsSupported();
00137     virtual bool GetSupportedScreenResolutionAt(u32 nIndex, u32 & nWidthToSet, u32 & nHeightToSet, u8 & nBitDepthToSet, bool & bDoubleBufferedToSet);
00151     virtual void SwapBuffers(const CascadeRect & afterSwapCopyRect);
00163     virtual bool SetOutputResolution(u32 nIndex);
00179     virtual void GetCurrentOutputResolution(u32 & nIndexToSet);
00187     virtual u32 GetNumOutputResolutionsSupported();
00196     virtual bool GetSupportedOutputResolutionAt(u32 nIndex, u32 & nWidthToSet, u32 & nHeightToSet, bool & bProgressiveToSet, VideoConnector & connectorToSet, VideoMode & modeToSet, u32 & nRefreshRateToSet);
00212     virtual bool GetOutputResolutionScaleRect(u32 nIndex, CascadeRect & scaleRectToSet);
00226     virtual bool SetOutputResolutionScaleRect(u32 nIndex, const CascadeRect & scaleRect);
00241     virtual bool WaitForVBILineZero();
00248 public:
00249     virtual bool SetBypassMode(bool bBypass);
00258     virtual bool GetBypassMode();
00264 public: // virtual member functions from CascadeBitmap overridden and shanghai'd directly
00265     virtual bool Create(const CascadeDims & dims, CascadeBitmap::RamType = CascadeBitmap::kEither) { return false; }
00270     virtual bool CreateFromBitmapFile(CascadeFile & bitmapFile, CascadeBitmap::RamType = CascadeBitmap::kEither) { return false; }
00275     virtual bool Destroy() { return false; }
00280 public: // drawing and info functions overridden from CascadeBitmap
00281     virtual void FrameRect(const CascadeRect & rect, const CascadeColor & color );
00282     virtual void FillRect(const CascadeRect & rect, const CascadeColor & color);
00283     virtual void DrawLine(const CascadePoint & start, const CascadePoint & end, const CascadeColor & color);
00284     virtual void TextOut(const CascadePoint & point, const CascadeString & string, const CascadeFont & font, const CascadeColor & color, u32 nFlags = TEXTOUT_TOP);
00285         virtual bool DrawText(CascadeFont & font, const CascadeRect & rect, const CascadeString & string, const CascadeColor & color, u32 nFlags);
00286     virtual void Blit(const CascadePoint & point, const CascadeBitmap & source, const CascadeRect & sourceRect);
00287     virtual void Blit(
00288         const CascadePoint & point,
00289         CascadeSharedMemZone & sourceZone,
00290         u32 nZoneOffset,
00291         u32 nPixelWidth,
00292         u32 nPixelHeight,
00293         u32 nBitDepth,
00294         const CascadeRect & sourceRect);
00295         // This version of blit operates on a source bitmap that is contained in a CascadeSharedMemZone
00296         // and defined by the following parameters:
00297         // nZoneOffset - the byte offset from the start of the zone where the bitmap bits start
00298         // nPixelWidth - the width in pixels of the source bitmap
00299         // nPixelHeight - the height in pixels of the source bitmap
00300         // nBitDepth - the number of bits per pixel of the bits in the source bitmap
00301         // NOTE NOTE NOTE:  Currently the only pixel format supported
00302         //                  is 32bpp RGBA.
00303         // NOTE the CascadeSharedMemZone passed in as sourceZone must be an Open() zone, but not MapLocked().
00304     virtual bool GrabBits(const CascadeRect & sourceRect, CascadeSharedMemZone & destZone, u32 nZoneOffset);
00305     virtual void GetPixel(const CascadePoint & point, CascadeColor & colorToSet) const;
00306     virtual void SetPixel(const CascadePoint & point, const CascadeColor & color);
00307     virtual CascadeDims GetDims() const;
00308     virtual u8 GetColorDepth() const;
00309     virtual void Flush();
00310         // These functions are overridden from base class versions in CascadeBitmap.
00311         // See CascadeBitmap for their descriptions.
00312     virtual void * GetMemory();
00344 private:
00345     virtual void * AcquireDriverObject() const; // not really const but I know what I'm doing
00346     virtual void   ReleaseDriverObject() const; // not really const but I know what I'm doing
00347 
00348 private:
00349     void * m_pScreenInternal;
00350 };
00351 
00352 #endif // #ifndef _ROKU_INCLUDE_CASCADE_GRAPHICS_CASCADESCREEN_H
00353 
00355 //  LOG
00357 //  20-Jan-03   dwoodward       created
00358 //  20-Jan-03   dwoodward       1.0 STATUS: 100% complete
00359 //  27-Jan-03   dwoodward   added AcquireDriverObject and ReleaseDriverObject
00360 //  12-Feb-03   dwoodward   added nFlags to TextOut
00361 //  19-Feb-03   dwoodward   added screen resolution stuff and WaitForVBILineZero();
00362 //                          added RamType parameter to Create functions
00363 //  19-Feb-03   dwoodward   added output resolution stuff
00364 //  06-Mar-03   dwoodward   added Destroy()
00365 //  09-Apr-03   dwoodward   added bDoubleBuffered parameters
00366 //  14-Apr-03   dwoodward   added SwapBuffers()
00367 //  22-Apr-03   dwoodward   added overloaded version of Blit() that takes a CascadeSharedMemZone
00368 //  05-May-03   dwoodward   doxygenated
00369 //  27-May-03   dwoodward   got rid of IsScreenLocked()
00370 //  16-Jun-03   dwoodward   added StartStreaming() and StopStreaming()
00371 //  27-Jul-03   dwoodward   added SetBypassMode() and GetBypassMode()
00372 //  28-Jul-03   dwoodward   added GetOutputResolutionScaleRect() and SetOutputResolutionScaleRect()
00373 //  03-Sep-04   dwoodward   added GrabBits(); got rid of StartStreaming() and StopStreaming()
00374 //  10-Nov-04   dwoodward   added DrawText()
00375 //  21-Apr-05   dwoodward   added GetMemory()
00376 //  22-Apr-05   dwoodward   added Flush()
00377 //  15-Jun-05   dwoodward   added VideoMode and refresh rate parms to GetSupportedOutputResolutionAt()

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