Foxit PDF SDK
FSColorSpace Class Reference
Inheritance diagram for FSColorSpace:
FSBase

Instance Methods

(FSColor *) - convertColor:
 Convert input color to the color in current color space.
More...
 
(FSColor *) - convertColorWithCMYKColor:m_value:y_value:k_value:
 Convert input C/M/Y/K component values to a color object in current color space.
More...
 
(FSColor *) - convertColorWithRGBColor:g_value:b_value:
 Convert input R/G/B component values to a color in current color space.
More...
 
(FSColorSpaceType- getColorSpaceType
 Get color space type.
More...
 
(int) - getComponentCount
 Get the count of components.
More...
 
(NSArray< NSData * > *) - getComponentNames
 Get a string array which represents the name of colorant for Separation color space, or names specifying the individual color components for DeviceN color space.
More...
 
(id) - initWithOther:
 Constructor, with another color space object.
More...
 
(id) - initWithType:
 Constructor, with specified color type.
More...
 
(BOOL) - isEmpty
 Check whether current object is empty or not.
More...
 
(BOOL) - isSpotColorSpace
 Check whether current color space object is a spot color space or not.
More...
 

Detailed Description

This class represents color space. User can use this class to covert colors.

Method Documentation

◆ convertColor:()

- (FSColor *) convertColor: (FSColor*)  color

Convert input color to the color in current color space.

Parameters
[in]colorInput color, which is to be converted to current color space.
Returns
Converted color. If the return value of function FSColor::isEmpty for the returned color is YES, that means the conversion failed.

◆ convertColorWithCMYKColor:m_value:y_value:k_value:()

- (FSColor *) convertColorWithCMYKColor: (int)  c_value
m_value: (int)  m_value
y_value: (int)  y_value
k_value: (int)  k_value 

Convert input C/M/Y/K component values to a color object in current color space.

Parameters
[in]c_valueC component value. Valid range: from 0 to 255.
[in]m_valueM component value. Valid range: from 0 to 255.
[in]y_valueY component value. Valid range: from 0 to 255.
[in]k_valueK component value. Valid range: from 0 to 255.
Returns
Converted color. If the return value of function FSColor::isEmpty for the returned color is YES, that means the conversion failed.

◆ convertColorWithRGBColor:g_value:b_value:()

- (FSColor *) convertColorWithRGBColor: (int)  r_value
g_value: (int)  g_value
b_value: (int)  b_value 

Convert input R/G/B component values to a color in current color space.

Parameters
[in]r_valueR component value. Valid range: from 0 to 255.
[in]g_valueG component value. Valid range: from 0 to 255.
[in]b_valueB component value. Valid range: from 0 to 255.
Returns
Converted color. If the return value of function FSColor::isEmpty for the returned color is YES, that means the conversion failed.

◆ getColorSpaceType()

- (FSColorSpaceType) getColorSpaceType

Get color space type.

Returns
Color space type. Please refer to values starting from FSColorSpaceInvalid and this would be one of these values.

◆ getComponentCount()

- (int) getComponentCount

Get the count of components.

For different color space type, the count of components are not the same.

Returns
Count of components.

◆ getComponentNames()

- (NSArray< NSData * > *) getComponentNames

Get a string array which represents the name of colorant for Separation color space, or names specifying the individual color components for DeviceN color space.

This function is only available when current color space type is FSColorSpaceSeparation or FSColorSpaceDeviceN. For other color space type, this function will return an empty string array.

Returns
A string array of name(s).
  • For Separation color space, the count of returned array will be only one and the string specifies the name of colorant.
  • For DeviceN color space, there can be several strings in returned array and they specify the individual color components.

◆ initWithOther:()

- (id) initWithOther: (FSColorSpace*)  other

Constructor, with another color space object.

Parameters
[in]otherAnother color space object.

◆ initWithType:()

- (id) initWithType: (FSColorSpaceType type

Constructor, with specified color type.

Parameters
[in]typeThe color space type. Currently, this value can only be one of following values: FSColorSpaceDeviceGray, FSColorSpaceDeviceRGB, FSColorSpaceDeviceCMYK.
For other unsupported color space type, exception FSErrUnsupported will be thrown.

◆ isEmpty()

- (BOOL) isEmpty

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
YES means current object is empty, while NO means not.

◆ isSpotColorSpace()

- (BOOL) isSpotColorSpace

Check whether current color space object is a spot color space or not.

Returns
YES means current object is spot color space, while NO means not.