Lumiera  0.pre.03
»edit your freedom«
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 65 of file displayer.hpp.

Public Member Functions

virtual DisplayerInput format ()
 Indicates the format required by the abstract put method. More...
 
virtual int preferredHeight ()
 Expected height of input to put. More...
 
virtual int preferredWidth ()
 Expected width of input to put. More...
 
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).
 
virtual bool usable ()
 Indicates if this object can be used to render images on the running system. More...
 

Static Protected Member Functions

static void calculateVideoLayout (int widget_width, int widget_height, int image_width, int image_height, int &video_x, int &video_y, int &video_width, int &video_height)
 Calculates the coordinates for placing a video image inside a widget. More...
 

Protected Attributes

int imageHeight
 
int imageWidth
 

Member Function Documentation

◆ usable()

bool usable ( )
virtual

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

Reimplemented in XvDisplayer, and GdkDisplayer.

Definition at line 38 of file displayer.cpp.

◆ format()

DisplayerInput format ( )
virtual

Indicates the format required by the abstract put method.

Definition at line 44 of file displayer.cpp.

◆ preferredWidth()

int preferredWidth ( )
virtual

Expected width of input to put.

Definition at line 50 of file displayer.cpp.

Referenced by GdkDisplayer::put().

+ Here is the caller graph for this function:

◆ preferredHeight()

int preferredHeight ( )
virtual

Expected height of input to put.

Definition at line 56 of file displayer.cpp.

Referenced by GdkDisplayer::put().

+ Here is the caller graph for this function:

◆ calculateVideoLayout()

void calculateVideoLayout ( int  widget_width,
int  widget_height,
int  image_width,
int  image_height,
int &  video_x,
int &  video_y,
int &  video_width,
int &  video_height 
)
staticprotected

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

Parameters
[in]widget_widthThe width of the display widget.
[in]widget_heightThe height of the display widget.
[in]image_widthThe width of the video image.
[in]image_heightThe height of the video image.
[out]video_xThe x-coordinate of the top left corner of the scaled video image.
[out]video_yThe y-coordinate of the top left corner of the scaled video image.
[out]video_widthThe width of the scale video image.
[out]video_heightThe height of the scale video image.

Definition at line 62 of file displayer.cpp.

Referenced by GdkDisplayer::put().

+ Here is the caller graph for this function:
+ Inheritance diagram for Displayer:
+ Collaboration diagram for Displayer:

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