xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Public Member Functions | List of all members
xtd::drawing::imaging::color_palette Class Referencefinal

#include <color_palette.h>

Definition

Defines an array of colors that make up a color palette. The colors are 32-bit ARGB colors. Not inheritable.

Namespace
xtd::drawing::imaging
Library
xtd.drawing
Remarks
You are not allowed to construct a color_palette object directly. If you created a color_palette object, you could then manipulate the palette size for a particular image, which is not allowed. Use the image.palette property to obtain a color_palette object.
The colors in the palette are limited to 32-bit ARGB colors. A 32-bit ARGB color has 8 bits each for alpha, red, green, and blue values. The lowest 8 bits make up the blue bit, the next 8 bits are green, the next 8 bits are red, and the most significant 8 bits are alpha. This means each component can vary from 0 to 255. Fully on is 255 and fully off is 0. Alpha is used to make the color value transparent (alpha = 0) or opaque (alpha = 255). The number of intensity levels in the image can be increased without increasing the number of colors used. This process creates what is called a halftone, and it offers increased contrast at a cost of decreased resolution.

Public Member Functions

const std::vector< color > & entries () const
 Gets an array of color structures. More...
 
int32_t flags () const
 Gets a value that specifies how to interpret the color information in the array of colors. More...
 
- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object. More...
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object. More...
 
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type. More...
 
template<typename object_t >
std::unique_ptr< object_t > memberwise_clone () const
 Gets the type of the current instance. More...
 
virtual xtd::ustring to_string () const noexcept
 Returns a std::string that represents the current object. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from xtd::object
static bool equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are considered equal. More...
 
static bool reference_equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are the same instance. More...
 

Member Function Documentation

◆ entries()

const std::vector<color>& xtd::drawing::imaging::color_palette::entries ( ) const
inline

Gets an array of color structures.

Returns
The array of color structure that make up this color_palette.

◆ flags()

int32_t xtd::drawing::imaging::color_palette::flags ( ) const
inline

Gets a value that specifies how to interpret the color information in the array of colors.

Remarks
The following flag values are valid:
  • 0x00000001 The color values in the array contain alpha information.
  • 0x00000002 The colors in the array are grayscale values.
  • 0x00000004 The colors in the array are halftone values.

The documentation for this class was generated from the following file: