| 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 #include "../../../include/fxcodec/fx_codec.h" | 7 #include "../../../include/fxcodec/fx_codec.h" |
| 8 #include "codec_int.h" | 8 #include "codec_int.h" |
| 9 CCodec_ModuleMgr::CCodec_ModuleMgr() | 9 CCodec_ModuleMgr::CCodec_ModuleMgr() |
| 10 : m_pBasicModule(new CCodec_BasicModule), | 10 : m_pBasicModule(new CCodec_BasicModule), |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 } | 210 } |
| 211 FX_BOOL CCodec_BasicModule::A85Encode(const uint8_t* src_buf, | 211 FX_BOOL CCodec_BasicModule::A85Encode(const uint8_t* src_buf, |
| 212 FX_DWORD src_size, | 212 FX_DWORD src_size, |
| 213 uint8_t*& dest_buf, | 213 uint8_t*& dest_buf, |
| 214 FX_DWORD& dest_size) { | 214 FX_DWORD& dest_size) { |
| 215 return FALSE; | 215 return FALSE; |
| 216 } | 216 } |
| 217 class CCodec_RLScanlineDecoder : public CCodec_ScanlineDecoder { | 217 class CCodec_RLScanlineDecoder : public CCodec_ScanlineDecoder { |
| 218 public: | 218 public: |
| 219 CCodec_RLScanlineDecoder(); | 219 CCodec_RLScanlineDecoder(); |
| 220 virtual ~CCodec_RLScanlineDecoder(); | 220 ~CCodec_RLScanlineDecoder() override; |
| 221 |
| 221 FX_BOOL Create(const uint8_t* src_buf, | 222 FX_BOOL Create(const uint8_t* src_buf, |
| 222 FX_DWORD src_size, | 223 FX_DWORD src_size, |
| 223 int width, | 224 int width, |
| 224 int height, | 225 int height, |
| 225 int nComps, | 226 int nComps, |
| 226 int bpc); | 227 int bpc); |
| 227 virtual void v_DownScale(int dest_width, int dest_height) {} | 228 |
| 228 virtual FX_BOOL v_Rewind(); | 229 // CCodec_ScanlineDecoder |
| 229 virtual uint8_t* v_GetNextLine(); | 230 void v_DownScale(int dest_width, int dest_height) override {} |
| 230 virtual FX_DWORD GetSrcOffset() { return m_SrcOffset; } | 231 FX_BOOL v_Rewind() override; |
| 232 uint8_t* v_GetNextLine() override; |
| 233 FX_DWORD GetSrcOffset() override { return m_SrcOffset; } |
| 231 | 234 |
| 232 protected: | 235 protected: |
| 233 FX_BOOL CheckDestSize(); | 236 FX_BOOL CheckDestSize(); |
| 234 void GetNextOperator(); | 237 void GetNextOperator(); |
| 235 void UpdateOperator(uint8_t used_bytes); | 238 void UpdateOperator(uint8_t used_bytes); |
| 236 | 239 |
| 237 uint8_t* m_pScanline; | 240 uint8_t* m_pScanline; |
| 238 const uint8_t* m_pSrcBuf; | 241 const uint8_t* m_pSrcBuf; |
| 239 FX_DWORD m_SrcSize; | 242 FX_DWORD m_SrcSize; |
| 240 FX_DWORD m_dwLineBytes; | 243 FX_DWORD m_dwLineBytes; |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 int nComps, | 402 int nComps, |
| 400 int bpc) { | 403 int bpc) { |
| 401 CCodec_RLScanlineDecoder* pRLScanlineDecoder = new CCodec_RLScanlineDecoder; | 404 CCodec_RLScanlineDecoder* pRLScanlineDecoder = new CCodec_RLScanlineDecoder; |
| 402 if (!pRLScanlineDecoder->Create(src_buf, src_size, width, height, nComps, | 405 if (!pRLScanlineDecoder->Create(src_buf, src_size, width, height, nComps, |
| 403 bpc)) { | 406 bpc)) { |
| 404 delete pRLScanlineDecoder; | 407 delete pRLScanlineDecoder; |
| 405 return NULL; | 408 return NULL; |
| 406 } | 409 } |
| 407 return pRLScanlineDecoder; | 410 return pRLScanlineDecoder; |
| 408 } | 411 } |
| OLD | NEW |