PoDoFo  1.0.0-dev
PdfColorSpace.h
1 
7 #ifndef PDF_COLOR_SPACE_H
8 #define PDF_COLOR_SPACE_H
9 
10 #include "PdfElement.h"
11 #include "PdfColorSpaceFilter.h"
12 
13 namespace PoDoFo {
14 
15 class PdfDocument;
16 
17 class PODOFO_API PdfColorSpace final : public PdfDictionaryElement
18 {
19  friend class PdfDocument;
20 private:
21  PdfColorSpace(PdfDocument& doc, const PdfColorSpaceFilterPtr& filter);
22 
23  PdfColorSpace(const PdfColorSpace&) = default;
24 public:
25  const PdfColorSpaceFilter& GetFilter() const { return *m_Filter; }
26  PdfColorSpaceFilterPtr GetFilterPtr() const { return m_Filter; }
27 private:
28  PdfColorSpaceFilterPtr m_Filter;
29 };
30 
35 class PODOFO_API PdfColorSpaceInitializer final
36 {
37  friend class PdfGraphicsStateWrapper;
38 
39  PODOFO_STACK_ONLY
40 
41 public:
45 
51  PdfColorSpaceInitializer(const PdfColorSpace& colorSpace);
55 
56 public:
57  PdfObject GetExportObject(PdfIndirectObjectList& objects) const;
58 
59  bool IsNull() const;
60 
62  PdfColorSpaceInitializer& operator=(const PdfColorSpaceInitializer&) = default;
63 
64 public:
65  const PdfColorSpaceFilter& GetFilter() const { return *m_Filter; }
66  PdfColorSpaceFilterPtr GetFilterPtr() const { return m_Filter; }
67 
68 private:
69  PdfColorSpaceFilterPtr Take(const PdfColorSpace*& element);
70 
71 private:
72  PdfColorSpaceFilterPtr m_Filter;
73  const PdfColorSpace* m_Element;
74 };
75 
76 }
77 
78 #endif // PDF_COLOR_SPACE_H
A class that implements methods to sample colors from a scanline buffer.
Definition: PdfColorSpaceFilter.h:31
A proxy class that can used to identify a color space choosing from several input types.
Definition: PdfColorSpace.h:36
A list of PdfObjects that constitutes the indirect object list of the document The PdfParser will rea...
Definition: PdfIndirectObjectList.h:30
This class represents a PDF indirect Object in memory.
Definition: PdfObject.h:35
SPDX-FileCopyrightText: (C) 2022 Francesco Pretto ceztko@gmail.com SPDX-License-Identifier: LGPL-2....
Definition: basetypes.h:16
std::shared_ptr< const PdfColorSpaceFilter > PdfColorSpaceFilterPtr
Convenience alias for a constant PdfColorSpaceFilter shared ptr.
Definition: PdfColorSpaceFilter.h:77
PdfColorSpaceType
Enum for the colorspaces supported by PDF.
Definition: PdfDeclarations.h:330