Phonon  4.7.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
Public Member Functions | Protected Attributes | List of all members
Phonon::AbstractVideoGraphicsPainter Class Referenceabstract

#include <abstractvideographicspainter.h>

Inheritance diagram for Phonon::AbstractVideoGraphicsPainter:
Phonon::GlPainter Phonon::QPainterPainter Phonon::GlslPainter

Public Member Functions

virtual QList< VideoFrame::FormatsupportedFormats () const =0
 
void setFrame (const VideoFrame *frame)
 
virtual void init ()=0
 
virtual void paint (QPainter *painter, QRectF target)=0
 
virtual ~AbstractVideoGraphicsPainter ()
 
bool inited () const
 

Protected Attributes

const VideoFramem_frame
 
bool m_inited
 

Detailed Description

This class provides a well defined interface to video graphics painter implementations.

A video graphics painter is a class that draws onto an arbitrary target rectangle within a QGraphicsScene by whatever means it has (e.g. OpenGL ARB, GLSL or simply QPainter).

Author
Harald Sitter sitte.nosp@m.r@kd.nosp@m.e.org

Constructor & Destructor Documentation

virtual Phonon::AbstractVideoGraphicsPainter::~AbstractVideoGraphicsPainter ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual void Phonon::AbstractVideoGraphicsPainter::init ( )
pure virtual

Implementations of init can prepare the painter for painting. For example an OpenGL painter may setup the GLContext and prepare the textures. Mind that init will usually be irreversible, so once a painter was initialized for a specific frame only the data of this frame may change.

See Also
setFrame

Implemented in Phonon::GlslPainter, and Phonon::QPainterPainter.

virtual void Phonon::AbstractVideoGraphicsPainter::paint ( QPainter *  painter,
QRectF  target 
)
pure virtual

The actual paint logic is implemented in this function.

Parameters
painterthe QPainter obtained from the paint call on a QGraphicsItem.
targetthe rectangle to draw in, this will usually be the rectangle calculated for a given aspect ratio.

Implemented in Phonon::GlslPainter, and Phonon::QPainterPainter.

void Phonon::AbstractVideoGraphicsPainter::setFrame ( const VideoFrame frame)
inline

Set a new frame on the painter. This function should be called before any other function is used. The frame can either stay valid throughout the life time of the object (in which case you only need to call it once) or you need to set the most current frame each paint cycle. At any rate there must be a valid frame set before calling anything.

Mind that you will need to drop the painter and reinitialize a new one once the frame changed in format, size, and the like.

Parameters
frameis the video frame that the painter is supposed to paint later on.

Member Data Documentation

const VideoFrame* Phonon::AbstractVideoGraphicsPainter::m_frame
protected

The frame an implementatin is supposed to work with.

bool Phonon::AbstractVideoGraphicsPainter::m_inited
protected

Whether or not the painter was inited


The documentation for this class was generated from the following file: