Skip to content

Commit c8ba6fc

Browse files
committed
tiny cleanups
1 parent ce24917 commit c8ba6fc

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

libvips/foreign/webp2vips.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444

4545
/*
4646
#define DEBUG_VERBOSE
47-
*/
4847
#define DEBUG
48+
*/
4949

5050
#ifdef HAVE_CONFIG_H
5151
#include <config.h>
@@ -151,7 +151,7 @@ typedef struct {
151151
} Read;
152152

153153
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 )
155155
{
156156
VipsRect valid = { 0, 0, image->Xsize, image->Ysize };
157157
VipsRect ovl;
@@ -189,6 +189,14 @@ vips_image_paint_pel( VipsImage *image, const VipsRect *r, const VipsPel *ink )
189189
}
190190
}
191191

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+
192200
/* Blend two guint8.
193201
*/
194202
#define BLEND( X, aX, Y, aY, scale ) \
@@ -399,7 +407,6 @@ read_header( Read *read, VipsImage *out )
399407
int canvas_height;
400408
int flags;
401409
int i;
402-
VipsRect area;
403410

404411
data.bytes = read->data;
405412
data.size = read->length;
@@ -528,12 +535,7 @@ read_header( Read *read, VipsImage *out )
528535
if( vips_image_write_prepare( read->frame ) )
529536
return( -1 );
530537

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 );
537539

538540
vips_image_init_fields( out,
539541
read->width, read->height,
@@ -626,7 +628,7 @@ read_next_frame( Read *read )
626628
/* We must clear the pixels occupied by this webp frame (not
627629
* the whole of the read frame) to the background colour.
628630
*/
629-
vips_image_paint_pel( read->frame,
631+
vips_image_paint_area( read->frame,
630632
&read->dispose_rect, (VipsPel *) &read->background );
631633

632634
/* Note this frame's dispose for next time.

0 commit comments

Comments
 (0)