Merge pull request #420 from lovell/premultiply-bands-4
Ensure premultiply fast-path for RGBA is used
This commit is contained in:
commit
263b93aaea
|
@ -87,7 +87,7 @@ G_DEFINE_TYPE( VipsPremultiply, vips_premultiply, VIPS_TYPE_CONVERSION );
|
||||||
|
|
||||||
/* Special case for RGBA, it's very common.
|
/* Special case for RGBA, it's very common.
|
||||||
*/
|
*/
|
||||||
#define PRE_RGB( IN, OUT ) { \
|
#define PRE_RGBA( IN, OUT ) { \
|
||||||
IN * restrict p = (IN *) in; \
|
IN * restrict p = (IN *) in; \
|
||||||
OUT * restrict q = (OUT *) out; \
|
OUT * restrict q = (OUT *) out; \
|
||||||
\
|
\
|
||||||
|
@ -107,8 +107,8 @@ G_DEFINE_TYPE( VipsPremultiply, vips_premultiply, VIPS_TYPE_CONVERSION );
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PRE( IN, OUT ) { \
|
#define PRE( IN, OUT ) { \
|
||||||
if( bands == 3 ) { \
|
if( bands == 4 ) { \
|
||||||
PRE_RGB( IN, OUT ); \
|
PRE_RGBA( IN, OUT ); \
|
||||||
} \
|
} \
|
||||||
else { \
|
else { \
|
||||||
PRE_MANY( IN, OUT ); \
|
PRE_MANY( IN, OUT ); \
|
||||||
|
|
Loading…
Reference in New Issue