Simplify 94481a9

This commit is contained in:
Kleis Auke Wolthuizen 2025-05-13 17:19:02 +02:00 committed by Lovell Fuller
parent d36fd5064d
commit db3a4528eb

View File

@ -995,9 +995,8 @@ namespace sharp {
}
// Add alpha channel(s) to alphaColour colour
if (colour[3] < 255.0 || image.has_alpha()) {
do {
alphaColour.push_back(colour[3] * multiplier);
} while (alphaColour.size() < static_cast<size_t>(image.bands()));
int extraBands = image.bands() > 4 ? image.bands() - 3 : 1;
alphaColour.insert(alphaColour.end(), extraBands, colour[3] * multiplier);
}
// Ensure alphaColour colour uses correct colourspace
alphaColour = sharp::GetRgbaAsColourspace(alphaColour, image.interpretation(), premultiply);