Color.h
1 #pragma once
2 // Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
3 
4 #include <system/array.h>
5 #include <cstdint>
6 
7 #include "Aspose.PDF.Cpp/aspose_pdf_api_defs.h"
8 
9 namespace Aspose
10 {
11 namespace Pdf
12 {
13 namespace Annotations
14 {
15 class Annotation;
16 class CommonFigureAnnotation;
17 class LineAnnotation;
18 class PDF3DCrossSection;
19 class PDF3DRenderMode;
20 class PDF3DView;
21 class PolyAnnotation;
22 class RedactionAnnotation;
23 } // namespace Annotations
24 enum class ColorSpace;
25 namespace Drawing
26 {
27 class PatternColorSpace;
28 } // namespace Drawing
29 namespace Engine
30 {
31 namespace Presentation
32 {
33 namespace IndependentImpl
34 {
35 namespace ColorInitializerStrategies
36 {
37 class TextToGrayConversion;
38 } // namespace ColorInitializerStrategies
39 } // namespace IndependentImpl
40 } // namespace Presentation
41 } // namespace Engine
42 namespace Tagged
43 {
44 namespace Helpers
45 {
46 class StructureTextStateFactory;
47 } // namespace Helpers
48 } // namespace Tagged
49 namespace Tests
50 {
51 namespace PDF3D
52 {
53 class PDF3DAnnotation_Openning3thPartDocumentTests;
54 } // namespace PDF3D
55 } // namespace Tests
56 namespace Text
57 {
58 class TextFragmentState;
59 class TextParagraph;
60 class TextState;
61 } // namespace Text
62 } // namespace Pdf
63 } // namespace Aspose
64 namespace System
65 {
66 namespace Drawing
67 {
68 class Color;
69 } // namespace Drawing
70 } // namespace System
71 
72 namespace Aspose {
73 
74 namespace Pdf {
75 
79 class ASPOSE_PDF_SHARED_CLASS Color final : public System::Object
80 {
81  typedef Color ThisType;
82  typedef System::Object BaseType;
83 
84  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
85  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
86 
87  friend class Aspose::Pdf::Engine::Presentation::IndependentImpl::ColorInitializerStrategies::TextToGrayConversion;
93  friend class Aspose::Pdf::Tagged::Helpers::StructureTextStateFactory;
100  friend class Aspose::Pdf::Tests::PDF3D::PDF3DAnnotation_Openning3thPartDocumentTests;
101  friend ASPOSE_PDF_SHARED_API bool operator ==(const System::SharedPtr<Color>& x, const System::SharedPtr<Color>& y);
102  friend ASPOSE_PDF_SHARED_API bool operator !=(const System::SharedPtr<Color>& x, const System::SharedPtr<Color>& y);
103 
104 public:
105 
109  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> Empty;
110 
114  ASPOSE_PDF_SHARED_API double get_A() const;
118  ASPOSE_PDF_SHARED_API System::ArrayPtr<double> get_Data() const;
122  ASPOSE_PDF_SHARED_API Aspose::Pdf::ColorSpace get_ColorSpace();
126  ASPOSE_PDF_SHARED_API System::SharedPtr<Aspose::Pdf::Drawing::PatternColorSpace> get_PatternColorSpace() const;
130  ASPOSE_PDF_SHARED_API void set_PatternColorSpace(System::SharedPtr<Aspose::Pdf::Drawing::PatternColorSpace> value);
138  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Transparent();
146  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_AliceBlue();
154  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_AntiqueWhite();
162  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Aqua();
170  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Aquamarine();
178  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Azure();
186  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Beige();
194  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Bisque();
202  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Black();
210  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_BlanchedAlmond();
218  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Blue();
226  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_BlueViolet();
234  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Brown();
242  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_BurlyWood();
250  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_CadetBlue();
258  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Chartreuse();
266  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Chocolate();
274  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Coral();
282  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_CornflowerBlue();
290  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Cornsilk();
298  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Crimson();
306  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Cyan();
314  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_DarkBlue();
322  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_DarkCyan();
330  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_DarkGoldenrod();
338  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_DarkGray();
346  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_DarkGreen();
354  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_DarkKhaki();
362  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_DarkMagenta();
370  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_DarkOliveGreen();
378  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_DarkOrange();
386  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_DarkOrchid();
394  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_DarkRed();
402  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_DarkSalmon();
410  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_DarkSeaGreen();
418  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_DarkSlateBlue();
426  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_DarkSlateGray();
434  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_DarkTurquoise();
442  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_DarkViolet();
450  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_DeepPink();
458  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_DeepSkyBlue();
466  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_DimGray();
474  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_DodgerBlue();
482  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Firebrick();
490  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_FloralWhite();
498  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_ForestGreen();
506  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Fuchsia();
514  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Gainsboro();
522  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_GhostWhite();
530  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Gold();
538  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Goldenrod();
546  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Gray();
554  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Green();
562  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_GreenYellow();
570  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Honeydew();
578  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_HotPink();
586  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_IndianRed();
594  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Indigo();
602  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Ivory();
610  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Khaki();
618  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Lavender();
626  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_LavenderBlush();
634  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_LawnGreen();
642  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_LemonChiffon();
650  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_LightBlue();
658  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_LightCoral();
666  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_LightCyan();
674  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_LightGoldenrodYellow();
682  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_LightGreen();
690  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_LightGray();
698  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_LightPink();
706  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_LightSalmon();
714  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_LightSeaGreen();
722  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_LightSkyBlue();
730  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_LightSlateGray();
738  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_LightSteelBlue();
746  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_LightYellow();
754  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Lime();
762  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_LimeGreen();
770  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Linen();
778  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Magenta();
786  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Maroon();
794  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_MediumAquamarine();
802  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_MediumBlue();
810  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_MediumOrchid();
818  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_MediumPurple();
826  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_MediumSeaGreen();
834  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_MediumSlateBlue();
842  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_MediumSpringGreen();
850  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_MediumTurquoise();
858  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_MediumVioletRed();
866  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_MidnightBlue();
874  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_MintCream();
882  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_MistyRose();
890  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Moccasin();
898  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_NavajoWhite();
906  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Navy();
914  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_OldLace();
922  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Olive();
930  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_OliveDrab();
938  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Orange();
946  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_OrangeRed();
954  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Orchid();
962  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_PaleGoldenrod();
970  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_PaleGreen();
978  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_PaleTurquoise();
986  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_PaleVioletRed();
994  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_PapayaWhip();
1002  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_PeachPuff();
1010  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Peru();
1018  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Pink();
1026  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Plum();
1034  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_PowderBlue();
1042  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Purple();
1050  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Red();
1058  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_RosyBrown();
1066  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_RoyalBlue();
1074  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_SaddleBrown();
1082  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Salmon();
1090  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_SandyBrown();
1098  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_SeaGreen();
1106  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_SeaShell();
1114  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Sienna();
1122  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Silver();
1130  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_SkyBlue();
1138  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_SlateBlue();
1146  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_SlateGray();
1154  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Snow();
1162  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_SpringGreen();
1170  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_SteelBlue();
1178  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Tan();
1186  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Teal();
1194  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Thistle();
1202  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Tomato();
1210  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Turquoise();
1218  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Violet();
1226  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Wheat();
1234  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_White();
1242  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_WhiteSmoke();
1250  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_Yellow();
1258  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> get_YellowGreen();
1259 
1263  ASPOSE_PDF_SHARED_API Color();
1264 
1274  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> Parse(System::String value);
1281  ASPOSE_PDF_SHARED_API System::Drawing::Color ToRgb();
1291  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> FromRgb(System::Drawing::Color color);
1307  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> FromArgb(int32_t r, int32_t g, int32_t b);
1326  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> FromArgb(int32_t a, int32_t r, int32_t g, int32_t b);
1342  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> FromRgb(double r, double g, double b);
1352  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> FromGray(double g);
1371  static ASPOSE_PDF_SHARED_API System::SharedPtr<Color> FromCmyk(double c, double m, double y, double k);
1377  ASPOSE_PDF_SHARED_API bool Equals(System::SharedPtr<System::Object> obj) override;
1384  ASPOSE_PDF_SHARED_API System::String ToString() const override;
1385 
1386 protected:
1387 
1391  bool get_IsEmpty() const;
1392 
1394 
1395  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(Color, CODEPORTING_ARGS(System::ArrayPtr<double> vector));
1397  System::SharedPtr<Color> Clone();
1398  System::SharedPtr<Color> ToRgbColor();
1399  System::SharedPtr<Color> ToGrayColor();
1400  System::SharedPtr<Color> ToCmykColor();
1401  bool Equal(System::SharedPtr<Color> color);
1402 
1403 private:
1404 
1405  System::ArrayPtr<double> vector;
1406  bool isEmpty;
1407  double alpha;
1412 
1413  Color(System::ArrayPtr<double> vector, bool isEmpty, double alpha);
1414 
1415  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(Color, CODEPORTING_ARGS(System::ArrayPtr<double> vector, bool isEmpty, double alpha));
1416  System::String ToString_NonConst();
1417 
1418  static struct __StaticConstructor__ { __StaticConstructor__(); } s_constructor__;
1419 
1420 };
1421 
1422 ASPOSE_PDF_SHARED_API bool operator ==(const System::SharedPtr<Color>& x, const System::SharedPtr<Color>& y);
1423 ASPOSE_PDF_SHARED_API bool operator !=(const System::SharedPtr<Color>& x, const System::SharedPtr<Color>& y);
1424 
1425 } // namespace Pdf
1426 } // namespace Aspose
1427 
1428 
Abstract base class for poly- annotations.
Definition: PolyAnnotation.h:65
Class PDF3DCrossSection.
Definition: PDF3DCrossSection.h:53
Represents base pattern class.
Definition: PatternColorSpace.h:39
String class used across the library. Is a substitute for C# System.String when translating code...
Definition: string.h:121
Class representing line annotation.
Definition: LineAnnotation.h:74
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:64
Definition: Artifact.h:67
Represents text paragraphs as multiline text object.
Definition: TextParagraph.h:86
Definition: signed_info.h:13
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: fwd.h:22
ASPOSE_PDF_SHARED_API bool operator==(const System::SharedPtr< Color > &x, const System::SharedPtr< Color > &y)
Definition: AFRelationship.h:4
Represents a color. This type should be allocated on stack and passed to functions by value or by ref...
Definition: color.h:23
static ASPOSE_PDF_SHARED_API System::SharedPtr< Color > Empty
Represents empty color.
Definition: Color.h:109
Represents class for color value which can be expressed in different color space. ...
Definition: Color.h:79
Class PDF3DRenderMode.
Definition: PDF3DRenderMode.h:100
ColorSpace
The color spaces enumeration.
Definition: ColorSpace.h:20
Class PDF3DView.
Definition: PDF3DView.h:54
Abstract class representing common figure annotation.
Definition: CommonFigureAnnotation.h:47
Represents Redact annotation.
Definition: RedactionAnnotation.h:61
Represents a text state of a text fragment.
Definition: TextFragmentState.h:97
ASPOSE_PDF_SHARED_API bool operator!=(const System::SharedPtr< Color > &x, const System::SharedPtr< Color > &y)
Class representing annotation object.
Definition: Annotation.h:293
Represents a text state of a text
Definition: TextState.h:135
Whole PDF file will be submitted.