Struct CieLch
- Namespace
- SixLabors.ImageSharp.ColorProfiles
- Assembly
- SixLabors.ImageSharp.dll
Represents the CIE LCh°, cylindrical form of the CIE Lab* 1976 color. https://en.wikipedia.org/wiki/Lab_color_space#Cylindrical_representation:_CIELCh_or_CIEHLC
public readonly struct CieLch : IColorProfile<CieLch, CieLab>, IColorProfile<CieLch>, IColorProfile, IEquatable<CieLch>
- Implements
- Inherited Members
Constructors
CieLch(Vector3)
Initializes a new instance of the CieLch struct.
public CieLch(Vector3 vector)
Parameters
vectorVector3The vector representing the l, c, h components.
CieLch(float, float, float)
Initializes a new instance of the CieLch struct.
public CieLch(float l, float c, float h)
Parameters
lfloatThe lightness dimension.
cfloatThe chroma, relative saturation.
hfloatThe hue in degrees.
Properties
C
Gets the a chroma component.
public float C { get; }
Property Value
H
Gets the h° hue component in degrees.
public float H { get; }
Property Value
L
Gets the lightness dimension.
public float L { get; }
Property Value
Methods
Equals(CieLch)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(CieLch other)
Parameters
otherCieLchAn 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 CieLab)
Initializes the color instance from the profile connection space.
public static CieLch FromProfileConnectingSpace(ColorConversionOptions options, in CieLab source)
Parameters
optionsColorConversionOptionsThe color profile conversion options.
sourceCieLabThe color profile connecting space.
Returns
FromProfileConnectionSpace(ColorConversionOptions, ReadOnlySpan<CieLab>, Span<CieLch>)
Converts the span of colors from the profile connection space.
public static void FromProfileConnectionSpace(ColorConversionOptions options, ReadOnlySpan<CieLab> source, Span<CieLch> destination)
Parameters
optionsColorConversionOptionsThe color profile conversion options.
sourceReadOnlySpan<CieLab>The color profile span to convert from.
destinationSpan<CieLch>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 CieLch FromScaledVector4(Vector4 source)
Parameters
sourceVector4The vector to load the pixel from.
Returns
FromScaledVector4(ReadOnlySpan<Vector4>, Span<CieLch>)
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<CieLch> destination)
Parameters
sourceReadOnlySpan<Vector4>The vector span to convert from.
destinationSpan<CieLch>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 CieLab ToProfileConnectingSpace(ColorConversionOptions options)
Parameters
optionsColorConversionOptionsThe color profile conversion options.
Returns
ToProfileConnectionSpace(ColorConversionOptions, ReadOnlySpan<CieLch>, Span<CieLab>)
Converts the span of colors to the profile connection space.
public static void ToProfileConnectionSpace(ColorConversionOptions options, ReadOnlySpan<CieLch> source, Span<CieLab> destination)
Parameters
optionsColorConversionOptionsThe color profile conversion options.
sourceReadOnlySpan<CieLch>The color span to convert from.
destinationSpan<CieLab>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<CieLch>, Span<Vector4>)
Converts the span of colors to a generic ("scaled") Vector4 representation
with values scaled and clamped between
public static void ToScaledVector4(ReadOnlySpan<CieLch> source, Span<Vector4> destination)
Parameters
sourceReadOnlySpan<CieLch>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 ==(CieLch, CieLch)
Compares two CieLch objects for equality.
public static bool operator ==(CieLch left, CieLch right)
Parameters
leftCieLchThe CieLch on the left side of the operand.
rightCieLchThe CieLch on the right side of the operand.
Returns
- bool
True if the current left is equal to the
rightparameter; otherwise, false.
operator !=(CieLch, CieLch)
Compares two CieLch objects for inequality
public static bool operator !=(CieLch left, CieLch right)
Parameters
leftCieLchThe CieLch on the left side of the operand.
rightCieLchThe CieLch on the right side of the operand.
Returns
- bool
True if the current left is unequal to the
rightparameter; otherwise, false.