Browse Source
Merge pull request #982 from SimonCropp/cacheMaxInConvertToRgba
cache max in ConvertToRgba
af/merge-core
Anton Firsov
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
8 additions and
20 deletions
-
src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromCmyk.cs
-
src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromGrayScale.cs
-
src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromRgb.cs
-
src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromYccK.cs
|
|
|
@ -25,11 +25,8 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder.ColorConverters |
|
|
|
|
|
|
|
var v = new Vector4(0, 0, 0, 1F); |
|
|
|
|
|
|
|
var scale = new Vector4( |
|
|
|
1 / this.MaximumValue, |
|
|
|
1 / this.MaximumValue, |
|
|
|
1 / this.MaximumValue, |
|
|
|
1F); |
|
|
|
var maximum = 1 / this.MaximumValue; |
|
|
|
var scale = new Vector4(maximum, maximum, maximum, 1F); |
|
|
|
|
|
|
|
for (int i = 0; i < result.Length; i++) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -19,11 +19,8 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder.ColorConverters |
|
|
|
|
|
|
|
public override void ConvertToRgba(in ComponentValues values, Span<Vector4> result) |
|
|
|
{ |
|
|
|
var scale = new Vector4( |
|
|
|
1 / this.MaximumValue, |
|
|
|
1 / this.MaximumValue, |
|
|
|
1 / this.MaximumValue, |
|
|
|
1F); |
|
|
|
var maximum = 1 / this.MaximumValue; |
|
|
|
var scale = new Vector4(maximum, maximum, maximum, 1F); |
|
|
|
|
|
|
|
ref float sBase = ref MemoryMarshal.GetReference(values.Component0); |
|
|
|
ref Vector4 dBase = ref MemoryMarshal.GetReference(result); |
|
|
|
|
|
|
|
@ -24,11 +24,8 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder.ColorConverters |
|
|
|
|
|
|
|
var v = new Vector4(0, 0, 0, 1); |
|
|
|
|
|
|
|
var scale = new Vector4( |
|
|
|
1 / this.MaximumValue, |
|
|
|
1 / this.MaximumValue, |
|
|
|
1 / this.MaximumValue, |
|
|
|
1F); |
|
|
|
var maximum = 1 / this.MaximumValue; |
|
|
|
var scale = new Vector4(maximum, maximum, maximum, 1F); |
|
|
|
|
|
|
|
for (int i = 0; i < result.Length; i++) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -25,11 +25,8 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder.ColorConverters |
|
|
|
|
|
|
|
var v = new Vector4(0, 0, 0, 1F); |
|
|
|
|
|
|
|
var scale = new Vector4( |
|
|
|
1 / this.MaximumValue, |
|
|
|
1 / this.MaximumValue, |
|
|
|
1 / this.MaximumValue, |
|
|
|
1F); |
|
|
|
var maximum = 1 / this.MaximumValue; |
|
|
|
var scale = new Vector4(maximum, maximum, maximum, 1F); |
|
|
|
|
|
|
|
for (int i = 0; i < result.Length; i++) |
|
|
|
{ |
|
|
|
|