49 int width,
int height)
50 : drawingArea( drawing_area )
52 REQUIRE (drawing_area != NULL);
78 video_x, video_y, video_width, video_height);
80 GdkWindow *window =
drawingArea->get_window()->gobj();
81 REQUIRE (window != NULL);
84 GdkGC *gc = gdk_gc_new( window ); 87 GdkPixbuf *pixbuf = gdk_pixbuf_new_from_data( (
const guchar*)image, GDK_COLORSPACE_RGB, FALSE, 8,
89 REQUIRE(pixbuf != NULL);
91 GdkPixbuf *scaled_image = gdk_pixbuf_scale_simple( pixbuf, video_width, video_height, GDK_INTERP_NEAREST );
92 REQUIRE(scaled_image != NULL);
94 gdk_draw_pixbuf( window, gc, scaled_image, 0, 0, video_x, video_y, -1, -1, GDK_RGB_DITHER_NORMAL, 0, 0 );
96 g_object_unref( scaled_image );
97 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.