Browse Source
Merge pull request #1435 from SixLabors/sp/rgbavector-conversion-speedup
PixelOperations<TPixel>.From<RgbaVector> speedup
js/color-alpha-handling
James Jackson-South
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
11 additions and
0 deletions
-
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/RgbaVector.PixelOperations.cs
|
|
|
@ -26,6 +26,17 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// <inheritdoc />
|
|
|
|
public override PixelTypeInfo GetPixelTypeInfo() => LazyInfo.Value; |
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
public override void From<TSourcePixel>( |
|
|
|
Configuration configuration, |
|
|
|
ReadOnlySpan<TSourcePixel> sourcePixels, |
|
|
|
Span<RgbaVector> destinationPixels) |
|
|
|
{ |
|
|
|
Span<Vector4> destinationVectors = MemoryMarshal.Cast<RgbaVector, Vector4>(destinationPixels); |
|
|
|
|
|
|
|
PixelOperations<TSourcePixel>.Instance.ToVector4(configuration, sourcePixels, destinationVectors); |
|
|
|
} |
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
public override void FromVector4Destructive( |
|
|
|
Configuration configuration, |
|
|
|
|