#include <displayer.h>
Inheritance diagram for GdkDisplayer:


Public Member Functions | |
| GdkDisplayer (GtkWidget *drawingarea, int width, int height, bool is_wide) | |
| ~GdkDisplayer () | |
| bool | usable () |
| Indicates if an object can be used to render images on the running system. | |
| DisplayerInput | format () |
| Indicates the format required by the abstract put method. | |
| void | put (void *data) |
Private Attributes | |
| GtkWidget * | drawingarea |
| bool | m_is_wide |
|
||||||||||||||||||||
|
Definition at line 654 of file displayer.cc. References Displayer::img_height, Displayer::img_width, and m_is_wide. 00655 {
00656 this->drawingarea = drawingarea;
00657 img_width = width;
00658 img_height = height;
00659 m_is_wide = is_wide;
00660 }
|
|
|
Definition at line 662 of file displayer.cc. 00663 {}
|
|
|
Indicates the format required by the abstract put method.
Reimplemented from Displayer. Definition at line 670 of file displayer.cc. References DISPLAY_RGB. 00671 {
00672 return DISPLAY_RGB;
00673 }
|
|
|
Implements Displayer. Definition at line 675 of file displayer.cc. References drawingarea, AspectRatioCalculator::height, Displayer::img_height, m_is_wide, Displayer::preferredHeight(), Displayer::preferredWidth(), and AspectRatioCalculator::width. Referenced by generate_file_preview(). 00676 {
00677 unsigned char * image = ( unsigned char * ) data;
00678
00679 AspectRatioCalculator calc( ( ( GtkWidget * ) drawingarea ) ->allocation.width,
00680 ( ( GtkWidget * ) drawingarea ) ->allocation.height,
00681 this->preferredWidth(), this->preferredHeight(),
00682 img_height == 576, m_is_wide );
00683
00684 GdkGC *gc = gdk_gc_new( drawingarea->window );
00685 GdkPixbuf *pix = gdk_pixbuf_new_from_data( image, GDK_COLORSPACE_RGB, FALSE, 8, preferredWidth(), preferredHeight(), preferredWidth() * 3, NULL, NULL );
00686 GdkPixbuf *im = gdk_pixbuf_scale_simple( pix, calc.width, calc.height, GDK_INTERP_NEAREST );
00687 gdk_draw_pixbuf( drawingarea->window, gc, im, 0, 0, 0, 0, -1, -1, GDK_RGB_DITHER_NORMAL, 0, 0 );
00688 g_object_unref( im );
00689 g_object_unref( pix );
00690 g_object_unref( gc );
00691 }
|
|
|
Indicates if an object can be used to render images on the running system.
Reimplemented from Displayer. Definition at line 665 of file displayer.cc. 00666 {
00667 return true;
00668 }
|
|
|
Definition at line 184 of file displayer.h. Referenced by put(). |
|
|
Definition at line 185 of file displayer.h. Referenced by GdkDisplayer(), and put(). |
1.4.2