xtd 0.2.0
color_palette.h
Go to the documentation of this file.
1 #pragma once
5 #include "../color.h"
6 #include <xtd/iequatable>
7 #include <xtd/object>
8 #include <cstdint>
9 #include <vector>
10 
12 namespace xtd {
14  namespace drawing {
16  class image;
18 
21  namespace imaging {
30  class color_palette final : public object, public xtd::iequatable<color_palette> {
31  public:
33  color_palette(const color_palette&) = default;
34  color_palette& operator =(const color_palette&) = default;
36 
38 
42  const std::vector<color>& entries() const noexcept {return entries_;}
43 
49  int32 flags() const noexcept {return flags_;}
51 
53 
55  bool equals(const color_palette& value) const noexcept override {return entries_ == value.entries_ && flags_ == value.flags_;}
57 
58  private:
59  friend class xtd::drawing::image;
60  color_palette() = default;
61  std::vector<color> entries_;
62  int32 flags_ = 0;
63  };
64  }
65  }
66 }
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
const std::vector< color > & entries() const noexcept
Gets an array of color structures.
Definition: color_palette.h:42
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition: iequatable.h:18
An abstract base class that provides functionality for the bitmap and metafile descended classes...
Definition: image.h:48
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes...
Definition: object.h:32
int_least32_t int32
Represents a 32-bit signed integer.
Definition: types.h:129
Defines an array of colors that make up a color palette. The colors are 32-bit ARGB colors...
Definition: color_palette.h:30
int32 flags() const noexcept
Gets a value that specifies how to interpret the color information in the array of colors...
Definition: color_palette.h:49