*-------------------------------------------------------------------
*/
+static void pixbuf_renderer_class_init_wrapper(void *g_class, void *class_data)
+{
+ pixbuf_renderer_class_init(g_class);
+}
+
+static void pixbuf_renderer_init_wrapper(PixbufRenderer *pr, void *class_data)
+{
+ pixbuf_renderer_init(pr);
+}
+
GType pixbuf_renderer_get_type(void)
{
static GType pixbuf_renderer_type = 0;
sizeof(PixbufRendererClass), /* class_size */
NULL, /* base_init */
NULL, /* base_finalize */
- (GClassInitFunc)pixbuf_renderer_class_init,
+ (GClassInitFunc)pixbuf_renderer_class_init_wrapper,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof(PixbufRenderer), /* instance_size */
0, /* n_preallocs */
- (GInstanceInitFunc)pixbuf_renderer_init, /* instance_init */
+ (GInstanceInitFunc)pixbuf_renderer_init_wrapper, /* instance_init */
NULL, /* value_table */
};
"Zoom quality",
NULL,
GDK_INTERP_NEAREST,
- GDK_INTERP_HYPER,
+ GDK_INTERP_BILINEAR,
GDK_INTERP_BILINEAR,
G_PARAM_READABLE | G_PARAM_WRITABLE));
g_object_class_install_property(gobject_class,
PROP_CACHE_SIZE_DISPLAY,
g_param_spec_uint("cache_display",
- "Display cache size MB",
+ "Display cache size MiB",
NULL,
0,
128,
static RendererFuncs *pr_backend_renderer_new(PixbufRenderer *pr)
{
- if (options->image.use_clutter_renderer)
+ if (options->image.use_clutter_renderer && !options->disable_gpu)
{
#ifdef HAVE_CLUTTER
return renderer_clutter_new(pr);
#else
- DEBUG_0("Geeqie is built without clutter renderer support");
+ log_printf("Warning: Geeqie is built without clutter renderer support");
#endif
}
return renderer_tiles_new(pr);
void pixbuf_renderer_set_color(PixbufRenderer *pr, GdkColor *color)
{
- GtkStyle *style;
- GtkWidget *widget;
-
g_return_if_fail(IS_PIXBUF_RENDERER(pr));
if (color)
}
}
- if (increment < 0.0)
+ if (options->image.zoom_style == ZOOM_GEOMETRIC)
{
- if (zoom >= 1.0 && zoom + increment < 1.0)
+ if (increment < 0.0)
{
- zoom = zoom + increment - 2.0;
+ if (zoom >= 1.0)
+ {
+ if (zoom / -(increment - 1.0) < 1.0)
+ {
+ zoom = 1.0 / (zoom / (increment - 1.0));
+ }
+ else
+ {
+ zoom = zoom / -(increment - 1.0) ;
+ }
+ }
+ else
+ {
+ zoom = zoom * -(increment - 1.0);
+ }
}
else
{
- zoom = zoom + increment;
+ if (zoom <= -1.0 )
+ {
+ if (zoom / (increment + 1.0) > -1.0)
+ {
+ zoom = -(1.0 / (zoom / (increment + 1.0)));
+ }
+ else
+ {
+ zoom = zoom / (increment + 1.0) ;
+ }
+ }
+ else
+ {
+ zoom = zoom * (increment + 1.0);
+ }
}
}
else
{
- if (zoom <= -1.0 && zoom + increment > -1.0)
+ if (increment < 0.0)
{
- zoom = zoom + increment + 2.0;
+ if (zoom >= 1.0 && zoom + increment < 1.0)
+ {
+ zoom = zoom + increment - 2.0;
+ }
+ else
+ {
+ zoom = zoom + increment;
+ }
}
else
{
- zoom = zoom + increment;
+ if (zoom <= -1.0 && zoom + increment > -1.0)
+ {
+ zoom = zoom + increment + 2.0;
+ }
+ else
+ {
+ zoom = zoom + increment;
+ }
}
}
accel = 1;
}
- /* do the scroll */
- pixbuf_renderer_scroll(pr, (pr->drag_last_x - event->x) * accel,
- (pr->drag_last_y - event->y) * accel);
-
+ /* do the scroll - not when drawing rectangle*/
+ if (!options->draw_rectangle)
+ {
+ pixbuf_renderer_scroll(pr, (pr->drag_last_x - event->x) * accel,
+ (pr->drag_last_y - event->y) * accel);
+ }
pr_drag_signal(pr, event);
pr->drag_last_x = event->x;
guchar *spi, *dpi;
gint i, j, k;
double pr_dubois_matrix[3][6];
- const static double pr_dubois_matrix_RC[3][6] = {
+ static const double pr_dubois_matrix_RC[3][6] = {
{ 0.456, 0.500, 0.176, -0.043, -0.088, -0.002},
{-0.040, -0.038, -0.016, 0.378, 0.734, -0.018},
{-0.015, -0.021, -0.005, -0.072, -0.113, 1.226}};
- const static double pr_dubois_matrix_GM[3][6] = {
+ static const double pr_dubois_matrix_GM[3][6] = {
{-0.062, -0.158, -0.039, 0.529, 0.705, 0.024},
{ 0.284, 0.668, 0.143, -0.016, -0.015, -0.065},
{-0.015, -0.027, 0.021, 0.009, 0.075, 0.937}};
- const static double pr_dubois_matrix_YB[3][6] = {
+ static const double pr_dubois_matrix_YB[3][6] = {
{ 1.000, -0.193, 0.282, -0.015, -0.116, -0.016},
{-0.024, 0.855, 0.064, 0.006, 0.058, -0.016},
{-0.036, -0.163, 0.021, 0.089, 0.174, 0.858}};
x_pixel_clamped = CLAMP(x_pixel, 0, pr->image_width - 1);
y_pixel_clamped = CLAMP(y_pixel, 0, pr->image_height - 1);
- if(x_pixel != x_pixel_clamped || y_pixel != y_pixel_clamped)
+ if (x_pixel != x_pixel_clamped)
+ {
+ /* mouse is not on pr */
+ x_pixel = -1;
+ }
+ if (y_pixel != y_pixel_clamped)
{
/* mouse is not on pr */
- x_pixel = y_pixel = -1;
+ y_pixel = -1;
}
*x_pixel_return = x_pixel;
void pixbuf_renderer_set_size_early(PixbufRenderer *pr, guint width, guint height)
{
#if 0
- /* FIXME: this function does not consider the image orientation,
+ /** @FIXME this function does not consider the image orientation,
so it probably only breaks something */
gdouble zoom;
gint w, h;
#endif
}
+void pixbuf_renderer_set_ignore_alpha(PixbufRenderer *pr, gint ignore_alpha)
+{
+ g_return_if_fail(IS_PIXBUF_RENDERER(pr));
+
+ pr->ignore_alpha = ignore_alpha;
+ pr_pixbuf_size_sync(pr);
+ pr_zoom_sync(pr, pr->zoom, PR_ZOOM_FORCE, 0, 0);
+}
+
/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */