OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_ | 7 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_ |
8 #define CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_ | 8 #define CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_ |
9 | 9 |
10 #include "../../../third_party/base/nonstd_unique_ptr.h" | 10 #include "../../../third_party/base/nonstd_unique_ptr.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 class CPDF_ShadingObject; | 26 class CPDF_ShadingObject; |
27 class CPDF_TextObject; | 27 class CPDF_TextObject; |
28 class IFX_Pause; | 28 class IFX_Pause; |
29 | 29 |
30 class IPDF_OCContext | 30 class IPDF_OCContext |
31 { | 31 { |
32 public: | 32 public: |
33 | 33 |
34 virtual ~IPDF_OCContext() {} | 34 virtual ~IPDF_OCContext() {} |
35 | 35 |
36 virtual FX_BOOL» CheckOCGVisible(const CPDF_Dictionary* pOCG) = 0; | 36 virtual bool» CheckOCGVisible(const CPDF_Dictionary* pOCG) = 0; |
37 | 37 |
38 FX_BOOL CheckObjectVisible(const CPDF_PageObject* pObj); | 38 bool CheckObjectVisible(const CPDF_PageObject* pObj); |
39 }; | 39 }; |
40 #define RENDER_COLOR_NORMAL 0 | 40 #define RENDER_COLOR_NORMAL 0 |
41 #define RENDER_COLOR_GRAY 1 | 41 #define RENDER_COLOR_GRAY 1 |
42 #define RENDER_COLOR_TWOCOLOR 2 | 42 #define RENDER_COLOR_TWOCOLOR 2 |
43 #define RENDER_COLOR_ALPHA 3 | 43 #define RENDER_COLOR_ALPHA 3 |
44 #define RENDER_CLEARTYPE 0x00000001 | 44 #define RENDER_CLEARTYPE 0x00000001 |
45 #define RENDER_PRINTGRAPHICTEXT 0x00000002 | 45 #define RENDER_PRINTGRAPHICTEXT 0x00000002 |
46 #define RENDER_FORCE_DOWNSAMPLE 0x00000004 | 46 #define RENDER_FORCE_DOWNSAMPLE 0x00000004 |
47 #define RENDER_PRINTPREVIEW 0x00000008 | 47 #define RENDER_PRINTPREVIEW 0x00000008 |
48 #define RENDER_BGR_STRIPE 0x00000010 | 48 #define RENDER_BGR_STRIPE 0x00000010 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 int m_HalftoneLimit; | 82 int m_HalftoneLimit; |
83 | 83 |
84 FX_ARGB TranslateColor(FX_ARGB argb) const; | 84 FX_ARGB TranslateColor(FX_ARGB argb) const; |
85 }; | 85 }; |
86 class CPDF_RenderContext | 86 class CPDF_RenderContext |
87 { | 87 { |
88 public: | 88 public: |
89 | 89 |
90 CPDF_RenderContext(); | 90 CPDF_RenderContext(); |
91 | 91 |
92 void» » » Create(CPDF_Page* pPage, FX_BOOL bFirstLayer = T
RUE); | 92 void» » » Create(CPDF_Page* pPage, bool bFirstLayer = true
); |
93 | 93 |
94 void Create(CPDF_Document* pDoc = NULL, CPDF_PageRend
erCache* pPageCache = NULL, | 94 void Create(CPDF_Document* pDoc = NULL, CPDF_PageRend
erCache* pPageCache = NULL, |
95 CPDF_Dictionary* pPageResources = NULL, FX_BOOL bFirs
tLayer = TRUE); | 95 CPDF_Dictionary* pPageResources = NULL, bool bFirstLa
yer = true); |
96 | 96 |
97 ~CPDF_RenderContext(); | 97 ~CPDF_RenderContext(); |
98 | 98 |
99 void Clear(); | 99 void Clear(); |
100 | 100 |
101 void AppendObjectList(CPDF_PageObjects* pObjs, const
CFX_AffineMatrix* pObject2Device); | 101 void AppendObjectList(CPDF_PageObjects* pObjs, const
CFX_AffineMatrix* pObject2Device); |
102 | 102 |
103 void Render(CFX_RenderDevice* pDevice, const CPDF_Ren
derOptions* pOptions = NULL, | 103 void Render(CFX_RenderDevice* pDevice, const CPDF_Ren
derOptions* pOptions = NULL, |
104 const CFX_AffineMatrix* pFinalMatrix = NULL); | 104 const CFX_AffineMatrix* pFinalMatrix = NULL); |
105 | 105 |
(...skipping 13 matching lines...) Expand all Loading... |
119 CPDF_Document* m_pDocument; | 119 CPDF_Document* m_pDocument; |
120 | 120 |
121 CPDF_Dictionary* m_pPageResources; | 121 CPDF_Dictionary* m_pPageResources; |
122 | 122 |
123 CPDF_PageRenderCache* m_pPageCache; | 123 CPDF_PageRenderCache* m_pPageCache; |
124 | 124 |
125 protected: | 125 protected: |
126 | 126 |
127 CFX_ArrayTemplate<struct _PDF_RenderItem> m_ContentList; | 127 CFX_ArrayTemplate<struct _PDF_RenderItem> m_ContentList; |
128 | 128 |
129 FX_BOOL» » » » » m_bFirstLayer; | 129 bool» » » » » m_bFirstLayer; |
130 | 130 |
131 void Render(CFX_RenderDevice* pDevice, const CPDF_Pag
eObject* pStopObj, | 131 void Render(CFX_RenderDevice* pDevice, const CPDF_Pag
eObject* pStopObj, |
132 const CPDF_RenderOptions* pOptions, const CFX_AffineM
atrix* pFinalMatrix); | 132 const CPDF_RenderOptions* pOptions, const CFX_AffineM
atrix* pFinalMatrix); |
133 friend class CPDF_RenderStatus; | 133 friend class CPDF_RenderStatus; |
134 friend class CPDF_ProgressiveRenderer; | 134 friend class CPDF_ProgressiveRenderer; |
135 }; | 135 }; |
136 | 136 |
137 class CPDF_ProgressiveRenderer | 137 class CPDF_ProgressiveRenderer |
138 { | 138 { |
139 public: | 139 public: |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 CPDF_Font* pFont, | 185 CPDF_Font* pFont, |
186 FX_FLOAT font_size, | 186 FX_FLOAT font_size, |
187 const CFX_AffineMatrix* matrix, | 187 const CFX_AffineMatrix* matrix, |
188 const CFX_ByteString& str, | 188 const CFX_ByteString& str, |
189 FX_ARGB fill_argb, | 189 FX_ARGB fill_argb, |
190 FX_ARGB stroke_argb = 0, | 190 FX_ARGB stroke_argb = 0, |
191 const CFX_GraphStateData* pGraphState = NULL, | 191 const CFX_GraphStateData* pGraphState = NULL, |
192 const CPDF_RenderOptions* pOptions = NULL | 192 const CPDF_RenderOptions* pOptions = NULL |
193 ); | 193 ); |
194 | 194 |
195 static FX_BOOL» DrawTextPath(CFX_RenderDevice* pDevice, int nChars, FX_D
WORD* pCharCodes, FX_FLOAT* pCharPos, | 195 static bool»DrawTextPath(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pC
harCodes, FX_FLOAT* pCharPos, |
196 CPDF_Font* pFont, FX_FLOAT font_size, | 196 CPDF_Font* pFont, FX_FLOAT font_size, |
197 const CFX_AffineMatrix* pText2User, const CFX_A
ffineMatrix* pUser2Device, | 197 const CFX_AffineMatrix* pText2User, const CFX_A
ffineMatrix* pUser2Device, |
198 const CFX_GraphStateData* pGraphState, | 198 const CFX_GraphStateData* pGraphState, |
199 FX_ARGB fill_argb, FX_ARGB stroke_argb, CFX_Pat
hData* pClippingPath, int nFlag = 0); | 199 FX_ARGB fill_argb, FX_ARGB stroke_argb, CFX_Pat
hData* pClippingPath, int nFlag = 0); |
200 | 200 |
201 static FX_BOOL» DrawNormalText(CFX_RenderDevice* pDevice, int nChars, FX
_DWORD* pCharCodes, FX_FLOAT* pCharPos, | 201 static bool»DrawNormalText(CFX_RenderDevice* pDevice, int nChars, FX_DWORD*
pCharCodes, FX_FLOAT* pCharPos, |
202 CPDF_Font* pFont, FX_FLOAT font_size, const C
FX_AffineMatrix* pText2Device, | 202 CPDF_Font* pFont, FX_FLOAT font_size, const C
FX_AffineMatrix* pText2Device, |
203 FX_ARGB fill_argb, const CPDF_RenderOptions*
pOptions); | 203 FX_ARGB fill_argb, const CPDF_RenderOptions*
pOptions); |
204 | 204 |
205 static FX_BOOL» DrawType3Text(CFX_RenderDevice* pDevice, int nChars, FX_
DWORD* pCharCodes, FX_FLOAT* pCharPos, | 205 static bool»DrawType3Text(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* p
CharCodes, FX_FLOAT* pCharPos, |
206 CPDF_Font* pFont, FX_FLOAT font_size, const CF
X_AffineMatrix* pText2Device, | 206 CPDF_Font* pFont, FX_FLOAT font_size, const CF
X_AffineMatrix* pText2Device, |
207 FX_ARGB fill_argb); | 207 FX_ARGB fill_argb); |
208 }; | 208 }; |
209 class CPDF_PageRenderCache | 209 class CPDF_PageRenderCache |
210 { | 210 { |
211 public: | 211 public: |
212 CPDF_PageRenderCache(CPDF_Page* pPage) | 212 CPDF_PageRenderCache(CPDF_Page* pPage) |
213 { | 213 { |
214 m_pPage = pPage; | 214 m_pPage = pPage; |
215 m_nTimeCount = 0; | 215 m_nTimeCount = 0; |
216 m_nCacheSize = 0; | 216 m_nCacheSize = 0; |
217 m_pCurImageCache = NULL; | 217 m_pCurImageCache = NULL; |
218 m_bCurFindCache = FALSE; | 218 m_bCurFindCache = false; |
219 m_pCurImageCaches = NULL; | 219 m_pCurImageCaches = NULL; |
220 } | 220 } |
221 ~CPDF_PageRenderCache() | 221 ~CPDF_PageRenderCache() |
222 { | 222 { |
223 ClearAll(); | 223 ClearAll(); |
224 } | 224 } |
225 void ClearAll(); | 225 void ClearAll(); |
226 void ClearImageData(); | 226 void ClearImageData(); |
227 | 227 |
228 FX_DWORD EstimateSize(); | 228 FX_DWORD EstimateSize(); |
229 void CacheOptimization(int32_t dwLimitCacheSi
ze); | 229 void CacheOptimization(int32_t dwLimitCacheSi
ze); |
230 FX_DWORD GetCachedSize(CPDF_Stream* pStream) const; | 230 FX_DWORD GetCachedSize(CPDF_Stream* pStream) const; |
231 FX_DWORD GetTimeCount() const | 231 FX_DWORD GetTimeCount() const |
232 { | 232 { |
233 return m_nTimeCount; | 233 return m_nTimeCount; |
234 } | 234 } |
235 void SetTimeCount(FX_DWORD dwTimeCount) | 235 void SetTimeCount(FX_DWORD dwTimeCount) |
236 { | 236 { |
237 m_nTimeCount = dwTimeCount; | 237 m_nTimeCount = dwTimeCount; |
238 } | 238 } |
239 | 239 |
240 void GetCachedBitmap(CPDF_Stream* pStream, CF
X_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor, | 240 void GetCachedBitmap(CPDF_Stream* pStream, CF
X_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor, |
241 FX_BOOL bStdCS = FALSE, FX_DWORD GroupFa
mily = 0, FX_BOOL bLoadMask = FALSE, | 241 bool bStdCS = false, FX_DWORD GroupFamil
y = 0, bool bLoadMask = false, |
242 CPDF_RenderStatus* pRenderStatus = NULL,
int32_t downsampleWidth = 0, int32_t downsampleHeight = 0); | 242 CPDF_RenderStatus* pRenderStatus = NULL,
int32_t downsampleWidth = 0, int32_t downsampleHeight = 0); |
243 | 243 |
244 void ResetBitmap(CPDF_Stream* pStream, const
CFX_DIBitmap* pBitmap); | 244 void ResetBitmap(CPDF_Stream* pStream, const
CFX_DIBitmap* pBitmap); |
245 void ClearImageCache(CPDF_Stream* pStream); | 245 void ClearImageCache(CPDF_Stream* pStream); |
246 CPDF_Page* GetPage() | 246 CPDF_Page* GetPage() |
247 { | 247 { |
248 return m_pPage; | 248 return m_pPage; |
249 } | 249 } |
250 CFX_MapPtrToPtr m_ImageCaches; | 250 CFX_MapPtrToPtr m_ImageCaches; |
251 public: | 251 public: |
252 FX_BOOL» » » » StartGetCachedBitmap(CPDF_Stream* pStrea
m, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, | 252 bool» » » » StartGetCachedBitmap(CPDF_Stream* pStrea
m, bool bStdCS = false, FX_DWORD GroupFamily = 0, |
253 FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL, | 253 bool bLoadMask = false, CPDF_RenderStatus* pRenderStatus = NULL, |
254 int32_t downsampleWidth = 0, int32_t downsampleHeight = 0); | 254 int32_t downsampleWidth = 0, int32_t downsampleHeight = 0); |
255 | 255 |
256 FX_BOOL» » » » Continue(IFX_Pause* pPause); | 256 bool» » » » Continue(IFX_Pause* pPause); |
257 CPDF_ImageCache* m_pCurImageCache; | 257 CPDF_ImageCache* m_pCurImageCache; |
258 CFX_PtrArray* m_pCurImageCaches; | 258 CFX_PtrArray* m_pCurImageCaches; |
259 protected: | 259 protected: |
260 friend class CPDF_Page; | 260 friend class CPDF_Page; |
261 CPDF_Page* m_pPage; | 261 CPDF_Page* m_pPage; |
262 | 262 |
263 FX_DWORD m_nTimeCount; | 263 FX_DWORD m_nTimeCount; |
264 FX_DWORD m_nCacheSize; | 264 FX_DWORD m_nCacheSize; |
265 FX_BOOL» » » » m_bCurFindCache; | 265 bool» » » » m_bCurFindCache; |
266 }; | 266 }; |
267 class CPDF_RenderConfig | 267 class CPDF_RenderConfig |
268 { | 268 { |
269 public: | 269 public: |
270 CPDF_RenderConfig(); | 270 CPDF_RenderConfig(); |
271 ~CPDF_RenderConfig(); | 271 ~CPDF_RenderConfig(); |
272 int m_HalftoneLimit; | 272 int m_HalftoneLimit; |
273 int m_RenderStepLimit; | 273 int m_RenderStepLimit; |
274 }; | 274 }; |
275 | 275 |
276 #endif // CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_ | 276 #endif // CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_ |
OLD | NEW |