PDF SDK Documentation

Comprehensive Guide for Developers: Features, Integration, and API Reference

Loading...
Searching...
No Matches
color.h
1// Copyright (c) 2009-2025 Avanquest Software. All rights reserved.
2
3#ifndef PDFSDK_CXX_PDF_COLOR_H_INCLUDED_
4#define PDFSDK_CXX_PDF_COLOR_H_INCLUDED_
5
6#include <vector>
7
9
10#include "forward_declarations.h"
11#include "wrapper_base.h"
12
13namespace PDF {
14
30class Color : public detail::RefCountedHandle<PDEColor> {
31public:
45 static Color Create(const ColorSpace& colorSpace, const std::vector<float>& components, const Pattern& pattern);
46
52 static Color CreateGray(float gray);
53
61 static Color CreateRGB(float red, float green, float blue);
62
68 static Color CreateFromValue(PDColorValue value);
69
75
80 size_t GetNumComponents() const;
81
87 float GetComponent(size_t index) const;
88
97
104 PDColorValue ToRGB(PDERenderingIntent intent) const;
105
113 PDColorValue ToARGB(float opacity, PDERenderingIntent intent) const;
114
115 PDF_CXX_CORE_WRAPPER_DEFINE_MEMBERS_(Color, PDEColor)
116};
117
118} // namespace PDF
119
120#include "color_impl.inl"
121
122#endif // PDFSDK_CXX_PDF_COLOR_H_INCLUDED_
Represents a color in a PDF document.
Definition color.h:30
float GetComponent(size_t index) const
Gets the color component at the specified index.
static Color CreateGray(float gray)
Creates a grayscale color with the specified gray value.
PDColorValue ToARGB(float opacity, PDERenderingIntent intent) const
Converts a color to its ARGB color value, by providing the color's opacity and rendering intent.
size_t GetNumComponents() const
Gets the number of components in a color.
static Color CreateFromValue(PDColorValue value)
Creates a color from the RGB color value.
static Color Create(const ColorSpace &colorSpace, const std::vector< float > &components, const Pattern &pattern)
Creates a color by specifying a color space and the color components.
PDColorValue ToRGB(PDERenderingIntent intent) const
Converts a color to its RGB color value, by providing the color's rendering intent.
Pattern GetPattern() const
Gets the type of pattern associated with a color. Either tilling or shading.
static Color CreateRGB(float red, float green, float blue)
Creates an RGB color by specifying the individual red, green, and blue values.
ColorSpace GetColorSpace() const
Gets the color space of the color.
Represents a color space in a PDF document.
Definition color_space.h:40
Represents a shading or tiling pattern in a PDF document.
Definition pattern.h:18
Content API.
PDERenderingIntent
Specifies the way to reproduce colour on a target device.
Definition content.h:130