|
|
|
@ -50,7 +50,7 @@ typedef struct {
|
|
|
|
double Background[3];
|
|
|
|
double Background[3];
|
|
|
|
} WatermarkOptions;
|
|
|
|
} WatermarkOptions;
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
static unsigned long
|
|
|
|
has_profile_embed(VipsImage *image) {
|
|
|
|
has_profile_embed(VipsImage *image) {
|
|
|
|
return vips_image_get_typeof(image, VIPS_META_ICC_NAME);
|
|
|
|
return vips_image_get_typeof(image, VIPS_META_ICC_NAME);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -247,11 +247,21 @@ vips_webpsave_bridge(VipsImage *in, void **buf, size_t *len, int strip, int qual
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
|
|
|
vips_is_16bit (VipsInterpretation interpretation) {
|
|
|
|
|
|
|
|
return interpretation == VIPS_INTERPRETATION_RGB16 || interpretation == VIPS_INTERPRETATION_GREY16;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
int
|
|
|
|
vips_flatten_background_brigde(VipsImage *in, VipsImage **out, double background[3]) {
|
|
|
|
vips_flatten_background_brigde(VipsImage *in, VipsImage **out, double background[3]) {
|
|
|
|
|
|
|
|
background[0] *= 256;
|
|
|
|
|
|
|
|
background[1] *= 256;
|
|
|
|
|
|
|
|
background[2] *= 256;
|
|
|
|
|
|
|
|
|
|
|
|
VipsArrayDouble *vipsBackground = vips_array_double_new(background, 3);
|
|
|
|
VipsArrayDouble *vipsBackground = vips_array_double_new(background, 3);
|
|
|
|
return vips_flatten(in, out,
|
|
|
|
return vips_flatten(in, out,
|
|
|
|
"background", vipsBackground,
|
|
|
|
"background", vipsBackground,
|
|
|
|
|
|
|
|
"max_alpha", vips_is_16bit(in->Type) ? 65535.0 : 255.0,
|
|
|
|
NULL
|
|
|
|
NULL
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|