mirror of https://github.com/SixLabors/ImageSharp
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.
35 lines
1.2 KiB
35 lines
1.2 KiB
// Copyright (c) Six Labors.
|
|
// Licensed under the Apache License, Version 2.0.
|
|
|
|
using System.Buffers;
|
|
using System.Numerics;
|
|
using SixLabors.ImageSharp.Memory;
|
|
using SixLabors.ImageSharp.PixelFormats;
|
|
using Xunit;
|
|
|
|
namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
|
|
{
|
|
public partial class PixelOperationsTests
|
|
{
|
|
public partial class Rgba32_OperationsTests : PixelOperationsTests<Rgba32>
|
|
{
|
|
[Fact(Skip = SkipProfilingBenchmarks)]
|
|
public void Benchmark_ToVector4()
|
|
{
|
|
const int times = 200000;
|
|
const int count = 1024;
|
|
|
|
using (IMemoryOwner<Rgba32> source = Configuration.Default.MemoryAllocator.Allocate<Rgba32>(count))
|
|
using (IMemoryOwner<Vector4> dest = Configuration.Default.MemoryAllocator.Allocate<Vector4>(count))
|
|
{
|
|
this.Measure(
|
|
times,
|
|
() => PixelOperations<Rgba32>.Instance.ToVector4(
|
|
this.Configuration,
|
|
source.GetSpan(),
|
|
dest.GetSpan()));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|