Mercurial > geeqie
comparison src/pixbuf-renderer.c @ 442:4b2d7f9af171
Big whitespaces cleanup:
- drop whitespaces at end of lines
- convert eight spaces to tab at start of lines
- drop spurious spaces mixed with tabs
- remove empty lines at end of files
author | zas_ |
---|---|
date | Sun, 20 Apr 2008 13:04:57 +0000 |
parents | 319cd8857399 |
children | ddabc4873a3f |
comparison
equal
deleted
inserted
replaced
441:08eb7137cd94 | 442:4b2d7f9af171 |
---|---|
25 #define GQ_BUILD 1 | 25 #define GQ_BUILD 1 |
26 | 26 |
27 | 27 |
28 #ifdef GQ_BUILD | 28 #ifdef GQ_BUILD |
29 #include "pixbuf_util.h" | 29 #include "pixbuf_util.h" |
30 | 30 |
31 /* for debug */ | 31 /* for debug */ |
32 #include "main.h" | 32 #include "main.h" |
33 #endif | 33 #endif |
34 | 34 |
35 | 35 |
398 NULL, | 398 NULL, |
399 10, | 399 10, |
400 150, | 400 150, |
401 100, | 401 100, |
402 G_PARAM_READABLE | G_PARAM_WRITABLE)); | 402 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
403 | 403 |
404 g_object_class_install_property(gobject_class, | 404 g_object_class_install_property(gobject_class, |
405 PROP_AUTOFIT_LIMIT, | 405 PROP_AUTOFIT_LIMIT, |
406 g_param_spec_boolean("autofit_limit", | 406 g_param_spec_boolean("autofit_limit", |
407 "Limit size of image when autofitting", | 407 "Limit size of image when autofitting", |
408 NULL, | 408 NULL, |
418 150, | 418 150, |
419 100, | 419 100, |
420 G_PARAM_READABLE | G_PARAM_WRITABLE)); | 420 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
421 | 421 |
422 | 422 |
423 signals[SIGNAL_ZOOM] = | 423 signals[SIGNAL_ZOOM] = |
424 g_signal_new("zoom", | 424 g_signal_new("zoom", |
425 G_OBJECT_CLASS_TYPE(gobject_class), | 425 G_OBJECT_CLASS_TYPE(gobject_class), |
426 G_SIGNAL_RUN_LAST, | 426 G_SIGNAL_RUN_LAST, |
427 G_STRUCT_OFFSET(PixbufRendererClass, zoom), | 427 G_STRUCT_OFFSET(PixbufRendererClass, zoom), |
428 NULL, NULL, | 428 NULL, NULL, |
429 g_cclosure_marshal_VOID__DOUBLE, | 429 g_cclosure_marshal_VOID__DOUBLE, |
430 G_TYPE_NONE, 1, | 430 G_TYPE_NONE, 1, |
431 G_TYPE_DOUBLE); | 431 G_TYPE_DOUBLE); |
432 | 432 |
433 signals[SIGNAL_CLICKED] = | 433 signals[SIGNAL_CLICKED] = |
434 g_signal_new("clicked", | 434 g_signal_new("clicked", |
435 G_OBJECT_CLASS_TYPE(gobject_class), | 435 G_OBJECT_CLASS_TYPE(gobject_class), |
436 G_SIGNAL_RUN_LAST, | 436 G_SIGNAL_RUN_LAST, |
437 G_STRUCT_OFFSET(PixbufRendererClass, clicked), | 437 G_STRUCT_OFFSET(PixbufRendererClass, clicked), |
438 NULL, NULL, | 438 NULL, NULL, |
439 g_cclosure_marshal_VOID__BOXED, | 439 g_cclosure_marshal_VOID__BOXED, |
440 G_TYPE_NONE, 1, | 440 G_TYPE_NONE, 1, |
441 GDK_TYPE_EVENT); | 441 GDK_TYPE_EVENT); |
442 | 442 |
443 signals[SIGNAL_SCROLL_NOTIFY] = | 443 signals[SIGNAL_SCROLL_NOTIFY] = |
444 g_signal_new("scroll-notify", | 444 g_signal_new("scroll-notify", |
445 G_OBJECT_CLASS_TYPE(gobject_class), | 445 G_OBJECT_CLASS_TYPE(gobject_class), |
446 G_SIGNAL_RUN_LAST, | 446 G_SIGNAL_RUN_LAST, |
447 G_STRUCT_OFFSET(PixbufRendererClass, scroll_notify), | 447 G_STRUCT_OFFSET(PixbufRendererClass, scroll_notify), |
448 NULL, NULL, | 448 NULL, NULL, |
449 g_cclosure_marshal_VOID__VOID, | 449 g_cclosure_marshal_VOID__VOID, |
450 G_TYPE_NONE, 0); | 450 G_TYPE_NONE, 0); |
451 | 451 |
452 signals[SIGNAL_RENDER_COMPLETE] = | 452 signals[SIGNAL_RENDER_COMPLETE] = |
453 g_signal_new("render-complete", | 453 g_signal_new("render-complete", |
454 G_OBJECT_CLASS_TYPE(gobject_class), | 454 G_OBJECT_CLASS_TYPE(gobject_class), |
455 G_SIGNAL_RUN_LAST, | 455 G_SIGNAL_RUN_LAST, |
456 G_STRUCT_OFFSET(PixbufRendererClass, render_complete), | 456 G_STRUCT_OFFSET(PixbufRendererClass, render_complete), |
457 NULL, NULL, | 457 NULL, NULL, |
458 g_cclosure_marshal_VOID__VOID, | 458 g_cclosure_marshal_VOID__VOID, |
459 G_TYPE_NONE, 0); | 459 G_TYPE_NONE, 0); |
460 | 460 |
461 signals[SIGNAL_DRAG] = | 461 signals[SIGNAL_DRAG] = |
462 g_signal_new("drag", | 462 g_signal_new("drag", |
463 G_OBJECT_CLASS_TYPE(gobject_class), | 463 G_OBJECT_CLASS_TYPE(gobject_class), |
464 G_SIGNAL_RUN_LAST, | 464 G_SIGNAL_RUN_LAST, |
465 G_STRUCT_OFFSET(PixbufRendererClass, drag), | 465 G_STRUCT_OFFSET(PixbufRendererClass, drag), |
466 NULL, NULL, | 466 NULL, NULL, |
979 | 979 |
980 return NULL; | 980 return NULL; |
981 } | 981 } |
982 | 982 |
983 gint pixbuf_renderer_overlay_add(PixbufRenderer *pr, GdkPixbuf *pixbuf, gint x, gint y, | 983 gint pixbuf_renderer_overlay_add(PixbufRenderer *pr, GdkPixbuf *pixbuf, gint x, gint y, |
984 gint relative, gint always) | 984 gint relative, gint always) |
985 { | 985 { |
986 OverlayData *od; | 986 OverlayData *od; |
987 gint id; | 987 gint id; |
988 gint px, py, pw, ph; | 988 gint px, py, pw, ph; |
989 GdkWindowAttr attributes; | 989 GdkWindowAttr attributes; |
2014 | 2014 |
2015 it->pixmap = pixmap; | 2015 it->pixmap = pixmap; |
2016 it->size += size; | 2016 it->size += size; |
2017 pr->tile_cache_size += size; | 2017 pr->tile_cache_size += size; |
2018 } | 2018 } |
2019 | 2019 |
2020 if ((pr->zoom != 1.0 || pr->source_tiles_enabled || (pr->pixbuf && gdk_pixbuf_get_has_alpha(pr->pixbuf)) || | 2020 if ((pr->zoom != 1.0 || pr->source_tiles_enabled || (pr->pixbuf && gdk_pixbuf_get_has_alpha(pr->pixbuf)) || |
2021 pr->orientation != EXIF_ORIENTATION_TOP_LEFT || pr->func_post_process) && !it->pixbuf) | 2021 pr->orientation != EXIF_ORIENTATION_TOP_LEFT || pr->func_post_process) && !it->pixbuf) |
2022 { | 2022 { |
2023 GdkPixbuf *pixbuf; | 2023 GdkPixbuf *pixbuf; |
2024 guint size; | 2024 guint size; |
2025 #if 0 | 2025 #if 0 |
2049 /* | 2049 /* |
2050 *------------------------------------------------------------------- | 2050 *------------------------------------------------------------------- |
2051 * drawing | 2051 * drawing |
2052 *------------------------------------------------------------------- | 2052 *------------------------------------------------------------------- |
2053 */ | 2053 */ |
2054 | 2054 |
2055 | 2055 |
2056 static void pr_tile_coords_map_orientation(PixbufRenderer *pr, | 2056 static void pr_tile_coords_map_orientation(PixbufRenderer *pr, |
2057 double tile_x, double tile_y, /* coordinates of the tile */ | 2057 double tile_x, double tile_y, /* coordinates of the tile */ |
2058 gint image_w, gint image_h, | 2058 gint image_w, gint image_h, |
2059 double tile_w, double tile_h, | 2059 double tile_w, double tile_h, |
2060 double *res_x, double *res_y) | 2060 double *res_x, double *res_y) |
2061 { | 2061 { |
2062 *res_x = tile_x; | 2062 *res_x = tile_x; |
2063 *res_y = tile_y; | 2063 *res_y = tile_y; |
2099 break; | 2099 break; |
2100 default: | 2100 default: |
2101 /* The other values are out of range */ | 2101 /* The other values are out of range */ |
2102 break; | 2102 break; |
2103 } | 2103 } |
2104 // printf("tile coord y:%f, ih:%d, th:%f ry:%f\n", tile_y, image_h, tile_h, *res_x); | 2104 // printf("tile coord y:%f, ih:%d, th:%f ry:%f\n", tile_y, image_h, tile_h, *res_x); |
2105 } | 2105 } |
2106 | 2106 |
2107 static void pr_tile_region_map_orientation(PixbufRenderer *pr, | 2107 static void pr_tile_region_map_orientation(PixbufRenderer *pr, |
2108 gint area_x, gint area_y, /* coordinates of the area inside tile */ | 2108 gint area_x, gint area_y, /* coordinates of the area inside tile */ |
2109 gint tile_w, gint tile_h, | 2109 gint tile_w, gint tile_h, |
2110 gint area_w, gint area_h, | 2110 gint area_w, gint area_h, |
2162 break; | 2162 break; |
2163 default: | 2163 default: |
2164 /* The other values are out of range */ | 2164 /* The other values are out of range */ |
2165 break; | 2165 break; |
2166 } | 2166 } |
2167 // printf("inside y:%d, th:%d, ah:%d ry:%d\n", area_y, tile_h, area_h, *res_x); | 2167 // printf("inside y:%d, th:%d, ah:%d ry:%d\n", area_y, tile_h, area_h, *res_x); |
2168 } | 2168 } |
2169 | 2169 |
2170 static void pr_coords_map_orientation_reverse(PixbufRenderer *pr, | 2170 static void pr_coords_map_orientation_reverse(PixbufRenderer *pr, |
2171 gint area_x, gint area_y, | 2171 gint area_x, gint area_y, |
2172 gint tile_w, gint tile_h, | 2172 gint tile_w, gint tile_h, |
2173 gint area_w, gint area_h, | 2173 gint area_w, gint area_h, |
2225 break; | 2225 break; |
2226 default: | 2226 default: |
2227 /* The other values are out of range */ | 2227 /* The other values are out of range */ |
2228 break; | 2228 break; |
2229 } | 2229 } |
2230 } | 2230 } |
2231 | 2231 |
2232 | 2232 |
2233 static GdkPixbuf *pr_get_spare_tile(PixbufRenderer *pr) | 2233 static GdkPixbuf *pr_get_spare_tile(PixbufRenderer *pr) |
2234 { | 2234 { |
2235 if (!pr->spare_tile) pr->spare_tile = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, pr->tile_width, pr->tile_height); | 2235 if (!pr->spare_tile) pr->spare_tile = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, pr->tile_width, pr->tile_height); |
2246 guchar *s_pix, *d_pix; | 2246 guchar *s_pix, *d_pix; |
2247 guchar *sp, *dp; | 2247 guchar *sp, *dp; |
2248 guchar *ip, *spi, *dpi; | 2248 guchar *ip, *spi, *dpi; |
2249 gint i, j; | 2249 gint i, j; |
2250 gint tw = pr->tile_width; | 2250 gint tw = pr->tile_width; |
2251 | 2251 |
2252 srs = gdk_pixbuf_get_rowstride(src); | 2252 srs = gdk_pixbuf_get_rowstride(src); |
2253 s_pix = gdk_pixbuf_get_pixels(src); | 2253 s_pix = gdk_pixbuf_get_pixels(src); |
2254 spi = s_pix + (x * COLOR_BYTES); | 2254 spi = s_pix + (x * COLOR_BYTES); |
2255 | 2255 |
2256 dest = pr_get_spare_tile(pr); | 2256 dest = pr_get_spare_tile(pr); |
2267 dp = ip + (j * drs); | 2267 dp = ip + (j * drs); |
2268 memcpy(dp, sp, COLOR_BYTES); | 2268 memcpy(dp, sp, COLOR_BYTES); |
2269 sp += COLOR_BYTES; | 2269 sp += COLOR_BYTES; |
2270 } | 2270 } |
2271 } | 2271 } |
2272 | 2272 |
2273 pr->spare_tile = src; | 2273 pr->spare_tile = src; |
2274 *tile = dest; | 2274 *tile = dest; |
2275 } | 2275 } |
2276 | 2276 |
2277 static void pr_tile_rotate_90_counter_clockwise(PixbufRenderer *pr, GdkPixbuf **tile, gint x, gint y, gint w, gint h) | 2277 static void pr_tile_rotate_90_counter_clockwise(PixbufRenderer *pr, GdkPixbuf **tile, gint x, gint y, gint w, gint h) |
2282 guchar *s_pix, *d_pix; | 2282 guchar *s_pix, *d_pix; |
2283 guchar *sp, *dp; | 2283 guchar *sp, *dp; |
2284 guchar *ip, *spi, *dpi; | 2284 guchar *ip, *spi, *dpi; |
2285 gint i, j; | 2285 gint i, j; |
2286 gint th = pr->tile_height; | 2286 gint th = pr->tile_height; |
2287 | 2287 |
2288 srs = gdk_pixbuf_get_rowstride(src); | 2288 srs = gdk_pixbuf_get_rowstride(src); |
2289 s_pix = gdk_pixbuf_get_pixels(src); | 2289 s_pix = gdk_pixbuf_get_pixels(src); |
2290 spi = s_pix + (x * COLOR_BYTES); | 2290 spi = s_pix + (x * COLOR_BYTES); |
2291 | 2291 |
2292 dest = pr_get_spare_tile(pr); | 2292 dest = pr_get_spare_tile(pr); |
2303 dp = ip - (j * drs); | 2303 dp = ip - (j * drs); |
2304 memcpy(dp, sp, COLOR_BYTES); | 2304 memcpy(dp, sp, COLOR_BYTES); |
2305 sp += COLOR_BYTES; | 2305 sp += COLOR_BYTES; |
2306 } | 2306 } |
2307 } | 2307 } |
2308 | 2308 |
2309 pr->spare_tile = src; | 2309 pr->spare_tile = src; |
2310 *tile = dest; | 2310 *tile = dest; |
2311 } | 2311 } |
2312 | 2312 |
2313 static void pr_tile_mirror_only(PixbufRenderer *pr, GdkPixbuf **tile, gint x, gint y, gint w, gint h) | 2313 static void pr_tile_mirror_only(PixbufRenderer *pr, GdkPixbuf **tile, gint x, gint y, gint w, gint h) |
2377 memcpy(dp, sp, COLOR_BYTES); | 2377 memcpy(dp, sp, COLOR_BYTES); |
2378 sp += COLOR_BYTES; | 2378 sp += COLOR_BYTES; |
2379 dp -= COLOR_BYTES; | 2379 dp -= COLOR_BYTES; |
2380 } | 2380 } |
2381 } | 2381 } |
2382 | 2382 |
2383 pr->spare_tile = src; | 2383 pr->spare_tile = src; |
2384 *tile = dest; | 2384 *tile = dest; |
2385 } | 2385 } |
2386 | 2386 |
2387 static void pr_tile_flip_only(PixbufRenderer *pr, GdkPixbuf **tile, gint x, gint y, gint w, gint h) | 2387 static void pr_tile_flip_only(PixbufRenderer *pr, GdkPixbuf **tile, gint x, gint y, gint w, gint h) |
2522 { | 2522 { |
2523 | 2523 |
2524 double src_x, src_y; | 2524 double src_x, src_y; |
2525 gint pb_x, pb_y; | 2525 gint pb_x, pb_y; |
2526 gint pb_w, pb_h; | 2526 gint pb_w, pb_h; |
2527 pr_tile_coords_map_orientation(pr, it->x, it->y, | 2527 pr_tile_coords_map_orientation(pr, it->x, it->y, |
2528 pr->image_width, pr->image_height, | 2528 pr->image_width, pr->image_height, |
2529 pr->tile_width, pr->tile_height, | 2529 pr->tile_width, pr->tile_height, |
2530 &src_x, &src_y); | 2530 &src_x, &src_y); |
2531 pr_tile_region_map_orientation(pr, x, y, | 2531 pr_tile_region_map_orientation(pr, x, y, |
2532 pr->tile_width, pr->tile_height, | 2532 pr->tile_width, pr->tile_height, |
2533 w, h, | 2533 w, h, |
2534 &pb_x, &pb_y, | 2534 &pb_x, &pb_y, |
2535 &pb_w, &pb_h); | 2535 &pb_w, &pb_h); |
2536 | 2536 |
2545 pr_tile_apply_orientation(pr, &it->pixbuf, pb_x, pb_y, pb_w, pb_h); | 2545 pr_tile_apply_orientation(pr, &it->pixbuf, pb_x, pb_y, pb_w, pb_h); |
2546 draw = TRUE; | 2546 draw = TRUE; |
2547 } | 2547 } |
2548 else | 2548 else |
2549 { | 2549 { |
2550 | 2550 |
2551 | 2551 |
2552 if (pr->orientation == EXIF_ORIENTATION_TOP_LEFT && !(pr->func_post_process && !(pr->post_process_slow && fast))) | 2552 if (pr->orientation == EXIF_ORIENTATION_TOP_LEFT && !(pr->func_post_process && !(pr->post_process_slow && fast))) |
2553 { | 2553 { |
2554 /* faster, simple, base orientation, no postprocessing */ | 2554 /* faster, simple, base orientation, no postprocessing */ |
2555 gdk_draw_pixbuf(it->pixmap, | 2555 gdk_draw_pixbuf(it->pixmap, |
2556 box->style->fg_gc[GTK_WIDGET_STATE(box)], | 2556 box->style->fg_gc[GTK_WIDGET_STATE(box)], |
2561 pr->dither_quality, it->x + x, it->y + y); | 2561 pr->dither_quality, it->x + x, it->y + y); |
2562 } | 2562 } |
2563 else | 2563 else |
2564 { | 2564 { |
2565 gdk_pixbuf_copy_area(pr->pixbuf, | 2565 gdk_pixbuf_copy_area(pr->pixbuf, |
2566 src_x + pb_x, src_y + pb_y, | 2566 src_x + pb_x, src_y + pb_y, |
2567 pb_w, pb_h, | 2567 pb_w, pb_h, |
2568 it->pixbuf, | 2568 it->pixbuf, |
2569 pb_x, pb_y); | 2569 pb_x, pb_y); |
2570 pr_tile_apply_orientation(pr, &it->pixbuf, pb_x, pb_y, pb_w, pb_h); | 2570 pr_tile_apply_orientation(pr, &it->pixbuf, pb_x, pb_y, pb_w, pb_h); |
2571 draw = TRUE; | 2571 draw = TRUE; |
2582 if (pr->image_width == 0 || pr->image_height == 0) return; | 2582 if (pr->image_width == 0 || pr->image_height == 0) return; |
2583 | 2583 |
2584 scale_x = (double)pr->width / pr->image_width; | 2584 scale_x = (double)pr->width / pr->image_width; |
2585 scale_y = (double)pr->height / pr->image_height; | 2585 scale_y = (double)pr->height / pr->image_height; |
2586 | 2586 |
2587 pr_tile_coords_map_orientation(pr, it->x / scale_x, it->y /scale_y , | 2587 pr_tile_coords_map_orientation(pr, it->x / scale_x, it->y /scale_y , |
2588 pr->image_width, pr->image_height, | 2588 pr->image_width, pr->image_height, |
2589 pr->tile_width / scale_x , pr->tile_height / scale_y, | 2589 pr->tile_width / scale_x , pr->tile_height / scale_y, |
2590 &src_x, &src_y); | 2590 &src_x, &src_y); |
2591 pr_tile_region_map_orientation(pr, x, y, | 2591 pr_tile_region_map_orientation(pr, x, y, |
2592 pr->tile_width, pr->tile_height, | 2592 pr->tile_width, pr->tile_height, |
2593 w, h, | 2593 w, h, |
2594 &pb_x, &pb_y, | 2594 &pb_x, &pb_y, |
2595 &pb_w, &pb_h); | 2595 &pb_w, &pb_h); |
2596 | 2596 |
2621 draw = TRUE; | 2621 draw = TRUE; |
2622 } | 2622 } |
2623 | 2623 |
2624 if (draw && it->pixbuf && !it->blank) | 2624 if (draw && it->pixbuf && !it->blank) |
2625 { | 2625 { |
2626 | 2626 |
2627 if (pr->func_post_process && !(pr->post_process_slow && fast)) | 2627 if (pr->func_post_process && !(pr->post_process_slow && fast)) |
2628 pr->func_post_process(pr, &it->pixbuf, x, y, w, h, pr->post_process_user_data); | 2628 pr->func_post_process(pr, &it->pixbuf, x, y, w, h, pr->post_process_user_data); |
2629 | 2629 |
2630 gdk_draw_pixbuf(it->pixmap, | 2630 gdk_draw_pixbuf(it->pixmap, |
2631 box->style->fg_gc[GTK_WIDGET_STATE(box)], | 2631 box->style->fg_gc[GTK_WIDGET_STATE(box)], |
2632 it->pixbuf, | 2632 it->pixbuf, |
2633 x, y, | 2633 x, y, |
2634 x, y, | 2634 x, y, |
3166 gdouble factor = (gdouble)pr->autofit_limit_size / 100; | 3166 gdouble factor = (gdouble)pr->autofit_limit_size / 100; |
3167 w = w * factor + 0.5; | 3167 w = w * factor + 0.5; |
3168 h = h * factor + 0.5; | 3168 h = h * factor + 0.5; |
3169 scale = scale * factor; | 3169 scale = scale * factor; |
3170 } | 3170 } |
3171 | 3171 |
3172 if (w < 1) w = 1; | 3172 if (w < 1) w = 1; |
3173 if (h < 1) h = 1; | 3173 if (h < 1) h = 1; |
3174 } | 3174 } |
3175 else | 3175 else |
3176 { | 3176 { |
3507 /* get or set coordinates of viewport center in the image, in range 0.0 - 1.0 */ | 3507 /* get or set coordinates of viewport center in the image, in range 0.0 - 1.0 */ |
3508 | 3508 |
3509 void pixbuf_renderer_get_scroll_center(PixbufRenderer *pr, gdouble *x, gdouble *y) | 3509 void pixbuf_renderer_get_scroll_center(PixbufRenderer *pr, gdouble *x, gdouble *y) |
3510 { | 3510 { |
3511 gint src_x, src_y; | 3511 gint src_x, src_y; |
3512 | 3512 |
3513 src_x = pr->x_scroll + pr->vis_width / 2; | 3513 src_x = pr->x_scroll + pr->vis_width / 2; |
3514 src_y = pr->y_scroll + pr->vis_height / 2; | 3514 src_y = pr->y_scroll + pr->vis_height / 2; |
3515 | 3515 |
3516 *x = (gdouble)src_x / pr->width; | 3516 *x = (gdouble)src_x / pr->width; |
3517 *y = (gdouble)src_y / pr->height; | 3517 *y = (gdouble)src_y / pr->height; |
3524 dst_x = x * pr->width - pr->vis_width / 2 - pr->x_scroll + CLAMP(pr->subpixel_x_scroll, -1.0, 1.0); | 3524 dst_x = x * pr->width - pr->vis_width / 2 - pr->x_scroll + CLAMP(pr->subpixel_x_scroll, -1.0, 1.0); |
3525 dst_y = y * pr->height - pr->vis_height / 2 - pr->y_scroll + CLAMP(pr->subpixel_y_scroll, -1.0, 1.0); | 3525 dst_y = y * pr->height - pr->vis_height / 2 - pr->y_scroll + CLAMP(pr->subpixel_y_scroll, -1.0, 1.0); |
3526 | 3526 |
3527 pr->subpixel_x_scroll = dst_x - (int)dst_x; | 3527 pr->subpixel_x_scroll = dst_x - (int)dst_x; |
3528 pr->subpixel_y_scroll = dst_y - (int)dst_y; | 3528 pr->subpixel_y_scroll = dst_y - (int)dst_y; |
3529 | 3529 |
3530 pixbuf_renderer_scroll(pr, (int)dst_x, (int)dst_y); | 3530 pixbuf_renderer_scroll(pr, (int)dst_x, (int)dst_y); |
3531 } | 3531 } |
3532 | 3532 |
3533 | 3533 |
3534 /* | 3534 /* |
3748 | 3748 |
3749 pr_update_signal(pr); | 3749 pr_update_signal(pr); |
3750 | 3750 |
3751 return; | 3751 return; |
3752 } | 3752 } |
3753 | 3753 |
3754 pr_pixbuf_size_sync(pr); | 3754 pr_pixbuf_size_sync(pr); |
3755 pr_zoom_sync(pr, zoom, TRUE, TRUE, FALSE, 0, 0); | 3755 pr_zoom_sync(pr, zoom, TRUE, TRUE, FALSE, 0, 0); |
3756 } | 3756 } |
3757 | 3757 |
3758 static void pr_set_pixbuf(PixbufRenderer *pr, GdkPixbuf *pixbuf, gdouble zoom) | 3758 static void pr_set_pixbuf(PixbufRenderer *pr, GdkPixbuf *pixbuf, gdouble zoom) |
3799 } | 3799 } |
3800 | 3800 |
3801 void pixbuf_renderer_set_post_process_func(PixbufRenderer *pr, PixbufRendererPostProcessFunc func, gpointer user_data, gint slow) | 3801 void pixbuf_renderer_set_post_process_func(PixbufRenderer *pr, PixbufRendererPostProcessFunc func, gpointer user_data, gint slow) |
3802 { | 3802 { |
3803 g_return_if_fail(IS_PIXBUF_RENDERER(pr)); | 3803 g_return_if_fail(IS_PIXBUF_RENDERER(pr)); |
3804 | 3804 |
3805 pr->func_post_process = func; | 3805 pr->func_post_process = func; |
3806 pr->post_process_user_data = user_data; | 3806 pr->post_process_user_data = user_data; |
3807 pr->post_process_slow = func && slow; | 3807 pr->post_process_slow = func && slow; |
3808 | 3808 |
3809 } | 3809 } |
3875 { | 3875 { |
3876 gint x, y, width, height, x1, y1, x2, y2; | 3876 gint x, y, width, height, x1, y1, x2, y2; |
3877 | 3877 |
3878 g_return_if_fail(IS_PIXBUF_RENDERER(pr)); | 3878 g_return_if_fail(IS_PIXBUF_RENDERER(pr)); |
3879 | 3879 |
3880 pr_coords_map_orientation_reverse(pr, | 3880 pr_coords_map_orientation_reverse(pr, |
3881 src_x, src_y, | 3881 src_x, src_y, |
3882 pr->image_width, pr->image_height, | 3882 pr->image_width, pr->image_height, |
3883 src_w, src_h, | 3883 src_w, src_h, |
3884 &x, &y, | 3884 &x, &y, |
3885 &width, &height); | 3885 &width, &height); |