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_FXGE_DIB_DIB_INT_H_ | 7 #ifndef CORE_FXGE_DIB_DIB_INT_H_ |
8 #define CORE_FXGE_DIB_DIB_INT_H_ | 8 #define CORE_FXGE_DIB_DIB_INT_H_ |
9 | 9 |
10 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 22 matching lines...) Expand all Loading... |
33 } | 33 } |
34 int a, b, c, d, e, f; | 34 int a, b, c, d, e, f; |
35 int base; | 35 int base; |
36 }; | 36 }; |
37 #define FPDF_HUGE_IMAGE_SIZE 60000000 | 37 #define FPDF_HUGE_IMAGE_SIZE 60000000 |
38 struct PixelWeight { | 38 struct PixelWeight { |
39 int m_SrcStart; | 39 int m_SrcStart; |
40 int m_SrcEnd; | 40 int m_SrcEnd; |
41 int m_Weights[1]; | 41 int m_Weights[1]; |
42 }; | 42 }; |
| 43 |
43 class CWeightTable { | 44 class CWeightTable { |
44 public: | 45 public: |
45 CWeightTable() { m_pWeightTables = nullptr; } | 46 CWeightTable(); |
46 ~CWeightTable() { | 47 ~CWeightTable(); |
47 FX_Free(m_pWeightTables); | 48 |
48 m_pWeightTables = nullptr; | 49 bool Calc(int dest_len, |
49 } | |
50 void Calc(int dest_len, | |
51 int dest_min, | 50 int dest_min, |
52 int dest_max, | 51 int dest_max, |
53 int src_len, | 52 int src_len, |
54 int src_min, | 53 int src_min, |
55 int src_max, | 54 int src_max, |
56 int flags); | 55 int flags); |
57 PixelWeight* GetPixelWeight(int pixel) { | 56 PixelWeight* GetPixelWeight(int pixel) const; |
58 return (PixelWeight*)(m_pWeightTables + (pixel - m_DestMin) * m_ItemSize); | 57 int* GetValueFromPixelWeight(PixelWeight* pWeight, int index) const; |
59 } | 58 |
60 int m_DestMin, m_ItemSize; | 59 private: |
| 60 int m_DestMin; |
| 61 int m_ItemSize; |
61 uint8_t* m_pWeightTables; | 62 uint8_t* m_pWeightTables; |
| 63 size_t m_dwWeightTablesSize; |
62 }; | 64 }; |
63 class CStretchEngine { | 65 class CStretchEngine { |
64 public: | 66 public: |
65 CStretchEngine(IFX_ScanlineComposer* pDestBitmap, | 67 CStretchEngine(IFX_ScanlineComposer* pDestBitmap, |
66 FXDIB_Format dest_format, | 68 FXDIB_Format dest_format, |
67 int dest_width, | 69 int dest_width, |
68 int dest_height, | 70 int dest_height, |
69 const FX_RECT& clip_rect, | 71 const FX_RECT& clip_rect, |
70 const CFX_DIBSource* pSrcBitmap, | 72 const CFX_DIBSource* pSrcBitmap, |
71 int flags); | 73 int flags); |
(...skipping 26 matching lines...) Expand all Loading... |
98 int m_State; | 100 int m_State; |
99 }; | 101 }; |
100 | 102 |
101 FX_RECT FXDIB_SwapClipBox(FX_RECT& clip, | 103 FX_RECT FXDIB_SwapClipBox(FX_RECT& clip, |
102 int width, | 104 int width, |
103 int height, | 105 int height, |
104 FX_BOOL bFlipX, | 106 FX_BOOL bFlipX, |
105 FX_BOOL bFlipY); | 107 FX_BOOL bFlipY); |
106 | 108 |
107 #endif // CORE_FXGE_DIB_DIB_INT_H_ | 109 #endif // CORE_FXGE_DIB_DIB_INT_H_ |
OLD | NEW |