From 94201ea941d69f2508f20ede546ceac7feb02aed 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: a40778b4016da2cac12d09185aaf98117332acc8 Former-commit-id: d165853bbbfaf1f33d1a653f3e0f63761bb17c71 Former-commit-id: 66e49046205dc7722b8351957608bf136f168436 --- 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 804236975..0c4197de9 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; }