72 int widget_width,
int widget_height,
73 int image_width,
int image_height,
74 int &video_x,
int &video_y,
int &video_width,
int &video_height )
76 REQUIRE (widget_width >= 0);
77 REQUIRE (widget_height >= 0);
78 REQUIRE (image_width >= 0);
79 REQUIRE (image_height >= 0);
81 double ratio_width = ( double ) widget_width / (
double ) image_width;
82 double ratio_height = ( double ) widget_height / (
double ) image_height;
83 double ratio_constant = ratio_height < ratio_width ?
84 ratio_height : ratio_width;
85 video_width = ( int ) ( image_width * ratio_constant + 0.5 );
86 video_height = ( int ) ( image_height * ratio_constant + 0.5 );
87 video_x = ( widget_width - video_width ) / 2;
88 video_y = ( widget_height - video_height ) / 2;
90 ENSURE (video_x >= 0 && video_x < widget_width);
91 ENSURE (video_y >= 0 && video_y < widget_height);
92 ENSURE (video_width <= widget_width);
93 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.