📷 A modern, cross-platform, 2D Graphics library for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

28 lines
968 B

// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using System;
using System.Numerics;
namespace SixLabors.ImageSharp.PixelFormats
{
/// <content>
/// Provides optimized overrides for bulk operations.
/// </content>
public partial struct RgbaVector
{
/// <summary>
/// <see cref="PixelOperations{TPixel}"/> implementation optimized for <see cref="RgbaVector"/>.
/// </summary>
internal class PixelOperations : PixelOperations<RgbaVector>
{
/// <inheritdoc />
internal override unsafe void ToVector4(ReadOnlySpan<RgbaVector> sourceColors, Span<Vector4> destVectors, int count)
{
GuardSpans(sourceColors, nameof(sourceColors), destVectors, nameof(destVectors), count);
sourceColors.NonPortableCast<RgbaVector, Vector4>().Slice(0, count).CopyTo(destVectors);
}
}
}
}