Lumiera  0.pre.03
»edityourfreedom«
Displayer Class Referenceabstract

#include "gui/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 74 of file displayer.hpp.

Public Member Functions

virtual ~Displayer ()
 
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). More...
 
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
 

Constructor & Destructor Documentation

◆ ~Displayer()

virtual ~Displayer ( )
inlinevirtual

Definition at line 81 of file displayer.hpp.

References Displayer::calculateVideoLayout(), Displayer::format(), Displayer::preferredHeight(), Displayer::preferredWidth(), Displayer::put(), and Displayer::usable().

+ Here is the call graph for this function:

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 47 of file displayer.cpp.

Referenced by VideoDisplayWidget::createDisplayer(), and Displayer::~Displayer().

+ Here is the caller graph for this function:

◆ format()

DisplayerInput format ( )
virtual

Indicates the format required by the abstract put method.

Definition at line 53 of file displayer.cpp.

References gui::output::DISPLAY_NONE.

Referenced by XvDisplayer::XvDisplayer(), and Displayer::~Displayer().

+ Here is the caller graph for this function:

◆ preferredWidth()

int preferredWidth ( )
virtual

Expected width of input to put.

Definition at line 59 of file displayer.cpp.

References Displayer::imageWidth.

Referenced by GdkDisplayer::put(), XvDisplayer::put(), and Displayer::~Displayer().

+ Here is the caller graph for this function:

◆ preferredHeight()

int preferredHeight ( )
virtual

Expected height of input to put.

Definition at line 65 of file displayer.cpp.

References Displayer::imageHeight.

Referenced by GdkDisplayer::put(), XvDisplayer::put(), and Displayer::~Displayer().

+ Here is the caller graph for this function:

◆ 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 XvDisplayer, and GdkDisplayer.

Referenced by ViewerPanel::on_frame(), and Displayer::~Displayer().

+ 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 71 of file displayer.cpp.

References ENSURE().

Referenced by GdkDisplayer::put(), XvDisplayer::put(), and Displayer::~Displayer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ imageWidth

int imageWidth
protected

◆ imageHeight

int imageHeight
protected
+ Inheritance diagram for Displayer:
+ Collaboration diagram for Displayer:

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