Method CreateColorTransformer
- Namespace
- PaintDotNet.Imaging
- Assembly
- PaintDotNet.Windows.Core.dll
CreateColorTransformer(IBitmapSource, IColorContext, IColorContext, in PixelFormat)
public static IBitmapSource CreateColorTransformer(this IBitmapSource source, IColorContext sourceContext, IColorContext dstContext, in PixelFormat dstPixelFormat)
Parameters
sourceIBitmapSourcesourceContextIColorContextdstContextIColorContextdstPixelFormatPixelFormat
Returns
CreateColorTransformer<TPixel>(IBitmapSource, IColorContext, IColorContext)
public static IBitmapSource<TPixel> CreateColorTransformer<TPixel>(this IBitmapSource source, IColorContext sourceContext, IColorContext dstContext) where TPixel : unmanaged, INaturalPixelInfo
Parameters
sourceIBitmapSourcesourceContextIColorContextdstContextIColorContext
Returns
- IBitmapSource<TPixel>
Type Parameters
TPixel
CreateColorTransformer<TPixel>(IBitmapSource<TPixel>, IColorContext, IColorContext)
public static IBitmapSource<TPixel> CreateColorTransformer<TPixel>(this IBitmapSource<TPixel> source, IColorContext sourceContext, IColorContext dstContext) where TPixel : unmanaged, INaturalPixelInfo
Parameters
sourceIBitmapSource<TPixel>sourceContextIColorContextdstContextIColorContext
Returns
- IBitmapSource<TPixel>
Type Parameters
TPixel
CreateColorTransformer(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 CreateColorTransformer(this IBitmapSource source, CicpColorSpace sourceCicpColorSpace, IColorContext dstColorContext, in PixelFormat dstFormat)
Parameters
sourceIBitmapSourcesourceCicpColorSpaceCicpColorSpacedstColorContextIColorContextdstFormatPixelFormat
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.
CreateColorTransformer<TPixelDst>(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> CreateColorTransformer<TPixelDst>(this IBitmapSource source, CicpColorSpace sourceCicpColorSpace, IColorContext dstColorContext) where TPixelDst : unmanaged, INaturalPixelInfo
Parameters
sourceIBitmapSourcesourceCicpColorSpaceCicpColorSpacedstColorContextIColorContext
Returns
- IBitmapSource<TPixelDst>
The transformed bitmap, in the destination color context (owned by the caller).
Type Parameters
TPixelDstThe destination pixel format.
Exceptions
- ArgumentException
Thrown if the CICP color information cannot be honored. The message describes why.
CreateColorTransformer<TPixel>(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> CreateColorTransformer<TPixel>(this IBitmapSource<TPixel> source, CicpColorSpace sourceCicpColorSpace, IColorContext dstColorContext) where TPixel : unmanaged, INaturalPixelInfo
Parameters
sourceIBitmapSource<TPixel>sourceCicpColorSpaceCicpColorSpacedstColorContextIColorContext
Returns
- IBitmapSource<TPixel>
The transformed bitmap, in the destination color context (owned by the caller).
Type Parameters
TPixelThe source and destination pixel format.
Exceptions
- ArgumentException
Thrown if the CICP color information cannot be honored. The message describes why.
CreateColorTransformer(IBitmapSource, DxgiColorSpace, IColorContext, in PixelFormat)
public static IBitmapSource CreateColorTransformer(this IBitmapSource source, DxgiColorSpace sourceColorSpace, IColorContext dstColorContext, in PixelFormat dstFormat)
Parameters
sourceIBitmapSourcesourceColorSpaceDxgiColorSpacedstColorContextIColorContextdstFormatPixelFormat
Returns
CreateColorTransformer<TPixelDst>(IBitmapSource, DxgiColorSpace, IColorContext)
public static IBitmapSource<TPixelDst> CreateColorTransformer<TPixelDst>(this IBitmapSource source, DxgiColorSpace sourceColorSpace, IColorContext dstColorContext) where TPixelDst : unmanaged, INaturalPixelInfo
Parameters
sourceIBitmapSourcesourceColorSpaceDxgiColorSpacedstColorContextIColorContext
Returns
- IBitmapSource<TPixelDst>
Type Parameters
TPixelDst
CreateColorTransformer<TPixel>(IBitmapSource<TPixel>, DxgiColorSpace, IColorContext)
public static IBitmapSource<TPixel> CreateColorTransformer<TPixel>(this IBitmapSource<TPixel> source, DxgiColorSpace sourceColorSpace, IColorContext dstColorContext) where TPixel : unmanaged, INaturalPixelInfo
Parameters
sourceIBitmapSource<TPixel>sourceColorSpaceDxgiColorSpacedstColorContextIColorContext
Returns
- IBitmapSource<TPixel>
Type Parameters
TPixel
CreateColorTransformer(IBitmapSource, SimpleColorProfile, IColorContext, in PixelFormat)
public static IBitmapSource CreateColorTransformer(this IBitmapSource source, SimpleColorProfile simpleColorProfile, IColorContext dstColorContext, in PixelFormat dstFormat)
Parameters
sourceIBitmapSourcesimpleColorProfileSimpleColorProfiledstColorContextIColorContextdstFormatPixelFormat
Returns
CreateColorTransformer<TPixelDst>(IBitmapSource, SimpleColorProfile, IColorContext)
public static IBitmapSource<TPixelDst> CreateColorTransformer<TPixelDst>(this IBitmapSource source, SimpleColorProfile simpleColorProfile, IColorContext dstColorContext) where TPixelDst : unmanaged, INaturalPixelInfo
Parameters
sourceIBitmapSourcesimpleColorProfileSimpleColorProfiledstColorContextIColorContext
Returns
- IBitmapSource<TPixelDst>
Type Parameters
TPixelDst
CreateColorTransformer<TPixel>(IBitmapSource<TPixel>, SimpleColorProfile, IColorContext)
public static IBitmapSource<TPixel> CreateColorTransformer<TPixel>(this IBitmapSource<TPixel> source, SimpleColorProfile simpleColorProfile, IColorContext dstColorContext) where TPixel : unmanaged, INaturalPixelInfo
Parameters
sourceIBitmapSource<TPixel>simpleColorProfileSimpleColorProfiledstColorContextIColorContext
Returns
- IBitmapSource<TPixel>
Type Parameters
TPixel