ColorProfileConvert Class Reference

#include <c4d_basebitmap.h>

详细描述

A helper class to convert the ColorProfile of bitmaps .

注意
Has to be created with Alloc() and destroyed with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.
另请参阅
BaseBitmap::GetPixelCnt()

私有成员函数

  ColorProfileConvert ()
  ~ColorProfileConvert ()
  ColorProfileConvert (const ColorProfileConvert &src)
ColorProfileConvert operator= (const ColorProfileConvert &src)

Alloc/Free

static ColorProfileConvert Alloc (void)
static void  Free ( ColorProfileConvert *&convert)

Conversion

Bool   PrepareTransform ( COLORMODE srccolormode, const ColorProfile *srcprofile, COLORMODE dstcolormode, const ColorProfile *dstprofile, Bool bgr)
void  转换 (const PIX *src, PIX *dst, Int32 cnt, Int32 SkipInputComponents, Int32 SkipOutputComponents) const

构造函数 & 析构函数文档编制

◆  ColorProfileConvert() [1/2]

ColorProfileConvert () private

◆  ~ColorProfileConvert()

~ ColorProfileConvert () private

◆  ColorProfileConvert() [2/2]

ColorProfileConvert ( const ColorProfileConvert src )
private

成员函数文档编制

◆  operator=()

ColorProfileConvert & operator= ( const ColorProfileConvert src )
private

◆  Alloc()

static ColorProfileConvert * Alloc ( void  )
static

Allocates a ColorProfileConvert instance. Destroy the allocated ColorProfileConvert instance with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

返回
The allocated ColorProfileConvert object, or nullptr if the allocation failed.

◆  Free()

static void Free ( ColorProfileConvert *&  convert )
static

Destructs ColorProfileConvert instances allocated with Alloc() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

参数
[in,out] convert The ColorProfileConvert instance to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆  PrepareTransform()

Bool PrepareTransform ( COLORMODE   srccolormode ,
const ColorProfile srcprofile ,
COLORMODE   dstcolormode ,
const ColorProfile dstprofile ,
Bool   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 .

参数
[in] srccolormode The source color mode: COLORMODE
[in] srcprofile The source color profile: The caller owns the pointed color profile.
[in] dstcolormode The destination color mode: COLORMODE
[in] dstprofile The destination color profile: The caller owns the pointed color profile.
[in] bgr true to swap the RGB channels, otherwise false .. Only necessary when working directly with Windows bitmaps.
返回
true if a conversion is necessary, otherwise false .

◆  Convert()

void Convert ( const PIX src ,
PIX dst ,
Int32   cnt ,
Int32   SkipInputComponents ,
Int32   SkipOutputComponents  
) const

Converts the color profiles of the pixel data.

参数
[in] src The pointer to the source pixel buffer. The caller owns the pointed buffer.
[out] dst The pointer to the destination pixel buffer. The caller owns the pointed buffer.
[in] cnt The number of pixels to convert.
[in] SkipInputComponents 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.
[in] SkipOutputComponents 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.