Foxit PDF SDK
foxit::common::Color类 参考
类 foxit::common::Color 继承关系图:
foxit::Base

Public 成员函数

 Color ()
 构造一个空的颜色对象。
 
 Color (const ColorSpace &color_space)
 构造函数,使用颜色空间对象 更多...
 
 Color (const Color &other)
 使用另一个color对象的构造函数。 更多...
 
 ~Color ()
 析构函数。
 
Color ConvertToCMYK (ColorSpace::RenderingIntent intent=ColorSpace::e_RenderIntentRelColorimetric) const
 转换为CMYK颜色。 更多...
 
Color ConvertToRGB (ColorSpace::RenderingIntent intent=ColorSpace::e_RenderIntentRelColorimetric) const
 转换为RGB颜色。 更多...
 
ColorSpace GetColorSpace ()
 获取当前颜色所属的颜色空间。 更多...
 
FloatArray GetValue () const
 获取分量值数组。 更多...
 
bool IsEmpty () const
 检查当前对象是否为空。 更多...
 
bool operator!= (const Color &other) const
 不相等操作符。 更多...
 
Coloroperator= (const Color &other)
 赋值操作符。 更多...
 
bool operator== (const Color &other) const
 相等操作符。 更多...
 
void SetValue (const FloatArray &component_array)
 设置分量值数组。 更多...
 
- Public 成员函数 继承自 foxit::Base
FS_HANDLE Handle () const
 获取当前对象的句柄。 更多...
 

详细描述

此类表示颜色。

构造及析构函数说明

◆ Color() [1/2]

foxit::common::Color::Color ( const ColorSpace color_space)
explicit

构造函数,使用颜色空间对象

参数
[in]color_space有效的颜色空间对象。

◆ Color() [2/2]

foxit::common::Color::Color ( const Color other)

使用另一个color对象的构造函数。

参数
[in]other另一个 Color 对象。

成员函数说明

◆ ConvertToCMYK()

Color foxit::common::Color::ConvertToCMYK ( ColorSpace::RenderingIntent  intent = ColorSpace::e_RenderIntentRelColorimetric) const

转换为CMYK颜色。

参数
[in]intent(保留)用于颜色转换的渲染意图。
返回
转换后的颜色。如果返回颜色的函数 Color::IsEmpty 的返回值为 true,则表示转换失败。

◆ ConvertToRGB()

Color foxit::common::Color::ConvertToRGB ( ColorSpace::RenderingIntent  intent = ColorSpace::e_RenderIntentRelColorimetric) const

转换为RGB颜色。

参数
[in]intent(保留)用于颜色转换的渲染意图。
返回
转换后的颜色。如果返回颜色的函数 Color::IsEmpty 的返回值为 true,则表示转换失败。

◆ GetColorSpace()

ColorSpace foxit::common::Color::GetColorSpace ( )

获取当前颜色所属的颜色空间。

返回
颜色空间对象。

◆ GetValue()

FloatArray foxit::common::Color::GetValue ( ) const

获取分量值数组。

分量的数量取决于当前颜色所属的颜色空间。 用户可以通过函数 Color::GetColorSpace 获取颜色空间对象,然后 通过函数 ColorSpace::GetComponentCount 获取分量数量。

返回
分量值数组。每个分量值的范围为 0.0 到 1.0。

◆ IsEmpty()

bool foxit::common::Color::IsEmpty ( ) const

检查当前对象是否为空。

当前对象为空时,表示当前对象无效。

返回
true 表示当前对象为空,false 表示非空。

◆ operator!=()

bool foxit::common::Color::operator!= ( const Color other) const

不相等操作符。

参数
[in]other另一个颜色对象。此函数将检查当前对象是否与该对象不相等。
返回
true 表示不相等,false 表示相等。

◆ operator=()

Color& foxit::common::Color::operator= ( const Color other)

赋值操作符。

参数
[in]other另一个颜色对象,其值将被赋给当前对象。
返回
对当前对象自身的引用。

◆ operator==()

bool foxit::common::Color::operator== ( const Color other) const

相等操作符。

参数
[in]other另一个颜色对象。此函数将检查当前对象是否与该对象相等。
返回
true 表示相等,false 表示不相等。

◆ SetValue()

void foxit::common::Color::SetValue ( const FloatArray component_array)

设置分量值数组。

分量的数量取决于当前颜色所属的颜色空间。 用户可以通过函数 Color::GetColorSpace 获取颜色空间对象,然后 通过函数 ColorSpace::GetComponentCount 获取分量数量。

参数
[in]component_array分量值数组。此数组中的分量数量应与当前颜色所属颜色空间的分量数量匹配。 每个分量值的有效范围为 0.0 到 1.0。
返回
无。