Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: core/fxcodec/codec/fx_codec_fax.cpp

Issue 1980973002: Convert border style defines to an enum class. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "core/fxcodec/codec/codec_int.h" 7 #include "core/fxcodec/codec/codec_int.h"
8 #include "core/fxcodec/include/fx_codec.h" 8 #include "core/fxcodec/include/fx_codec.h"
9 9
10 namespace { 10 namespace {
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 dest_buf[last_byte] -= 1 << (7 - i); 125 dest_buf[last_byte] -= 1 << (7 - i);
126 } 126 }
127 if (last_byte > first_byte + 1) { 127 if (last_byte > first_byte + 1) {
128 FXSYS_memset(dest_buf + first_byte + 1, 0, last_byte - first_byte - 1); 128 FXSYS_memset(dest_buf + first_byte + 1, 0, last_byte - first_byte - 1);
129 } 129 }
130 } 130 }
131 131
132 #define NEXTBIT \ 132 #define NEXTBIT \
133 src_buf[bitpos / 8] & (1 << (7 - bitpos % 8)); \ 133 src_buf[bitpos / 8] & (1 << (7 - bitpos % 8)); \
134 bitpos++; 134 bitpos++;
135 #define ADDBIT(code, bit) \
Tom Sepez 2016/05/16 18:17:55 unrelated change, but ok.
136 code = code << 1; \
137 if (bit) \
138 code++;
139 #define GETBIT(bitpos) src_buf[bitpos / 8] & (1 << (7 - bitpos % 8))
140 135
141 const uint8_t FaxBlackRunIns[] = { 136 const uint8_t FaxBlackRunIns[] = {
142 0, 2, 0x02, 3, 0, 0x03, 137 0, 2, 0x02, 3, 0, 0x03,
143 2, 0, 2, 0x02, 1, 0, 138 2, 0, 2, 0x02, 1, 0,
144 0x03, 4, 0, 2, 0x02, 6, 139 0x03, 4, 0, 2, 0x02, 6,
145 0, 0x03, 5, 0, 1, 0x03, 140 0, 0x03, 5, 0, 1, 0x03,
146 7, 0, 2, 0x04, 9, 0, 141 7, 0, 2, 0x04, 9, 0,
147 0x05, 8, 0, 3, 0x04, 10, 142 0x05, 8, 0, 3, 0x04, 10,
148 0, 0x05, 11, 0, 0x07, 12, 143 0, 0x05, 11, 0, 0x07, 12,
149 0, 2, 0x04, 13, 0, 0x07, 144 0, 2, 0x04, 13, 0, 0x07,
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 FX_BOOL EndOfLine, 814 FX_BOOL EndOfLine,
820 FX_BOOL EncodedByteAlign, 815 FX_BOOL EncodedByteAlign,
821 FX_BOOL BlackIs1, 816 FX_BOOL BlackIs1,
822 int Columns, 817 int Columns,
823 int Rows) { 818 int Rows) {
824 CCodec_FaxDecoder* pDecoder = new CCodec_FaxDecoder; 819 CCodec_FaxDecoder* pDecoder = new CCodec_FaxDecoder;
825 pDecoder->Create(src_buf, src_size, width, height, K, EndOfLine, 820 pDecoder->Create(src_buf, src_size, width, height, K, EndOfLine,
826 EncodedByteAlign, BlackIs1, Columns, Rows); 821 EncodedByteAlign, BlackIs1, Columns, Rows);
827 return pDecoder; 822 return pDecoder;
828 } 823 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698