Table of Contents

Struct Lms

Namespace
SixLabors.ImageSharp.ColorProfiles
Assembly
SixLabors.ImageSharp.dll

LMS is a color space represented by the response of the three types of cones of the human eye, named after their responsivity (sensitivity) at long, medium and short wavelengths. https://en.wikipedia.org/wiki/LMS_color_space

public readonly struct Lms : IColorProfile<Lms, CieXyz>, IColorProfile<Lms>, IColorProfile, IEquatable<Lms>
Implements
Inherited Members

Constructors

Lms(Vector3)

Initializes a new instance of the Lms struct.

public Lms(Vector3 vector)

Parameters

vector Vector3

The vector representing the l, m, s components.

Lms(float, float, float)

Initializes a new instance of the Lms struct.

public Lms(float l, float m, float s)

Parameters

l float

L represents the responsivity at long wavelengths.

m float

M represents the responsivity at medium wavelengths.

s float

S represents the responsivity at short wavelengths.

Properties

L

Gets the L long component. A value usually ranging between -1 and 1.

public float L { get; }

Property Value

float

M

Gets the M medium component. A value usually ranging between -1 and 1.

public float M { get; }

Property Value

float

S

Gets the S short component. A value usually ranging between -1 and 1.

public float S { get; }

Property Value

float

Methods

Equals(Lms)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(Lms other)

Parameters

other Lms

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

FromProfileConnectingSpace(ColorConversionOptions, in CieXyz)

Initializes the color instance from the profile connection space.

public static Lms FromProfileConnectingSpace(ColorConversionOptions options, in CieXyz source)

Parameters

options ColorConversionOptions

The color profile conversion options.

source CieXyz

The color profile connecting space.

Returns

Lms

The Lms.

FromProfileConnectionSpace(ColorConversionOptions, ReadOnlySpan<CieXyz>, Span<Lms>)

Converts the span of colors from the profile connection space.

public static void FromProfileConnectionSpace(ColorConversionOptions options, ReadOnlySpan<CieXyz> source, Span<Lms> destination)

Parameters

options ColorConversionOptions

The color profile conversion options.

source ReadOnlySpan<CieXyz>

The color profile span to convert from.

destination Span<Lms>

The color span to write the results to.

FromScaledVector4(Vector4)

Initializes the color instance from a generic a generic ("scaled") Vector4 representation with values scaled and clamped between 0 and 1.

public static Lms FromScaledVector4(Vector4 source)

Parameters

source Vector4

The vector to load the pixel from.

Returns

Lms

The Lms.

FromScaledVector4(ReadOnlySpan<Vector4>, Span<Lms>)

Converts the span of colors from a generic ("scaled") Vector4 representation with values scaled and clamped between 0 and 1.

public static void FromScaledVector4(ReadOnlySpan<Vector4> source, Span<Lms> destination)

Parameters

source ReadOnlySpan<Vector4>

The vector span to convert from.

destination Span<Lms>

The color span to write the results to.

GetChromaticAdaptionWhitePointSource()

Gets the chromatic adaption white point source.

public static ChromaticAdaptionWhitePointSource GetChromaticAdaptionWhitePointSource()

Returns

ChromaticAdaptionWhitePointSource

The ChromaticAdaptionWhitePointSource.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

ToProfileConnectingSpace(ColorConversionOptions)

Converts the color to the profile connection space.

public CieXyz ToProfileConnectingSpace(ColorConversionOptions options)

Parameters

options ColorConversionOptions

The color profile conversion options.

Returns

CieXyz

The CieXyz.

ToProfileConnectionSpace(ColorConversionOptions, ReadOnlySpan<Lms>, Span<CieXyz>)

Converts the span of colors to the profile connection space.

public static void ToProfileConnectionSpace(ColorConversionOptions options, ReadOnlySpan<Lms> source, Span<CieXyz> destination)

Parameters

options ColorConversionOptions

The color profile conversion options.

source ReadOnlySpan<Lms>

The color span to convert from.

destination Span<CieXyz>

The color profile span to write the results to.

ToScaledVector4()

Expands the pixel into a generic ("scaled") Vector4 representation with values scaled and clamped between 0 and 1. The vector components are typically expanded in least to greatest significance order.

public Vector4 ToScaledVector4()

Returns

Vector4

The Vector4.

ToScaledVector4(ReadOnlySpan<Lms>, Span<Vector4>)

Converts the span of colors to a generic ("scaled") Vector4 representation with values scaled and clamped between 0 and 1.

public static void ToScaledVector4(ReadOnlySpan<Lms> source, Span<Vector4> destination)

Parameters

source ReadOnlySpan<Lms>

The color span to convert from.

destination Span<Vector4>

The vector span to write the results to.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Operators

operator ==(Lms, Lms)

Compares two Lms objects for equality.

public static bool operator ==(Lms left, Lms right)

Parameters

left Lms

The Lms on the left side of the operand.

right Lms

The Lms on the right side of the operand.

Returns

bool

True if the current left is equal to the right parameter; otherwise, false.

operator !=(Lms, Lms)

Compares two Lms objects for inequality.

public static bool operator !=(Lms left, Lms right)

Parameters

left Lms

The Lms on the left side of the operand.

right Lms

The Lms on the right side of the operand.

Returns

bool

True if the current left is unequal to the right parameter; otherwise, false.