OSDL::Video::Overlay Class Reference

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

#include <OSDLOverlay.h>

Collaboration diagram for OSDL::Video::Overlay:
Collaboration graph
[legend]

List of all members.

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)
 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
 Blits the overlay to the display, at the specified location, at its original size.
virtual void blit () const
 Blits the overlay to the display.
virtual bool mustBeLocked () const
 Tells whether this overlay has to be locked before modifying it.
virtual const std::string toString (Ceylan::VerbosityLevels level=Ceylan::high) const
 Returns an user-friendly description of the state of this object.

Protected Member Functions

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

Protected Attributes

LowLevelOverlay_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)
 Copy constructor made private to ensure that it will never be called.
Overlayoperator= (const Overlay &source)
 Assignment operator made private to ensure that it will never be called.

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 109 of file OSDLOverlay.h.


Member Enumeration Documentation

Describes the encoding format used by an overlay.

Planar modes:

  • YV12: Y + V + U
  • IYUV: Y + U + V

Packed modes:

  • YUY2: Y0 + U0 + Y1 + V0
  • UYVY: U0 + Y0 + V0 + Y1
  • YVYU: Y0 + V0 + Y1 + U0
Enumerator:
YV12 
IYUV 
YUY2 
UYVY 
YVYU 

Definition at line 130 of file OSDLOverlay.h.


Constructor & Destructor Documentation

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

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 90 of file OSDLOverlay.cc.

References _overlay, 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 126 of file OSDLOverlay.cc.

References _overlay.

OSDL::Video::Overlay::Overlay ( const Overlay source  )  [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 (  )  const [virtual]

Blits the overlay to the display.

Exceptions:
OverlayException if the operation failed.

Definition at line 163 of file OSDLOverlay.cc.

void Overlay::blit ( Coordinate  x,
Coordinate  y 
) const [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 140 of file OSDLOverlay.cc.

References _height, _overlay, _width, and OSDL::Utils::getBackendLastError().

bool Overlay::mustBeLocked (  )  const [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 172 of file OSDLOverlay.cc.

Overlay& OSDL::Video::Overlay::operator= ( const Overlay source  )  [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.

void Overlay::postLock (  )  [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 200 of file OSDLOverlay.cc.

References _overlay.

void Overlay::preUnlock (  )  [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 182 of file OSDLOverlay.cc.

References _overlay.

const string Overlay::toString ( Ceylan::VerbosityLevels  level = Ceylan::high  )  const [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 218 of file OSDLOverlay.cc.

References _height, and _width.


Member Data Documentation

The original height of the overlay.

Definition at line 260 of file OSDLOverlay.h.

Referenced by blit(), and toString().

The inner back-end overlay, if any.

Definition at line 252 of file OSDLOverlay.h.

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

The original width of the overlay.

Definition at line 256 of file OSDLOverlay.h.

Referenced by blit(), and toString().


The documentation for this class was generated from the following files:
Generated on Mon Nov 29 14:06:00 2010 for OSDL by  doxygen 1.6.3