Browse Source
Use Math.Clamp(input, 0, 255)
Co-authored-by: Günther Foidl <gue@korporal.at>
pull/1731/head
Brian Popow
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
src/ImageSharp/Formats/Tiff/PhotometricInterpretation/YCbCrConverter.cs
|
|
|
@ -68,7 +68,7 @@ namespace SixLabors.ImageSharp.Formats.Tiff.PhotometricInterpretation |
|
|
|
private static byte RoundAndClampTo8Bit(float value) |
|
|
|
{ |
|
|
|
int input = (int)MathF.Round(value); |
|
|
|
return (byte)Math.Min(Math.Max(input, 0), 255); |
|
|
|
return (byte)Math.Clamp(input, 0, 255); |
|
|
|
} |
|
|
|
|
|
|
|
private readonly struct CodingRangeExpander |
|
|
|
|