Table of Contents

Method CreateColorTransformedBitmap

Namespace
PaintDotNet.Imaging
Assembly
PaintDotNet.Windows.Core.dll

CreateColorTransformedBitmap(IImagingFactory, IBitmapSource, CicpColorSpace, IColorContext, in PixelFormat)

Color-transforms source, whose colorimetry is described by sourceCicpColorSpace, into the given destination color context and pixel format.

public static IBitmapSource CreateColorTransformedBitmap(this IImagingFactory factory, IBitmapSource source, CicpColorSpace sourceCicpColorSpace, IColorContext dstColorContext, in PixelFormat dstFormat)

Parameters

factory IImagingFactory
source IBitmapSource
sourceCicpColorSpace CicpColorSpace
dstColorContext IColorContext
dstFormat PixelFormat

Returns

IBitmapSource

The transformed bitmap, in the destination color context and pixel format (owned by the caller).

Remarks

CICP transfers that can be expressed as an ICC profile are transformed directly from that synthesized profile. PQ and HLG cannot, so they are first decoded to linear light by a dedicated kernel that tags the result with a known linear profile, and the transform proceeds from there. Any other transfer that is neither ICC-representable nor PQ/HLG is unsupported.

Exceptions

ArgumentException

Thrown if the CICP color information cannot be honored (e.g. non-RGB matrix coefficients or unrepresentable primaries or transfer). The message describes why.

CreateColorTransformedBitmap<TPixelDst>(IImagingFactory, IBitmapSource, CicpColorSpace, IColorContext)

Color-transforms source, whose colorimetry is described by sourceCicpColorSpace, into the given destination color context, with the output pixel format determined by TPixelDst.

public static IBitmapSource<TPixelDst> CreateColorTransformedBitmap<TPixelDst>(this IImagingFactory factory, IBitmapSource source, CicpColorSpace sourceCicpColorSpace, IColorContext dstColorContext) where TPixelDst : unmanaged, INaturalPixelInfo

Parameters

factory IImagingFactory
source IBitmapSource
sourceCicpColorSpace CicpColorSpace
dstColorContext IColorContext

Returns

IBitmapSource<TPixelDst>

The transformed bitmap, in the destination color context (owned by the caller).

Type Parameters

TPixelDst

The destination pixel format.

Exceptions

ArgumentException

Thrown if the CICP color information cannot be honored. The message describes why.

CreateColorTransformedBitmap<TPixel>(IImagingFactory, IBitmapSource<TPixel>, CicpColorSpace, IColorContext)

Color-transforms source, whose colorimetry is described by sourceCicpColorSpace, into the given destination color context. The output pixel format is inferred from source's pixel format (TPixel).

public static IBitmapSource<TPixel> CreateColorTransformedBitmap<TPixel>(this IImagingFactory factory, IBitmapSource<TPixel> source, CicpColorSpace sourceCicpColorSpace, IColorContext dstColorContext) where TPixel : unmanaged, INaturalPixelInfo

Parameters

factory IImagingFactory
source IBitmapSource<TPixel>
sourceCicpColorSpace CicpColorSpace
dstColorContext IColorContext

Returns

IBitmapSource<TPixel>

The transformed bitmap, in the destination color context (owned by the caller).

Type Parameters

TPixel

The source and destination pixel format.

Exceptions

ArgumentException

Thrown if the CICP color information cannot be honored. The message describes why.

CreateColorTransformedBitmap<TDstPixel>(IImagingFactory, IBitmapSource, IColorContext, IColorContext)

public static IBitmapSource<TDstPixel> CreateColorTransformedBitmap<TDstPixel>(this IImagingFactory factory, IBitmapSource source, IColorContext sourceContext, IColorContext destinationContext) where TDstPixel : unmanaged, INaturalPixelInfo

Parameters

factory IImagingFactory
source IBitmapSource
sourceContext IColorContext
destinationContext IColorContext

Returns

IBitmapSource<TDstPixel>

Type Parameters

TDstPixel

CreateColorTransformedBitmap(IImagingFactory, IBitmapSource, DxgiColorSpace, IColorContext, in PixelFormat)

public static IBitmapSource CreateColorTransformedBitmap(this IImagingFactory factory, IBitmapSource source, DxgiColorSpace sourceColorSpace, IColorContext dstColorContext, in PixelFormat dstFormat)

Parameters

factory IImagingFactory
source IBitmapSource
sourceColorSpace DxgiColorSpace
dstColorContext IColorContext
dstFormat PixelFormat

Returns

IBitmapSource

CreateColorTransformedBitmap<TPixelDst>(IImagingFactory, IBitmapSource, DxgiColorSpace, IColorContext)

public static IBitmapSource<TPixelDst> CreateColorTransformedBitmap<TPixelDst>(this IImagingFactory factory, IBitmapSource source, DxgiColorSpace sourceColorSpace, IColorContext dstColorContext) where TPixelDst : unmanaged, INaturalPixelInfo

Parameters

factory IImagingFactory
source IBitmapSource
sourceColorSpace DxgiColorSpace
dstColorContext IColorContext

Returns

IBitmapSource<TPixelDst>

Type Parameters

TPixelDst

CreateColorTransformedBitmap<TPixel>(IImagingFactory, IBitmapSource<TPixel>, DxgiColorSpace, IColorContext)

public static IBitmapSource<TPixel> CreateColorTransformedBitmap<TPixel>(this IImagingFactory factory, IBitmapSource<TPixel> source, DxgiColorSpace sourceColorSpace, IColorContext dstColorContext) where TPixel : unmanaged, INaturalPixelInfo

Parameters

factory IImagingFactory
source IBitmapSource<TPixel>
sourceColorSpace DxgiColorSpace
dstColorContext IColorContext

Returns

IBitmapSource<TPixel>

Type Parameters

TPixel

CreateColorTransformedBitmap(IImagingFactory, IBitmapSource, SimpleColorProfile, IColorContext, in PixelFormat)

public static IBitmapSource CreateColorTransformedBitmap(this IImagingFactory factory, IBitmapSource source, SimpleColorProfile simpleColorProfile, IColorContext dstColorContext, in PixelFormat dstFormat)

Parameters

factory IImagingFactory
source IBitmapSource
simpleColorProfile SimpleColorProfile
dstColorContext IColorContext
dstFormat PixelFormat

Returns

IBitmapSource

CreateColorTransformedBitmap<TPixelDst>(IImagingFactory, IBitmapSource, SimpleColorProfile, IColorContext)

public static IBitmapSource<TPixelDst> CreateColorTransformedBitmap<TPixelDst>(this IImagingFactory factory, IBitmapSource source, SimpleColorProfile simpleColorProfile, IColorContext dstColorContext) where TPixelDst : unmanaged, INaturalPixelInfo

Parameters

factory IImagingFactory
source IBitmapSource
simpleColorProfile SimpleColorProfile
dstColorContext IColorContext

Returns

IBitmapSource<TPixelDst>

Type Parameters

TPixelDst

CreateColorTransformedBitmap<TPixel>(IImagingFactory, IBitmapSource<TPixel>, SimpleColorProfile, IColorContext)

public static IBitmapSource<TPixel> CreateColorTransformedBitmap<TPixel>(this IImagingFactory factory, IBitmapSource<TPixel> source, SimpleColorProfile simpleColorProfile, IColorContext dstColorContext) where TPixel : unmanaged, INaturalPixelInfo

Parameters

factory IImagingFactory
source IBitmapSource<TPixel>
simpleColorProfile SimpleColorProfile
dstColorContext IColorContext

Returns

IBitmapSource<TPixel>

Type Parameters

TPixel