Table of Contents

Class ColorProfileConverterExtensionsCieXyzCieXyz

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

Allows conversion between two color profiles based on the CIE XYZ color space.

public static class ColorProfileConverterExtensionsCieXyzCieXyz
Inheritance
ColorProfileConverterExtensionsCieXyzCieXyz
Inherited Members

Methods

Convert<TFrom, TTo>(ColorProfileConverter, ReadOnlySpan<TFrom>, Span<TTo>)

Converts a span of color values from one color profile to another using the specified color profile converter.

public static void Convert<TFrom, TTo>(this ColorProfileConverter converter, ReadOnlySpan<TFrom> source, Span<TTo> destination) where TFrom : struct, IColorProfile<TFrom, CieXyz> where TTo : struct, IColorProfile<TTo, CieXyz>

Parameters

converter ColorProfileConverter

The color profile converter to use for the conversion operation.

source ReadOnlySpan<TFrom>

A read-only span containing the source color values to convert.

destination Span<TTo>

A span that receives the converted color values. Must be at least as long as the source span.

Type Parameters

TFrom

The type representing the source color profile. Must implement IColorProfile<TSelf, TProfileSpace>.

TTo

The type representing the destination color profile. Must implement IColorProfile<TSelf, TProfileSpace>.

Remarks

This method performs color conversion between two color profiles, handling necessary transformations such as profile connection space conversion and chromatic adaptation. If ICC profiles are available and applicable, the conversion uses them for improved accuracy. The method does not allocate memory for the destination; the caller is responsible for providing a suitably sized span.

Convert<TFrom, TTo>(ColorProfileConverter, in TFrom)

Converts a color value from one color profile to another using the specified color profile converter.

public static TTo Convert<TFrom, TTo>(this ColorProfileConverter converter, in TFrom source) where TFrom : struct, IColorProfile<TFrom, CieXyz> where TTo : struct, IColorProfile<TTo, CieXyz>

Parameters

converter ColorProfileConverter

The color profile converter to use for the conversion.

source TFrom

The source color value to convert.

Returns

TTo

A value of type TTo representing the converted color in the target color profile.

Type Parameters

TFrom

The source color profile type. Must implement IColorProfile<TSelf, TProfileSpace>.

TTo

The target color profile type. Must implement IColorProfile<TSelf, TProfileSpace>.

Remarks

The conversion process may use ICC profiles if available; otherwise, it performs a manual conversion through the profile connection space (PCS) with chromatic adaptation as needed. The method requires both source and target types to be value types implementing the appropriate color profile interface.