Browse Source

Minor optimization

af/merge-core
James Jackson-South 8 years ago
parent
commit
a7ffeffcec
  1. 10
      src/ImageSharp/Quantizers/WuQuantizer{TPixel}.cs

10
src/ImageSharp/Quantizers/WuQuantizer{TPixel}.cs

@ -174,13 +174,13 @@ namespace SixLabors.ImageSharp.Quantizers
if (MathF.Abs(weight) > Constants.Epsilon) if (MathF.Abs(weight) > Constants.Epsilon)
{ {
float r = Volume(this.colorCube[k], this.vmr) / weight; float r = Volume(this.colorCube[k], this.vmr);
float g = Volume(this.colorCube[k], this.vmg) / weight; float g = Volume(this.colorCube[k], this.vmg);
float b = Volume(this.colorCube[k], this.vmb) / weight; float b = Volume(this.colorCube[k], this.vmb);
float a = Volume(this.colorCube[k], this.vma) / weight; float a = Volume(this.colorCube[k], this.vma);
ref TPixel color = ref this.palette[k]; ref TPixel color = ref this.palette[k];
color.PackFromVector4(new Vector4(r, g, b, a) / 255F); color.PackFromVector4(new Vector4(r, g, b, a) / weight / 255F);
} }
} }
} }

Loading…
Cancel
Save