RawColor Class
Summary: Raw Color Class helps to store colors with any channels count, any color mode and any bit depth
Please note, some internal classes can have issues with converting RawColor to its’ native format,
so if API provides for you CMYK color, it’s more reliable to use the provided format.
Also, there are can be some cases when Raw Color can be converted
Module: aspose.psd.fileformats.psd.core.rawcolor
Full Name: aspose.psd.fileformats.psd.core.rawcolor.RawColor
Aspose.PSD Version: 24.9.0
Constructors
Name | Description |
---|---|
RawColor(components) | Initializes a new instance of the RawColor class. |
RawColor(pixel_data_format, color_mode) | Initializes a new instance of the RawColor class from pixel data format using predefined color modes |
Properties
Name | Type | Access | Description |
---|---|---|---|
color_mode | short | r/w | Mode for the color to follow. |
components | ColorComponent[] | r | Gets the components of color. Each component is separate channel, and if you use not popular color scheme, it’s better to work with each channel separately. |
Methods
Name | Description |
---|---|
get_as_int() | Gets the color as int in case it’s possible to get it. |
get_as_long() | Gets the color as long in case it’s possible to get it. |
get_bit_depth() | Gets the bit depth of Raw Color. For example for ARGB color with 8 bits per channel/component is 32 Bit Depth of full ARGB color with 16 bits per channel/component is 64. Bit depth is accumulated from the sum of channels’ bit depths. It’s possible if different channels will have different bit depths. |
get_color_mode_name() | Gets the name of the color mode. Color mode name accumulated from channels/components names |
set_as_int(value) | Sets data to all channels from int argument if it’s possible |
set_as_long(value) | Sets data to all channels from int argument if it’s possible |
Constructor: RawColor(components)
RawColor(components)
Initializes a new instance of the RawColor class.
Parameters:
Parameter | Type | Description |
---|---|---|
components | ColorComponent[] | The custom color components. |
Constructor: RawColor(pixel_data_format, color_mode)
RawColor(pixel_data_format, color_mode)
Initializes a new instance of the RawColor class from pixel data format using predefined color modes
Parameters:
Parameter | Type | Description |
---|---|---|
pixel_data_format | PixelDataFormat | The pixel data format. |
color_mode | short | Mode for the color to follow. |
Method: get_as_int()
get_as_int()
Gets the color as int in case it’s possible to get it.
Returns
Type | Description |
---|---|
int | Channels data stored in Int |
Method: get_as_long()
get_as_long()
Gets the color as long in case it’s possible to get it.
Returns
Type | Description |
---|---|
long | Channels data stored in Int |
Method: get_bit_depth()
get_bit_depth()
Gets the bit depth of Raw Color.
For example for ARGB color with 8 bits per channel/component is 32
Bit Depth of full ARGB color with 16 bits per channel/component is 64.
Bit depth is accumulated from the sum of channels’ bit depths.
It’s possible if different channels will have different bit depths.
Returns
Type | Description |
---|---|
int | The sum of all channels bit depths |
Method: get_color_mode_name()
get_color_mode_name()
Gets the name of the color mode. Color mode name accumulated from channels/components names
Returns
Type | Description |
---|---|
string | String with the color mode name |
Method: set_as_int(value)
set_as_int(value)
Sets data to all channels from int argument if it’s possible
Parameters:
Parameter | Type | Description |
---|---|---|
value | int | The int value that contains component data |
Method: set_as_long(value)
set_as_long(value)
Sets data to all channels from int argument if it’s possible
Parameters:
Parameter | Type | Description |
---|---|---|
value | long | The int value that contains component data |