Kaydet (Commit) d7817c54 authored tarafından Noel Grandin's avatar Noel Grandin

BitmapColor::GetLuminance doesn't need to use unsigned long

Change-Id: Ic0f4c2c7576023a96266116a1237190586e4e816
Reviewed-on: https://gerrit.libreoffice.org/44316Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 149247ec
......@@ -470,7 +470,9 @@ inline BitmapColor& BitmapColor::Invert()
inline sal_uInt8 BitmapColor::GetLuminance() const
{
assert( !mbIndex && "Pixel represents index into colortable" );
return (static_cast<unsigned long>(mcBlueOrIndex) * 28UL + static_cast<unsigned long>(mcGreen) * 151UL + static_cast<unsigned long>(mcRed) * 77UL) >> 8;
return (static_cast<sal_uInt32>(mcBlueOrIndex) * 28
+ static_cast<sal_uInt32>(mcGreen) * 151
+ static_cast<sal_uInt32>(mcRed) * 77) >> 8;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment