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 const FX_BYTE OneLeadPos[256] = { | 9 const FX_BYTE OneLeadPos[256] = { |
10 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, | 10 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, |
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
987 } | 987 } |
988 FX_BOOL CCodec_FaxModule::Encode(FX_LPCBYTE src_buf, int width, int height, int
pitch, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) | 988 FX_BOOL CCodec_FaxModule::Encode(FX_LPCBYTE src_buf, int width, int height, int
pitch, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) |
989 { | 989 { |
990 CCodec_FaxEncoder encoder(src_buf, width, height, pitch); | 990 CCodec_FaxEncoder encoder(src_buf, width, height, pitch); |
991 encoder.Encode(dest_buf, dest_size); | 991 encoder.Encode(dest_buf, dest_size); |
992 return TRUE; | 992 return TRUE; |
993 } | 993 } |
994 ICodec_ScanlineDecoder* CCodec_FaxModule::CreateDecoder(FX_LPCBYTE src_buf, FX_D
WORD src_size, int width, int height, | 994 ICodec_ScanlineDecoder* CCodec_FaxModule::CreateDecoder(FX_LPCBYTE src_buf, FX_D
WORD src_size, int width, int height, |
995 int K, FX_BOOL EndOfLine, FX_BOOL EncodedByteAlign, FX_BOOL BlackIs1, in
t Columns, int Rows) | 995 int K, FX_BOOL EndOfLine, FX_BOOL EncodedByteAlign, FX_BOOL BlackIs1, in
t Columns, int Rows) |
996 { | 996 { |
997 CCodec_FaxDecoder* pDecoder = FX_NEW CCodec_FaxDecoder; | 997 CCodec_FaxDecoder* pDecoder = new CCodec_FaxDecoder; |
998 if (pDecoder == NULL) { | |
999 return NULL; | |
1000 } | |
1001 pDecoder->Create(src_buf, src_size, width, height, K, EndOfLine, EncodedByte
Align, BlackIs1, Columns, Rows); | 998 pDecoder->Create(src_buf, src_size, width, height, K, EndOfLine, EncodedByte
Align, BlackIs1, Columns, Rows); |
1002 return pDecoder; | 999 return pDecoder; |
1003 } | 1000 } |
OLD | NEW |