| 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_FXCODEC_CODEC_INCLUDE_CCODEC_PROGRESSIVEDECODER_H_ | 7 #ifndef CORE_FXCODEC_CODEC_INCLUDE_CCODEC_PROGRESSIVEDECODER_H_ |
| 8 #define CORE_FXCODEC_CODEC_INCLUDE_CCODEC_PROGRESSIVEDECODER_H_ | 8 #define CORE_FXCODEC_CODEC_INCLUDE_CCODEC_PROGRESSIVEDECODER_H_ |
| 9 | 9 |
| 10 #include "core/fxcodec/include/fx_codec_def.h" | 10 #include "core/fxcodec/include/fx_codec_def.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 FXCODEC_STATUS ContinueDecode(IFX_Pause* pPause = nullptr); | 66 FXCODEC_STATUS ContinueDecode(IFX_Pause* pPause = nullptr); |
| 67 | 67 |
| 68 struct PixelWeight { | 68 struct PixelWeight { |
| 69 int m_SrcStart; | 69 int m_SrcStart; |
| 70 int m_SrcEnd; | 70 int m_SrcEnd; |
| 71 int m_Weights[1]; | 71 int m_Weights[1]; |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 class CFXCODEC_WeightTable { | 74 class CFXCODEC_WeightTable { |
| 75 public: | 75 public: |
| 76 CFXCODEC_WeightTable() { m_pWeightTables = NULL; } | 76 CFXCODEC_WeightTable() { m_pWeightTables = nullptr; } |
| 77 ~CFXCODEC_WeightTable() { FX_Free(m_pWeightTables); } | 77 ~CFXCODEC_WeightTable() { FX_Free(m_pWeightTables); } |
| 78 | 78 |
| 79 void Calc(int dest_len, | 79 void Calc(int dest_len, |
| 80 int dest_min, | 80 int dest_min, |
| 81 int dest_max, | 81 int dest_max, |
| 82 int src_len, | 82 int src_len, |
| 83 int src_min, | 83 int src_min, |
| 84 int src_max, | 84 int src_max, |
| 85 FX_BOOL bInterpol); | 85 FX_BOOL bInterpol); |
| 86 PixelWeight* GetPixelWeight(int pixel) { | 86 PixelWeight* GetPixelWeight(int pixel) { |
| 87 return (PixelWeight*)(m_pWeightTables + (pixel - m_DestMin) * m_ItemSize); | 87 return (PixelWeight*)(m_pWeightTables + (pixel - m_DestMin) * m_ItemSize); |
| 88 } | 88 } |
| 89 | 89 |
| 90 int m_DestMin, m_ItemSize; | 90 int m_DestMin, m_ItemSize; |
| 91 uint8_t* m_pWeightTables; | 91 uint8_t* m_pWeightTables; |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 class CFXCODEC_HorzTable { | 94 class CFXCODEC_HorzTable { |
| 95 public: | 95 public: |
| 96 CFXCODEC_HorzTable() { m_pWeightTables = NULL; } | 96 CFXCODEC_HorzTable() { m_pWeightTables = nullptr; } |
| 97 ~CFXCODEC_HorzTable() { FX_Free(m_pWeightTables); } | 97 ~CFXCODEC_HorzTable() { FX_Free(m_pWeightTables); } |
| 98 | 98 |
| 99 void Calc(int dest_len, int src_len, FX_BOOL bInterpol); | 99 void Calc(int dest_len, int src_len, FX_BOOL bInterpol); |
| 100 PixelWeight* GetPixelWeight(int pixel) { | 100 PixelWeight* GetPixelWeight(int pixel) { |
| 101 return (PixelWeight*)(m_pWeightTables + pixel * m_ItemSize); | 101 return (PixelWeight*)(m_pWeightTables + pixel * m_ItemSize); |
| 102 } | 102 } |
| 103 | 103 |
| 104 int m_ItemSize; | 104 int m_ItemSize; |
| 105 uint8_t* m_pWeightTables; | 105 uint8_t* m_pWeightTables; |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 class CFXCODEC_VertTable { | 108 class CFXCODEC_VertTable { |
| 109 public: | 109 public: |
| 110 CFXCODEC_VertTable() { m_pWeightTables = NULL; } | 110 CFXCODEC_VertTable() { m_pWeightTables = nullptr; } |
| 111 ~CFXCODEC_VertTable() { FX_Free(m_pWeightTables); } | 111 ~CFXCODEC_VertTable() { FX_Free(m_pWeightTables); } |
| 112 void Calc(int dest_len, int src_len); | 112 void Calc(int dest_len, int src_len); |
| 113 PixelWeight* GetPixelWeight(int pixel) { | 113 PixelWeight* GetPixelWeight(int pixel) { |
| 114 return (PixelWeight*)(m_pWeightTables + pixel * m_ItemSize); | 114 return (PixelWeight*)(m_pWeightTables + pixel * m_ItemSize); |
| 115 } | 115 } |
| 116 int m_ItemSize; | 116 int m_ItemSize; |
| 117 uint8_t* m_pWeightTables; | 117 uint8_t* m_pWeightTables; |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 IFX_FileRead* m_pFile; | 120 IFX_FileRead* m_pFile; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 FXCODEC_STATUS& err_status); | 221 FXCODEC_STATUS& err_status); |
| 222 void GifDoubleLineResampleVert(CFX_DIBitmap* pDeviceBitmap, | 222 void GifDoubleLineResampleVert(CFX_DIBitmap* pDeviceBitmap, |
| 223 double scale_y, | 223 double scale_y, |
| 224 int des_row); | 224 int des_row); |
| 225 FX_BOOL BmpReadMoreData(CCodec_BmpModule* pBmpModule, | 225 FX_BOOL BmpReadMoreData(CCodec_BmpModule* pBmpModule, |
| 226 FXCODEC_STATUS& err_status); | 226 FXCODEC_STATUS& err_status); |
| 227 void ResampleVertBT(CFX_DIBitmap* pDeviceBitmap, double scale_y, int des_row); | 227 void ResampleVertBT(CFX_DIBitmap* pDeviceBitmap, double scale_y, int des_row); |
| 228 }; | 228 }; |
| 229 | 229 |
| 230 #endif // CORE_FXCODEC_CODEC_INCLUDE_CCODEC_PROGRESSIVEDECODER_H_ | 230 #endif // CORE_FXCODEC_CODEC_INCLUDE_CCODEC_PROGRESSIVEDECODER_H_ |
| OLD | NEW |