c4d.bitmaps.ColorProfileConvert

New in version R17.032.

A helper class to convert the ColorProfile of bitmaps . See also BaseBitmap.GetPixelCnt() .

Definition

class c4d.bitmaps. ColorProfileConvert

Members

ColorProfileConvert. __init__ ( )
Return type: c4d.bitmaps.ColorProfileConvert
Returns: The new ColorProfileConvert .
ColorProfileConvert. PrepareTransform ( srccolormode , srcprofile , dstcolormode , dstprofile , bgr )
Prepares the color conversion i.e. checks if a conversion is needed. A conversion is only necessary if True is returned. Two identical color spaces will return False .
Parameters:
  • srccolormode ( int ) –

    The source color mode:

    COLORMODE_ALPHA Only 8-bit alpha channel.
    COLORMODE_GRAY8 8-bit greyscale channel.
    COLORMODE_AGRAY 8-bit greyscale channel with 8-bit alpha.
    COLORMODE_RGB 8-bit RGB channels.
    COLORMODE_ARGB 8-bit RGB channels with 8-bit alpha.
    COLORMODE_CMYK 8-bit CMYK channel.
    COLORMODE_ACMYK 8-bit CMYK channel with 8-bit alpha.
    COLORMODE_MASK 8-bit greymap as mask.
    COLORMODE_AMASK 8-bit greymap as mask with 8-bit alpha.
    COLORMODE_ILLEGAL Private.
    COLORMODE_GRAYw 8-bit greymap as mask with 8-bit alpha.
    COLORMODE_AGRAYw 16-bit greyscale channel with 16-bit alpha.
    COLORMODE_RGBw 16-bit RGB channels.
    COLORMODE_ARGBw 16-bit RGB channels with 16-bit alpha.
    COLORMODE_MASKw 16-bit greymap as mask with 16-bit alpha.
    COLORMODE_ILLEGALf Private.
    COLORMODE_GRAYf Floating point greyscale channel.
    COLORMODE_AGRAYf Floating point greyscale channel with floating point alpha.
    COLORMODE_RGBf Floating point RGB channels.
    COLORMODE_ARGBf Floating point RGB channels with floating point alpha.
    COLORMODE_MASKf Floating point greymap with floating point alpha.
  • srcprofile ( c4d.bitmaps.ColorProfile ) – The source color profile.
  • dstcolormode

    The destination color mode:

    COLORMODE_ALPHA Only 8-bit alpha channel.
    COLORMODE_GRAY8 8-bit greyscale channel.
    COLORMODE_AGRAY 8-bit greyscale channel with 8-bit alpha.
    COLORMODE_RGB 8-bit RGB channels.
    COLORMODE_ARGB 8-bit RGB channels with 8-bit alpha.
    COLORMODE_CMYK 8-bit CMYK channel.
    COLORMODE_ACMYK 8-bit CMYK channel with 8-bit alpha.
    COLORMODE_MASK 8-bit greymap as mask.
    COLORMODE_AMASK 8-bit greymap as mask with 8-bit alpha.
    COLORMODE_ILLEGAL Private.
    COLORMODE_GRAYw 8-bit greymap as mask with 8-bit alpha.
    COLORMODE_AGRAYw 16-bit greyscale channel with 16-bit alpha.
    COLORMODE_RGBw 16-bit RGB channels.
    COLORMODE_ARGBw 16-bit RGB channels with 16-bit alpha.
    COLORMODE_MASKw 16-bit greymap as mask with 16-bit alpha.
    COLORMODE_ILLEGALf Private.
    COLORMODE_GRAYf Floating point greyscale channel.
    COLORMODE_AGRAYf Floating point greyscale channel with floating point alpha.
    COLORMODE_RGBf Floating point RGB channels.
    COLORMODE_ARGBf Floating point RGB channels with floating point alpha.
    COLORMODE_MASKf Floating point greymap with floating point alpha.
  • dstprofile ( c4d.bitmaps.ColorProfile ) – The destination color profile.
  • bgr ( bool ) – True to swap the RGB channels. Only necessary when working directly with Windows bitmaps.
Return type:

bool

Returns:

True a conversion is necessary, otherwise False .

ColorProfileConvert. Convert ( src , dst , cnt , skipInputComponents , skipOutputComponents )

Converts the color profiles of the pixel data.

Parameters:
  • src ( c4d.storage.ByteSeq ) – The source pixel buffer.
  • dst ( c4d.storage.ByteSeq ) – The destination pixel buffer.
  • cnt ( int ) – The number of pixels to convert.
  • skipInputComponents ( bool ) – The number of bytes to skip in the source buffer after each converted pixel. For instance a RGB pixel contains 3 bytes. After conversion the number of skipInputComponents bytes is added to the source pointer.
  • skipOutputComponents ( bool ) – The number of bytes to skip in the destination buffer after each converted pixel. For instance a RGB pixel contains 3 bytes. After conversion the number of SkipOutputComponents bytes is added to the destination pointer.

Table Of Contents