summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_meshstream.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-13 15:43:56 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-13 21:12:43 +0000
commit9787a7441a905e582b10d9ffc425098b3233d36c (patch)
tree130b8621f14ec7b85cfb6275276c3d71de526e69 /core/fpdfapi/page/cpdf_meshstream.h
parent9e41d0461d175410f6ea7573e729dc1ae14e846d (diff)
downloadpdfium-9787a7441a905e582b10d9ffc425098b3233d36c.tar.xz
Cleanup CPDF_MeshStream
This CL converts the MeshVertex to a point and the TransformPoint to the CFX_PointF override. Change-Id: I3faa5c14cedcf5af6aafca1c566acbc68577cca7 Reviewed-on: https://pdfium-review.googlesource.com/2610 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_meshstream.h')
-rw-r--r--core/fpdfapi/page/cpdf_meshstream.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/core/fpdfapi/page/cpdf_meshstream.h b/core/fpdfapi/page/cpdf_meshstream.h
index 21a6c2fa8c..24f1d66cfd 100644
--- a/core/fpdfapi/page/cpdf_meshstream.h
+++ b/core/fpdfapi/page/cpdf_meshstream.h
@@ -8,6 +8,7 @@
#define CORE_FPDFAPI_PAGE_CPDF_MESHSTREAM_H_
#include <memory>
+#include <tuple>
#include <vector>
#include "core/fpdfapi/page/cpdf_shadingpattern.h"
@@ -15,9 +16,13 @@
#include "core/fxcrt/fx_basic.h"
#include "core/fxcrt/fx_system.h"
-struct CPDF_MeshVertex {
- FX_FLOAT x;
- FX_FLOAT y;
+class CPDF_MeshVertex {
+ public:
+ CPDF_MeshVertex();
+ CPDF_MeshVertex(const CPDF_MeshVertex&);
+ ~CPDF_MeshVertex();
+
+ CFX_PointF position;
FX_FLOAT r;
FX_FLOAT g;
FX_FLOAT b;
@@ -37,14 +42,14 @@ class CPDF_MeshStream {
bool Load();
- uint32_t GetFlag();
- void GetCoords(FX_FLOAT& x, FX_FLOAT& y);
- void GetColor(FX_FLOAT& r, FX_FLOAT& g, FX_FLOAT& b);
+ uint32_t ReadFlag();
+ CFX_PointF ReadCoords();
+ std::tuple<FX_FLOAT, FX_FLOAT, FX_FLOAT> ReadColor();
- uint32_t GetVertex(CPDF_MeshVertex& vertex, CFX_Matrix* pObject2Bitmap);
- bool GetVertexRow(CPDF_MeshVertex* vertex,
- int count,
- CFX_Matrix* pObject2Bitmap);
+ CPDF_MeshVertex ReadVertex(const CFX_Matrix& pObject2Bitmap, uint32_t* flag);
+ bool ReadVertexRow(const CFX_Matrix& pObject2Bitmap,
+ int count,
+ CPDF_MeshVertex* vertex);
CFX_BitStream* BitStream() { return &m_BitStream; }
uint32_t ComponentBits() const { return m_nComponentBits; }