Skip to content

Commit

Permalink
Merge pull request #1435 from SixLabors/sp/rgbavector-conversion-speedup
Browse files Browse the repository at this point in the history
PixelOperations<TPixel>.From<RgbaVector> speedup
  • Loading branch information
JimBobSquarePants authored Nov 21, 2020
2 parents a9f82cd + 9236cb1 commit f5aa249
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ internal class PixelOperations : PixelOperations<RgbaVector>
/// <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,
Expand Down

0 comments on commit f5aa249

Please sign in to comment.