OSDL::Video::Overlay Class Reference

#include <OSDLOverlay.h>

List of all members.


Detailed Description

An overlay is an image, encoded in a specific format, that can be blitted onto a Surface.

The encoding is based on YUV, which stands for :

YUV can be seen as transformed RGB values such that there is low correlation between the three coordinates.

This is the colour space representation used in PAL video and television transmission.

Note:
The term 'overlay' is a misnomer since, unless the overlay is created in hardware, the contents for the display surface underneath the area where the overlay is shown will be overwritten when the overlay is displayed.

Definition at line 61 of file OSDLOverlay.h.

Public Types

enum  EncodingFormat {
  YV12, IYUV, YUY2, UYVY,
  YVYU
}
 Describes the encoding format used by an overlay. More...

Public Member Functions

 Overlay (Length width, Length height, EncodingFormat format) throw ( OverlayException )
 Creates a YUV overlay of the specified width, height and format, linked with the current screen surface.
virtual ~Overlay () throw ()
 Virtual destructor.
virtual void blit (Coordinate x, Coordinate y) const throw ( OverlayException )
 Blits the overlay to the display, at the specified location, at its original size.
virtual void blit () const throw ( OverlayException )
 Blits the overlay to the display.
virtual bool mustBeLocked () const throw ()
 Tells whether this overlay has to be locked before modifying it.
virtual const std::string toString (Ceylan::VerbosityLevels level=Ceylan::high) const throw ()
 Returns an user-friendly description of the state of this object.

Protected Member Functions

virtual void preUnlock () throw ()
 Effective unlocking of the overlay.
virtual void postLock () throw ()
 Effective locking of the overlay.

Protected Attributes

SDL_Overlay * _overlay
 The inner back-end overlay, if any.
Length _width
 The original width of the overlay.
Length _height
 The original height of the overlay.

Private Member Functions

 Overlay (const Overlay &source) throw ()
 Copy constructor made private to ensure that it will never be called.
Overlayoperator= (const Overlay &source) throw ()
 Assignment operator made private to ensure that it will never be called.


Member Enumeration Documentation

enum OSDL::Video::Overlay::EncodingFormat

Describes the encoding format used by an overlay.

Planar modes :

Packed modes :

Enumerator:
YV12 
IYUV 
YUY2 
UYVY 
YVYU 

Definition at line 81 of file OSDLOverlay.h.


Constructor & Destructor Documentation

Overlay::Overlay ( Length  width,
Length  height,
EncodingFormat  format 
) throw ( OverlayException )

Creates a YUV overlay of the specified width, height and format, linked with the current screen surface.

Parameters:
width the width of this new overlay.
height the height of this new overlay.
format the encoding format for the pixels of this overlay.
Exceptions:
OverlayException if video module could not be retrieved or if the overlay creation failed.
See also:
EncodingFormat

Definition at line 35 of file OSDLOverlay.cc.

References OSDL::getExistingCommonModule(), OSDL::Video::VideoModule::getScreenSurface(), OSDL::Video::Surface::getSDLSurface(), OSDL::CommonModule::getVideoModule(), OSDL::hasExistingCommonModule(), and OSDL::CommonModule::hasVideoModule().

Overlay::~Overlay (  )  throw () [virtual]

Virtual destructor.

Definition at line 62 of file OSDLOverlay.cc.

References _overlay.

OSDL::Video::Overlay::Overlay ( const Overlay source  )  throw () [private]

Copy constructor made private to ensure that it will never be called.

The compiler should complain whenever this undefined constructor is called, implicitly or not.


Member Function Documentation

void Overlay::blit ( Coordinate  x,
Coordinate  y 
) const throw ( OverlayException ) [virtual]

Blits the overlay to the display, at the specified location, at its original size.

Parameters:
x abscissa of the destination surface where this overlay will be blitted.
y ordinate of the destination surface where this overlay will be blitted.
Exceptions:
OverlayException if the operation failed.

Definition at line 71 of file OSDLOverlay.cc.

References OSDL::Utils::getBackendLastError().

void Overlay::blit (  )  const throw ( OverlayException ) [virtual]

Blits the overlay to the display.

Exceptions:
OverlayException if the operation failed.

Definition at line 89 of file OSDLOverlay.cc.

bool Overlay::mustBeLocked (  )  const throw () [virtual]

Tells whether this overlay has to be locked before modifying it.

When using a overlay, in general there is no need to use this method because the lock/unlock methods take care of that.

See also:
Ceylan::Lockable.
This method cannot be inlined since it is inherited.

Definition at line 97 of file OSDLOverlay.cc.

const string Overlay::toString ( Ceylan::VerbosityLevels  level = Ceylan::high  )  const throw () [virtual]

Returns an user-friendly description of the state of this object.

Parameters:
level the requested verbosity level.
Note:
Text output format is determined from overall settings.
See also:
Ceylan::TextDisplayable

Definition at line 132 of file OSDLOverlay.cc.

References OSDL::Video::Pixels::toString().

void Overlay::preUnlock (  )  throw () [protected, virtual]

Effective unlocking of the overlay.

Nevertheless only lock/unlock pair should be called by user programs.

See also:
Ceylan::Lockable

Definition at line 106 of file OSDLOverlay.cc.

References _overlay.

void Overlay::postLock (  )  throw () [protected, virtual]

Effective locking of the overlay.

Nevertheless only lock/unlock pair should be called by user programs.

See also:
Ceylan::Lockable

Definition at line 119 of file OSDLOverlay.cc.

References _overlay.

Overlay& OSDL::Video::Overlay::operator= ( const Overlay source  )  throw () [private]

Assignment operator made private to ensure that it will never be called.

The compiler should complain whenever this undefined operator is called, implicitly or not.


Member Data Documentation

SDL_Overlay* OSDL::Video::Overlay::_overlay [protected]

The inner back-end overlay, if any.

Definition at line 197 of file OSDLOverlay.h.

Referenced by postLock(), preUnlock(), and ~Overlay().

Length OSDL::Video::Overlay::_width [protected]

The original width of the overlay.

Definition at line 201 of file OSDLOverlay.h.

Length OSDL::Video::Overlay::_height [protected]

The original height of the overlay.

Definition at line 205 of file OSDLOverlay.h.


The documentation for this class was generated from the following files:
Generated on Fri Mar 30 14:47:30 2007 for OSDL by  doxygen 1.5.1