| 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 _FX_CODEC_PROGRESS_H_ | 7 #ifndef _FX_CODEC_PROGRESS_H_ |
| 8 #define _FX_CODEC_PROGRESS_H_ | 8 #define _FX_CODEC_PROGRESS_H_ |
| 9 #define FXCODEC_BLOCK_SIZE 4096 | 9 #define FXCODEC_BLOCK_SIZE 4096 |
| 10 #define FXCODEC_PNG_GAMMA 2.2 | 10 #define FXCODEC_PNG_GAMMA 2.2 |
| 11 #if _FX_OS_ == _FX_MACOSX_ || _FX_OS_ == _FX_IOS_ | 11 #if _FX_OS_ == _FX_MACOSX_ || _FX_OS_ == _FX_IOS_ |
| 12 # undef FXCODEC_PNG_GAMMA | 12 # undef FXCODEC_PNG_GAMMA |
| 13 # define FXCODEC_PNG_GAMMA 1.7 | 13 # define FXCODEC_PNG_GAMMA 1.7 |
| 14 #endif | 14 #endif |
| 15 struct PixelWeight { | 15 struct PixelWeight { |
| 16 int m_SrcStart; | 16 int m_SrcStart; |
| 17 int m_SrcEnd; | 17 int m_SrcEnd; |
| 18 int m_Weights[1]; | 18 int m_Weights[1]; |
| 19 }; | 19 }; |
| 20 class CFXCODEC_WeightTable : public CFX_Object | 20 class CFXCODEC_WeightTable |
| 21 { | 21 { |
| 22 public: | 22 public: |
| 23 CFXCODEC_WeightTable() | 23 CFXCODEC_WeightTable() |
| 24 { | 24 { |
| 25 m_pWeightTables = NULL; | 25 m_pWeightTables = NULL; |
| 26 } | 26 } |
| 27 ~CFXCODEC_WeightTable() | 27 ~CFXCODEC_WeightTable() |
| 28 { | 28 { |
| 29 if(m_pWeightTables != NULL) { | 29 if(m_pWeightTables != NULL) { |
| 30 FX_Free(m_pWeightTables); | 30 FX_Free(m_pWeightTables); |
| 31 } | 31 } |
| 32 } | 32 } |
| 33 | 33 |
| 34 void Calc(int dest_len, int dest_min, int dest_max, i
nt src_len, int src_min, int src_max, FX_BOOL bInterpol); | 34 void Calc(int dest_len, int dest_min, int dest_max, i
nt src_len, int src_min, int src_max, FX_BOOL bInterpol); |
| 35 PixelWeight* GetPixelWeight(int pixel) | 35 PixelWeight* GetPixelWeight(int pixel) |
| 36 { | 36 { |
| 37 return (PixelWeight*)(m_pWeightTables + (pixel - m_DestMin) * m_ItemSize
); | 37 return (PixelWeight*)(m_pWeightTables + (pixel - m_DestMin) * m_ItemSize
); |
| 38 } | 38 } |
| 39 | 39 |
| 40 int m_DestMin, m_ItemSize; | 40 int m_DestMin, m_ItemSize; |
| 41 FX_LPBYTE m_pWeightTables; | 41 FX_LPBYTE m_pWeightTables; |
| 42 }; | 42 }; |
| 43 class CFXCODEC_HorzTable : public CFX_Object | 43 class CFXCODEC_HorzTable |
| 44 { | 44 { |
| 45 public: | 45 public: |
| 46 CFXCODEC_HorzTable() | 46 CFXCODEC_HorzTable() |
| 47 { | 47 { |
| 48 m_pWeightTables = NULL; | 48 m_pWeightTables = NULL; |
| 49 } | 49 } |
| 50 ~CFXCODEC_HorzTable() | 50 ~CFXCODEC_HorzTable() |
| 51 { | 51 { |
| 52 if(m_pWeightTables != NULL) { | 52 if(m_pWeightTables != NULL) { |
| 53 FX_Free(m_pWeightTables); | 53 FX_Free(m_pWeightTables); |
| 54 } | 54 } |
| 55 } | 55 } |
| 56 | 56 |
| 57 void Calc(int dest_len, int src_len, FX_BOOL bInterpo
l); | 57 void Calc(int dest_len, int src_len, FX_BOOL bInterpo
l); |
| 58 PixelWeight* GetPixelWeight(int pixel) | 58 PixelWeight* GetPixelWeight(int pixel) |
| 59 { | 59 { |
| 60 return (PixelWeight*)(m_pWeightTables + pixel * m_ItemSize); | 60 return (PixelWeight*)(m_pWeightTables + pixel * m_ItemSize); |
| 61 } | 61 } |
| 62 | 62 |
| 63 int m_ItemSize; | 63 int m_ItemSize; |
| 64 FX_LPBYTE m_pWeightTables; | 64 FX_LPBYTE m_pWeightTables; |
| 65 }; | 65 }; |
| 66 class CFXCODEC_VertTable : public CFX_Object | 66 class CFXCODEC_VertTable |
| 67 { | 67 { |
| 68 public: | 68 public: |
| 69 CFXCODEC_VertTable() | 69 CFXCODEC_VertTable() |
| 70 { | 70 { |
| 71 m_pWeightTables = NULL; | 71 m_pWeightTables = NULL; |
| 72 } | 72 } |
| 73 ~CFXCODEC_VertTable() | 73 ~CFXCODEC_VertTable() |
| 74 { | 74 { |
| 75 if(m_pWeightTables != NULL) { | 75 if(m_pWeightTables != NULL) { |
| 76 FX_Free(m_pWeightTables); | 76 FX_Free(m_pWeightTables); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 int m_FrameCur; | 197 int m_FrameCur; |
| 198 int m_GifBgIndex; | 198 int m_GifBgIndex; |
| 199 FX_LPBYTE m_pGifPalette; | 199 FX_LPBYTE m_pGifPalette; |
| 200 FX_INT32 m_GifPltNumber; | 200 FX_INT32 m_GifPltNumber; |
| 201 int m_GifTransIndex; | 201 int m_GifTransIndex; |
| 202 FX_RECT m_GifFrameRect; | 202 FX_RECT m_GifFrameRect; |
| 203 FX_BOOL m_BmpIsTopBottom; | 203 FX_BOOL m_BmpIsTopBottom; |
| 204 FXCODEC_STATUS m_status; | 204 FXCODEC_STATUS m_status; |
| 205 }; | 205 }; |
| 206 #endif | 206 #endif |
| OLD | NEW |