From 90780d96b846a0939f397909005c5c1821d03195 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Mon, 11 Apr 2016 18:31:35 +0100 Subject: [PATCH] Ensure premultiply fast-path for RGBA is used. Add A suffix to PRE_RGBA macro name to clarify use with 4 bands. --- libvips/conversion/premultiply.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libvips/conversion/premultiply.c b/libvips/conversion/premultiply.c index 11e7466d..a0d1e6c6 100644 --- a/libvips/conversion/premultiply.c +++ b/libvips/conversion/premultiply.c @@ -87,7 +87,7 @@ G_DEFINE_TYPE( VipsPremultiply, vips_premultiply, VIPS_TYPE_CONVERSION ); /* Special case for RGBA, it's very common. */ -#define PRE_RGB( IN, OUT ) { \ +#define PRE_RGBA( IN, OUT ) { \ IN * restrict p = (IN *) in; \ OUT * restrict q = (OUT *) out; \ \ @@ -107,8 +107,8 @@ G_DEFINE_TYPE( VipsPremultiply, vips_premultiply, VIPS_TYPE_CONVERSION ); } #define PRE( IN, OUT ) { \ - if( bands == 3 ) { \ - PRE_RGB( IN, OUT ); \ + if( bands == 4 ) { \ + PRE_RGBA( IN, OUT ); \ } \ else { \ PRE_MANY( IN, OUT ); \