|
44 | 44 |
|
45 | 45 | /*
|
46 | 46 | #define DEBUG_VERBOSE
|
47 |
| - */ |
48 | 47 | #define DEBUG
|
| 48 | + */ |
49 | 49 |
|
50 | 50 | #ifdef HAVE_CONFIG_H
|
51 | 51 | #include <config.h>
|
@@ -151,7 +151,7 @@ typedef struct {
|
151 | 151 | } Read;
|
152 | 152 |
|
153 | 153 | static void
|
154 |
| -vips_image_paint_pel( VipsImage *image, const VipsRect *r, const VipsPel *ink ) |
| 154 | +vips_image_paint_area( VipsImage *image, const VipsRect *r, const VipsPel *ink ) |
155 | 155 | {
|
156 | 156 | VipsRect valid = { 0, 0, image->Xsize, image->Ysize };
|
157 | 157 | VipsRect ovl;
|
@@ -189,6 +189,14 @@ vips_image_paint_pel( VipsImage *image, const VipsRect *r, const VipsPel *ink )
|
189 | 189 | }
|
190 | 190 | }
|
191 | 191 |
|
| 192 | +static void |
| 193 | +vips_image_paint( VipsImage *image, const VipsPel *ink ) |
| 194 | +{ |
| 195 | + VipsRect area = { 0, 0, image->Xsize, image->Ysize }; |
| 196 | + |
| 197 | + vips_image_paint_area( image, &area, ink ); |
| 198 | +} |
| 199 | + |
192 | 200 | /* Blend two guint8.
|
193 | 201 | */
|
194 | 202 | #define BLEND( X, aX, Y, aY, scale ) \
|
@@ -399,7 +407,6 @@ read_header( Read *read, VipsImage *out )
|
399 | 407 | int canvas_height;
|
400 | 408 | int flags;
|
401 | 409 | int i;
|
402 |
| - VipsRect area; |
403 | 410 |
|
404 | 411 | data.bytes = read->data;
|
405 | 412 | data.size = read->length;
|
@@ -528,12 +535,7 @@ read_header( Read *read, VipsImage *out )
|
528 | 535 | if( vips_image_write_prepare( read->frame ) )
|
529 | 536 | return( -1 );
|
530 | 537 |
|
531 |
| - area.left = 0; |
532 |
| - area.top = 0; |
533 |
| - area.width = read->frame_width; |
534 |
| - area.height = read->frame_height; |
535 |
| - vips_image_paint_pel( read->frame, |
536 |
| - &area, (VipsPel *) &read->background ); |
| 538 | + vips_image_paint( read->frame, (VipsPel *) &read->background ); |
537 | 539 |
|
538 | 540 | vips_image_init_fields( out,
|
539 | 541 | read->width, read->height,
|
@@ -626,7 +628,7 @@ read_next_frame( Read *read )
|
626 | 628 | /* We must clear the pixels occupied by this webp frame (not
|
627 | 629 | * the whole of the read frame) to the background colour.
|
628 | 630 | */
|
629 |
| - vips_image_paint_pel( read->frame, |
| 631 | + vips_image_paint_area( read->frame, |
630 | 632 | &read->dispose_rect, (VipsPel *) &read->background );
|
631 | 633 |
|
632 | 634 | /* Note this frame's dispose for next time.
|
|
0 commit comments