Lumiera  0.pre.03
»edityourfreedom«
displayer.hpp
Go to the documentation of this file.
1 /*
2  DISPLAYER.hpp - base class for displaying video
3 
4  Copyright (C) Lumiera.org
5  2000, Arne Schirmacher <arne@schirmacher.de>
6  2001-2007, Dan Dennedy <dan@dennedy.org>
7  2008, Joel Holdsworth <joel@airwebreathe.org.uk>
8 
9  This program is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License as
11  published by the Free Software Foundation; either version 2 of
12  the License, or (at your option) any later version.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 
23 */
24 
35 #ifndef GUI_OUTPUT_DISPLAYER_H
36 #define GUI_OUTPUT_DISPLAYER_H
37 
38 
39 namespace gui {
40 namespace output {
41 
50  };
51 
52 
74  class Displayer
75  {
76  protected:
79 
80  public:
81  virtual ~Displayer() { }
82 
83 
85  virtual bool usable();
86 
88  virtual DisplayerInput format();
89 
91  virtual int preferredWidth();
92 
94  virtual int preferredHeight();
95 
100  virtual void put (void* const) =0;
101 
102 
103  protected:
118  static void calculateVideoLayout(
119  int widget_width, int widget_height,
120  int image_width, int image_height,
121  int &video_x, int &video_y, int &video_width, int &video_height );
122  };
123 
124 
125 
126 }} // namespace gui::output
127 #endif /*GUI_OUTPUT_DISPLAYER_H*/
DisplayerInput
Supported Displayer formats.
Definition: displayer.hpp:43
virtual bool usable()
Indicates if this object can be used to render images on the running system.
Definition: displayer.cpp:47
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:47
virtual int preferredHeight()
Expected height of input to put.
Definition: displayer.cpp:65
virtual DisplayerInput format()
Indicates the format required by the abstract put method.
Definition: displayer.cpp:53
virtual int preferredWidth()
Expected width of input to put.
Definition: displayer.cpp:59
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 m...
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.
Definition: displayer.cpp:71
A Displayer is a class which is responsible for rendering an image in some way (ie: Xvideo...
Definition: displayer.hpp:74