Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: core/fpdfapi/fpdf_page/cpdf_meshstream.h

Issue 2386423004: Move core/fpdfapi/fpdf_page to core/fpdfapi/page (Closed)
Patch Set: Rebase to master Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fpdfapi/fpdf_page/cpdf_imageobject.cpp ('k') | core/fpdfapi/fpdf_page/cpdf_meshstream.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 PDFium Authors. All rights reserved.
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_FPDF_PAGE_CPDF_MESHSTREAM_H_
8 #define CORE_FPDFAPI_FPDF_PAGE_CPDF_MESHSTREAM_H_
9
10 #include <memory>
11 #include <vector>
12
13 #include "core/fpdfapi/fpdf_page/cpdf_shadingpattern.h"
14 #include "core/fpdfapi/fpdf_parser/cpdf_stream_acc.h"
15 #include "core/fxcrt/fx_basic.h"
16 #include "core/fxcrt/fx_system.h"
17
18 struct CPDF_MeshVertex {
19 FX_FLOAT x;
20 FX_FLOAT y;
21 FX_FLOAT r;
22 FX_FLOAT g;
23 FX_FLOAT b;
24 };
25
26 class CFX_Matrix;
27 class CPDF_ColorSpace;
28 class CPDF_Function;
29 class CPDF_Stream;
30
31 class CPDF_MeshStream {
32 public:
33 CPDF_MeshStream(ShadingType type,
34 const std::vector<std::unique_ptr<CPDF_Function>>& funcs,
35 CPDF_Stream* pShadingStream,
36 CPDF_ColorSpace* pCS);
37
38 bool Load();
39
40 uint32_t GetFlag();
41 void GetCoords(FX_FLOAT& x, FX_FLOAT& y);
42 void GetColor(FX_FLOAT& r, FX_FLOAT& g, FX_FLOAT& b);
43
44 uint32_t GetVertex(CPDF_MeshVertex& vertex, CFX_Matrix* pObject2Bitmap);
45 FX_BOOL GetVertexRow(CPDF_MeshVertex* vertex,
46 int count,
47 CFX_Matrix* pObject2Bitmap);
48
49 CFX_BitStream* BitStream() { return &m_BitStream; }
50 uint32_t ComponentBits() const { return m_nComponentBits; }
51 uint32_t Components() const { return m_nComponents; }
52
53 private:
54 static const uint32_t kMaxComponents = 8;
55
56 const ShadingType m_type;
57 const std::vector<std::unique_ptr<CPDF_Function>>& m_funcs;
58 CPDF_Stream* const m_pShadingStream;
59 CPDF_ColorSpace* const m_pCS;
60 uint32_t m_nCoordBits;
61 uint32_t m_nComponentBits;
62 uint32_t m_nFlagBits;
63 uint32_t m_nComponents;
64 uint32_t m_CoordMax;
65 uint32_t m_ComponentMax;
66 FX_FLOAT m_xmin;
67 FX_FLOAT m_xmax;
68 FX_FLOAT m_ymin;
69 FX_FLOAT m_ymax;
70 FX_FLOAT m_ColorMin[kMaxComponents];
71 FX_FLOAT m_ColorMax[kMaxComponents];
72 CPDF_StreamAcc m_Stream;
73 CFX_BitStream m_BitStream;
74 };
75
76 #endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_MESHSTREAM_H_
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_page/cpdf_imageobject.cpp ('k') | core/fpdfapi/fpdf_page/cpdf_meshstream.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698