63 int widget_width,
int widget_height,
64 int image_width,
int image_height,
65 int &video_x,
int &video_y,
int &video_width,
int &video_height )
67 REQUIRE (widget_width >= 0);
68 REQUIRE (widget_height >= 0);
69 REQUIRE (image_width >= 0);
70 REQUIRE (image_height >= 0);
72 double ratio_width = ( double ) widget_width / (
double ) image_width;
73 double ratio_height = ( double ) widget_height / (
double ) image_height;
74 double ratio_constant = ratio_height < ratio_width ?
75 ratio_height : ratio_width;
76 video_width = ( int ) ( image_width * ratio_constant + 0.5 );
77 video_height = ( int ) ( image_height * ratio_constant + 0.5 );
78 video_x = ( widget_width - video_width ) / 2;
79 video_y = ( widget_height - video_height ) / 2;
81 ENSURE (video_x >= 0 && video_x < widget_width);
82 ENSURE (video_y >= 0 && video_y < widget_height);
83 ENSURE (video_width <= widget_width);
84 ENSURE (video_width <= widget_width);
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.
virtual int preferredHeight()
Expected height of input to put.
virtual DisplayerInput format()
Indicates the format required by the abstract put method.
virtual int preferredWidth()
Expected width of input to put.
Lumiera GTK UI implementation root.
virtual bool usable()
Indicates if this object can be used to render images on the running system.
The Displayer serves as base of all video display implementations.
DisplayerInput
Supported Displayer formats.
A set of basic GTK includes for the UI.
Implementation of video output via XVideo.