Struct HunterLab
- Namespace
- SixLabors.ImageSharp.ColorProfiles
- Assembly
- SixLabors.ImageSharp.dll
Represents an Hunter LAB color. https://en.wikipedia.org/wiki/Lab_color_space.
public readonly struct HunterLab : IColorProfile<HunterLab, CieXyz>, IColorProfile<HunterLab>, IColorProfile, IEquatable<HunterLab>
- Implements
- Inherited Members
Constructors
HunterLab(Vector3)
Initializes a new instance of the HunterLab struct.
public HunterLab(Vector3 vector)
Parameters
vectorVector3The vector representing the l a b components.
HunterLab(float, float, float)
Initializes a new instance of the HunterLab struct.
public HunterLab(float l, float a, float b)
Parameters
lfloatThe lightness dimension.
afloatThe a (green - magenta) component.
bfloatThe b (blue - yellow) component.
Properties
A
Gets the a color component.
public float A { get; }
Property Value
B
Gets the b color component.
public float B { get; }
Property Value
L
Gets the lightness dimension.
public float L { get; }
Property Value
Methods
Equals(HunterLab)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(HunterLab other)
Parameters
otherHunterLabAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand 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 HunterLab FromProfileConnectingSpace(ColorConversionOptions options, in CieXyz source)
Parameters
optionsColorConversionOptionsThe color profile conversion options.
sourceCieXyzThe color profile connecting space.
Returns
FromProfileConnectionSpace(ColorConversionOptions, ReadOnlySpan<CieXyz>, Span<HunterLab>)
Converts the span of colors from the profile connection space.
public static void FromProfileConnectionSpace(ColorConversionOptions options, ReadOnlySpan<CieXyz> source, Span<HunterLab> destination)
Parameters
optionsColorConversionOptionsThe color profile conversion options.
sourceReadOnlySpan<CieXyz>The color profile span to convert from.
destinationSpan<HunterLab>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
public static HunterLab FromScaledVector4(Vector4 source)
Parameters
sourceVector4The vector to load the pixel from.
Returns
FromScaledVector4(ReadOnlySpan<Vector4>, Span<HunterLab>)
Converts the span of colors from a generic ("scaled") Vector4 representation
with values scaled and clamped between
public static void FromScaledVector4(ReadOnlySpan<Vector4> source, Span<HunterLab> destination)
Parameters
sourceReadOnlySpan<Vector4>The vector span to convert from.
destinationSpan<HunterLab>The color span to write the results to.
GetChromaticAdaptionWhitePointSource()
Gets the chromatic adaption white point source.
public static ChromaticAdaptionWhitePointSource GetChromaticAdaptionWhitePointSource()
Returns
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
optionsColorConversionOptionsThe color profile conversion options.
Returns
ToProfileConnectionSpace(ColorConversionOptions, ReadOnlySpan<HunterLab>, Span<CieXyz>)
Converts the span of colors to the profile connection space.
public static void ToProfileConnectionSpace(ColorConversionOptions options, ReadOnlySpan<HunterLab> source, Span<CieXyz> destination)
Parameters
optionsColorConversionOptionsThe color profile conversion options.
sourceReadOnlySpan<HunterLab>The color span to convert from.
destinationSpan<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
public Vector4 ToScaledVector4()
Returns
ToScaledVector4(ReadOnlySpan<HunterLab>, Span<Vector4>)
Converts the span of colors to a generic ("scaled") Vector4 representation
with values scaled and clamped between
public static void ToScaledVector4(ReadOnlySpan<HunterLab> source, Span<Vector4> destination)
Parameters
sourceReadOnlySpan<HunterLab>The color span to convert from.
destinationSpan<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 ==(HunterLab, HunterLab)
Compares two HunterLab objects for equality.
public static bool operator ==(HunterLab left, HunterLab right)
Parameters
leftHunterLabThe HunterLab on the left side of the operand.
rightHunterLabThe HunterLab on the right side of the operand.
Returns
- bool
True if the current left is equal to the
rightparameter; otherwise, false.
operator !=(HunterLab, HunterLab)
Compares two HunterLab objects for inequality
public static bool operator !=(HunterLab left, HunterLab right)
Parameters
leftHunterLabThe HunterLab on the left side of the operand.
rightHunterLabThe HunterLab on the right side of the operand.
Returns
- bool
True if the current left is unequal to the
rightparameter; otherwise, false.