Add support for clipping/cutting out (#435) (#448)

USAGE: overlayWith('overlayimage.png', { cutout: true } )
This commit is contained in:
Kleis Auke Wolthuizen
2016-06-25 17:48:01 +02:00
committed by Lovell Fuller
parent f1ead06645
commit 2e9cd83ed2
21 changed files with 167 additions and 10 deletions

View File

@@ -277,4 +277,17 @@ namespace sharp {
return std::make_tuple(left, top);
}
/*
Return the image alpha maximum. Useful for combining alpha bands. scRGB
images are 0 - 1 for image data, but the alpha is 0 - 255.
*/
int MaximumImageAlpha(VipsInterpretation interpretation) {
if(interpretation == VIPS_INTERPRETATION_RGB16 ||
interpretation == VIPS_INTERPRETATION_GREY16) {
return (65535);
} else {
return (255);
}
}
} // namespace sharp