Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cpdf_meshstream.h
Go to the documentation of this file.
1// Copyright 2016 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#ifndef CORE_FPDFAPI_PAGE_CPDF_MESHSTREAM_H_
8#define CORE_FPDFAPI_PAGE_CPDF_MESHSTREAM_H_
9
10#include <stdint.h>
11
12#include <array>
13#include <memory>
14#include <vector>
15
16#include "core/fpdfapi/page/cpdf_shadingpattern.h"
17#include "core/fxcrt/retain_ptr.h"
18#include "core/fxge/dib/fx_dib.h"
19
20class CPDF_StreamAcc;
21
31
32class CFX_BitStream;
33class CFX_Matrix;
34class CPDF_ColorSpace;
35class CPDF_Function;
36class CPDF_Stream;
37
39 public:
41 const std::vector<std::unique_ptr<CPDF_Function>>& funcs,
42 RetainPtr<const CPDF_Stream> pShadingStream,
45
46 bool Load();
47 void SkipBits(uint32_t nbits);
48 void ByteAlign();
49
50 bool IsEOF() const;
51 bool CanReadFlag() const;
52 bool CanReadCoords() const;
53 bool CanReadColor() const;
54
55 uint32_t ReadFlag() const;
56 CFX_PointF ReadCoords() const;
57 FX_RGB_STRUCT<float> ReadColor() const;
58
59 bool ReadVertex(const CFX_Matrix& pObject2Bitmap,
60 CPDF_MeshVertex* vertex,
61 uint32_t* flag);
62 std::vector<CPDF_MeshVertex> ReadVertexRow(const CFX_Matrix& pObject2Bitmap,
63 int count);
64
65 uint32_t ComponentBits() const { return m_nComponentBits; }
66 uint32_t Components() const { return m_nComponents; }
67
68 private:
69 static constexpr uint32_t kMaxComponents = 8;
70
71 const ShadingType m_type;
72 const std::vector<std::unique_ptr<CPDF_Function>>& m_funcs;
73 RetainPtr<const CPDF_Stream> const m_pShadingStream;
74 RetainPtr<CPDF_ColorSpace> const m_pCS;
75 uint32_t m_nCoordBits = 0;
76 uint32_t m_nComponentBits = 0;
77 uint32_t m_nFlagBits = 0;
78 uint32_t m_nComponents = 0;
79 uint32_t m_CoordMax = 0;
80 uint32_t m_ComponentMax = 0;
81 float m_xmin = 0.0f;
82 float m_xmax = 0.0f;
83 float m_ymin = 0.0f;
84 float m_ymax = 0.0f;
85 RetainPtr<CPDF_StreamAcc> m_pStream;
86 std::unique_ptr<CFX_BitStream> m_BitStream;
87 std::array<float, kMaxComponents> m_ColorMin = {};
88 std::array<float, kMaxComponents> m_ColorMax = {};
89};
90
91#endif // CORE_FPDFAPI_PAGE_CPDF_MESHSTREAM_H_
#define DCHECK
Definition check.h:33
std::vector< RetainPtr< CPDF_Object > >::const_iterator const_iterator
Definition cpdf_array.h:29
std::map< ByteString, RetainPtr< CPDF_Object >, std::less<> > DictMap
CFX_PointF ReadCoords() const
uint32_t ComponentBits() const
uint32_t ReadFlag() const
uint32_t Components() const
bool CanReadCoords() const
bool CanReadFlag() const
bool ReadVertex(const CFX_Matrix &pObject2Bitmap, CPDF_MeshVertex *vertex, uint32_t *flag)
void SkipBits(uint32_t nbits)
FX_RGB_STRUCT< float > ReadColor() const
bool CanReadColor() const
CPDF_MeshStream(ShadingType type, const std::vector< std::unique_ptr< CPDF_Function > > &funcs, RetainPtr< const CPDF_Stream > pShadingStream, RetainPtr< CPDF_ColorSpace > pCS)
std::vector< CPDF_MeshVertex > ReadVertexRow(const CFX_Matrix &pObject2Bitmap, int count)
CFX_PointF position
FX_RGB_STRUCT< float > rgb
CPDF_MeshVertex(const CPDF_MeshVertex &)
@ kCoonsPatchMeshShading
@ kTensorProductPatchMeshShading
@ kLatticeFormGouraudTriangleMeshShading
@ kFreeFormGouraudTriangleMeshShading
CFX_PTemplate< float > CFX_PointF