/// <inheritdoc /> internal override void ToVector4( Configuration configuration, ReadOnlySpan <RgbaVector> sourcePixels, Span <Vector4> destVectors, PixelConversionModifiers modifiers) { Guard.DestinationShouldNotBeTooShort(sourcePixels, destVectors, nameof(destVectors)); MemoryMarshal.Cast <RgbaVector, Vector4>(sourcePixels).CopyTo(destVectors); Vector4Converters.ApplyForwardConversionModifiers(destVectors, modifiers); }
/// <inheritdoc /> public override void ToVector4( Configuration configuration, ReadOnlySpan <Rgba32> sourcePixels, Span <Vector4> destinationVectors, PixelConversionModifiers modifiers) { Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationVectors, nameof(destinationVectors)); destinationVectors = destinationVectors.Slice(0, sourcePixels.Length); SimdUtils.ByteToNormalizedFloat( MemoryMarshal.Cast <Rgba32, byte>(sourcePixels), MemoryMarshal.Cast <Vector4, float>(destinationVectors)); Vector4Converters.ApplyForwardConversionModifiers(destinationVectors, modifiers); }