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
factoryIImagingFactorysourceIBitmapSourcesourceCicpColorSpaceCicpColorSpacedstColorContextIColorContextdstFormatPixelFormat
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
factoryIImagingFactorysourceIBitmapSourcesourceCicpColorSpaceCicpColorSpacedstColorContextIColorContext
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.
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
factoryIImagingFactorysourceIBitmapSource<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.
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
factoryIImagingFactorysourceIBitmapSourcesourceContextIColorContextdestinationContextIColorContext
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
factoryIImagingFactorysourceIBitmapSourcesourceColorSpaceDxgiColorSpacedstColorContextIColorContextdstFormatPixelFormat
Returns
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
factoryIImagingFactorysourceIBitmapSourcesourceColorSpaceDxgiColorSpacedstColorContextIColorContext
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
factoryIImagingFactorysourceIBitmapSource<TPixel>sourceColorSpaceDxgiColorSpacedstColorContextIColorContext
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
factoryIImagingFactorysourceIBitmapSourcesimpleColorProfileSimpleColorProfiledstColorContextIColorContextdstFormatPixelFormat
Returns
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
factoryIImagingFactorysourceIBitmapSourcesimpleColorProfileSimpleColorProfiledstColorContextIColorContext
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
factoryIImagingFactorysourceIBitmapSource<TPixel>simpleColorProfileSimpleColorProfiledstColorContextIColorContext
Returns
- IBitmapSource<TPixel>
Type Parameters
TPixel