From 9bf4b3f15bdf67e4311e7ad64698223770cfe07f Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Fri, 9 Oct 2015 17:53:07 +1100 Subject: [PATCH] Remove clamp Former-commit-id: 2dcbdf421e60e21b7543077d790a6e70448766ab Former-commit-id: 116dca312640c2039254d29de1b7870f701ff48e Former-commit-id: c287b1f38c8a14cf1b69478fc949ee0d0c2df960 --- src/ImageProcessor/Common/Helpers/PixelOperations.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ImageProcessor/Common/Helpers/PixelOperations.cs b/src/ImageProcessor/Common/Helpers/PixelOperations.cs index 804236975c..0c4197de96 100644 --- a/src/ImageProcessor/Common/Helpers/PixelOperations.cs +++ b/src/ImageProcessor/Common/Helpers/PixelOperations.cs @@ -70,7 +70,7 @@ namespace ImageProcessor byte[] ramp = new byte[256]; for (int x = 0; x < 256; ++x) { - byte val = (byte)(255f * SrgbToLinear(x / 255f)).Clamp(0, 255); + byte val = (255f * SrgbToLinear(x / 255f)).ToByte(); ramp[x] = val; } @@ -89,7 +89,7 @@ namespace ImageProcessor byte[] ramp = new byte[256]; for (int x = 0; x < 256; ++x) { - byte val = (byte)(255f * LinearToSrgb(x / 255f)).Clamp(0, 255); + byte val = (255f * LinearToSrgb(x / 255f)).ToByte(); ramp[x] = val; }