An overlay is an image, encoded in a specific format, that can be blitted onto a Surface. More...
#include <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) | |
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. | |
Overlay & | operator= (const Overlay &source) |
Assignment operator made private to ensure that it will never be called. |
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.
Definition at line 109 of file OSDLOverlay.h.
Describes the encoding format used by an overlay.
Planar modes:
Packed modes:
Definition at line 130 of file OSDLOverlay.h.
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.
width | the width of this new overlay. | |
height | the height of this new overlay. | |
format | the encoding format for the pixels of this overlay. |
OverlayException | if video module could not be retrieved or if the overlay creation failed. |
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] |
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.
void Overlay::blit | ( | ) | const [virtual] |
Blits the overlay to the display.
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.
x | abscissa of the destination surface where this overlay will be blitted. | |
y | ordinate of the destination surface where this overlay will be blitted. |
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.
This method cannot be inlined since it is inherited.
Definition at line 172 of file OSDLOverlay.cc.
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.
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.
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.
level | the requested verbosity level. |
Definition at line 218 of file OSDLOverlay.cc.
Length OSDL::Video::Overlay::_height [protected] |
The original height of the overlay.
Definition at line 260 of file OSDLOverlay.h.
Referenced by blit(), and toString().
LowLevelOverlay* OSDL::Video::Overlay::_overlay [protected] |
The inner back-end overlay, if any.
Definition at line 252 of file OSDLOverlay.h.
Referenced by blit(), Overlay(), postLock(), preUnlock(), and ~Overlay().
Length OSDL::Video::Overlay::_width [protected] |
The original width of the overlay.
Definition at line 256 of file OSDLOverlay.h.
Referenced by blit(), and toString().