Browse Source

Remove clamp

Former-commit-id: 2dcbdf421e60e21b7543077d790a6e70448766ab
Former-commit-id: 116dca312640c2039254d29de1b7870f701ff48e
Former-commit-id: c287b1f38c8a14cf1b69478fc949ee0d0c2df960
af/merge-core
James Jackson-South 11 years ago
parent
commit
9bf4b3f15b
  1. 4
      src/ImageProcessor/Common/Helpers/PixelOperations.cs

4
src/ImageProcessor/Common/Helpers/PixelOperations.cs

@ -70,7 +70,7 @@ namespace ImageProcessor
byte[] ramp = new byte[256]; byte[] ramp = new byte[256];
for (int x = 0; x < 256; ++x) 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; ramp[x] = val;
} }
@ -89,7 +89,7 @@ namespace ImageProcessor
byte[] ramp = new byte[256]; byte[] ramp = new byte[256];
for (int x = 0; x < 256; ++x) 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; ramp[x] = val;
} }

Loading…
Cancel
Save