Browse Source

ColorVector perf improvements

pull/180/head
James Jackson-South 9 years ago
parent
commit
6b6df21cb6
  1. 2
      src/ImageSharp/Colors/ColorVector.Definitions.cs
  2. 5
      src/ImageSharp/Colors/ColorVector.Transforms.cs
  3. 6
      src/ImageSharp/Colors/ColorVector.cs

2
src/ImageSharp/Colors/ColorVector.Definitions.cs

@ -6,7 +6,7 @@
namespace ImageSharp
{
/// <summary>
/// Unpacked pixel type containing four 8-bit unsigned normalized values ranging from 0 to 255.
/// Unpacked pixel type containing four 16-bit floating-point values typically ranging from 0 to 1.
/// The color components are stored in red, green, blue, and alpha order.
/// </summary>
/// <remarks>

5
src/ImageSharp/Colors/ColorVector.Transforms.cs

@ -6,9 +6,10 @@
namespace ImageSharp
{
using System.Numerics;
using System.Runtime.CompilerServices;
/// <summary>
/// Unpacked pixel type containing four 16-bit unsigned normalized values typically ranging from 0 to 1.
/// Unpacked pixel type containing four 16-bit floating-point values typically ranging from 0 to 1.
/// The color components are stored in red, green, blue, and alpha order.
/// </summary>
/// <remarks>
@ -25,6 +26,7 @@ namespace ImageSharp
/// <returns>
/// The <see cref="ColorVector"/>.
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ColorVector operator +(ColorVector left, ColorVector right)
{
return new ColorVector(left.backingVector + right.backingVector);
@ -38,6 +40,7 @@ namespace ImageSharp
/// <returns>
/// The <see cref="ColorVector"/>.
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ColorVector operator -(ColorVector left, ColorVector right)
{
return new ColorVector(left.backingVector - right.backingVector);

6
src/ImageSharp/Colors/ColorVector.cs

@ -9,7 +9,7 @@ namespace ImageSharp
using System.Runtime.CompilerServices;
/// <summary>
/// Unpacked pixel type containing four 16-bit unsigned normalized values typically ranging from 0 to 1.
/// Unpacked pixel type containing four 16-bit floating-point values typically ranging from 0 to 1.
/// The color components are stored in red, green, blue, and alpha order.
/// </summary>
/// <remarks>
@ -40,6 +40,7 @@ namespace ImageSharp
/// <param name="g">The green component.</param>
/// <param name="b">The blue component.</param>
/// <param name="a">The alpha component.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ColorVector(byte r, byte g, byte b, byte a = 255)
: this()
{
@ -53,6 +54,7 @@ namespace ImageSharp
/// <param name="g">The green component.</param>
/// <param name="b">The blue component.</param>
/// <param name="a">The alpha component.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ColorVector(float r, float g, float b, float a = 1)
: this()
{
@ -65,6 +67,7 @@ namespace ImageSharp
/// <param name="vector">
/// The vector containing the components for the packed vector.
/// </param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ColorVector(Vector3 vector)
: this()
{
@ -77,6 +80,7 @@ namespace ImageSharp
/// <param name="vector">
/// The vector containing the components for the packed vector.
/// </param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ColorVector(Vector4 vector)
: this()
{

Loading…
Cancel
Save