40 int width,
int height)
41 : drawingArea( drawing_area )
43 REQUIRE (drawing_area != NULL);
69 video_x, video_y, video_width, video_height);
71 GdkWindow *window =
drawingArea->get_window()->gobj();
72 REQUIRE (window != NULL);
75 GdkGC *gc = gdk_gc_new( window ); 78 GdkPixbuf *pixbuf = gdk_pixbuf_new_from_data( (
const guchar*)image, GDK_COLORSPACE_RGB, FALSE, 8,
80 REQUIRE(pixbuf != NULL);
82 GdkPixbuf *scaled_image = gdk_pixbuf_scale_simple( pixbuf, video_width, video_height, GDK_INTERP_NEAREST );
83 REQUIRE(scaled_image != NULL);
85 gdk_draw_pixbuf( window, gc, scaled_image, 0, 0, video_x, video_y, -1, -1, GDK_RGB_DITHER_NORMAL, 0, 0 );
87 g_object_unref( scaled_image );
88 g_object_unref( pixbuf );
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.
Gtk::Widget * drawingArea
The widget that video will be drawn into.
virtual int preferredHeight()
Expected height of input to put.
virtual int preferredWidth()
Expected width of input to put.
bool usable()
Indicates if this object can be used to render images on the running system.
Lumiera GTK UI implementation root.
GdkDisplayer(Gtk::Widget *drawing_area, int width, int height)
Constructor.
void put(void *const image)
Put an image of a given width and height with the expected input format (as indicated by the format m...
A set of basic GTK includes for the UI.