Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
Displayer Class Referenceabstract

#include "stage/output/displayer.hpp"

Description

A Displayer is a class which is responsible for rendering an image in some way (ie: Xvideo, GDK, OpenGL etc).

Remarks
All Displayer classes must extend the Displayer class and minimally rewrite:
  • usable() - to indicate if the object can be used,
  • format() - to indicate what type of input the put method expects
  • put( void * ) - deal with an image of the expected type and size

By default, all images will be delivered to the put method in a resolution of IMG_WIDTH * IMG_HEIGHT. If another size is required, then the rewrite the methods:

  • preferredWidth
  • preferredHeight

If the widget being written to doesn't need a fixed size, then rewrite the two other put methods as required.

Definition at line 60 of file displayer.hpp.

Public Member Functions

virtual ~Displayer ()
 
 Displayer (uint w, uint h)
 
virtual bool usable ()=0
 Indicates if this object can be used to render images on the running system.
 
virtual DisplayerInput format ()
 Indicates the format required by the abstract put method.
 
virtual void put (void *const)=0
 Put an image of a given width and height with the expected input format (as indicated by the format method).
 

Protected Member Functions

void calculateVideoLayout (int widgetWidth, int widgetHeight, int &imgOrg_x, int &imgOrg_y, int &imgWidth, int &imgHeight)
 Calculates the coordinates for placing a video image inside a widget.
 

Protected Attributes

const uint videoWidth
 
const uint videoHeight
 

Additional Inherited Members

- Private Member Functions inherited from NonCopyable
 ~NonCopyable ()=default
 
 NonCopyable ()=default
 
 NonCopyable (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 

Constructor & Destructor Documentation

◆ ~Displayer()

virtual ~Displayer ( )
inlinevirtual

Definition at line 68 of file displayer.hpp.

◆ Displayer()

Displayer ( uint  w,
uint  h 
)
inline

Definition at line 70 of file displayer.hpp.

Member Function Documentation

◆ usable()

virtual bool usable ( )
pure virtual

Indicates if this object can be used to render images on the running system.

Implemented in NullDisplayer, PixbufDisplayer, and XvDisplayer.

◆ format()

DisplayerInput format ( )
virtual

Indicates the format required by the abstract put method.

Todo:
this feature was seemingly never used... can it be relevant? can we handle different formats?

Reimplemented in PixbufDisplayer, and XvDisplayer.

Definition at line 39 of file displayer.cpp.

References lumiera::DISPLAY_NONE.

◆ put()

virtual void put ( void * const  )
pure virtual

Put an image of a given width and height with the expected input format (as indicated by the format method).

Implemented in PixbufDisplayer, NullDisplayer, and XvDisplayer.

◆ calculateVideoLayout()

void calculateVideoLayout ( int  widgetWidth,
int  widgetHeight,
int &  imgOrg_x,
int &  imgOrg_y,
int &  imgWidth,
int &  imgHeight 
)
protected

Calculates the coordinates for placing a video image inside a widget.

Parameters
[in]widgetWidthavailable width for display in the widget.
[in]widgetHeightavailable height for display in the widget.
[out]imgOrg_xx-coordinate of the top left corner of the scaled video image to display.
[out]imgOrg_yy-coordinate of the top left corner.
[out]imgWidthwidth of the scale video image to display.
[out]imgHeightheight of the scale video image.

Definition at line 45 of file displayer.cpp.

References Displayer::videoHeight, and Displayer::videoWidth.

Referenced by PixbufDisplayer::put(), NullDisplayer::put(), and XvDisplayer::put().

+ Here is the caller graph for this function:

Member Data Documentation

◆ videoWidth

const uint videoWidth
protected

◆ videoHeight

const uint videoHeight
protected
+ Inheritance diagram for Displayer:
+ Collaboration diagram for Displayer:

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