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 "core/fxcodec/lgif/fx_gif.h" | 7 #include "core/fxcodec/lgif/fx_gif.h" |
8 | 8 |
9 #include "core/fxcodec/lbmp/fx_bmp.h" | 9 #include "core/fxcodec/lbmp/fx_bmp.h" |
10 | 10 |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 } | 327 } |
328 } | 328 } |
329 } | 329 } |
330 src_offset = 0; | 330 src_offset = 0; |
331 src_bit_offset = 0; | 331 src_bit_offset = 0; |
332 src_bit_num = 0; | 332 src_bit_num = 0; |
333 return TRUE; | 333 return TRUE; |
334 } | 334 } |
335 FX_BOOL CGifLZWEncoder::LookUpInTable(const uint8_t* buf, | 335 FX_BOOL CGifLZWEncoder::LookUpInTable(const uint8_t* buf, |
336 uint32_t& offset, | 336 uint32_t& offset, |
337 uint8_t& bit_offset) { | 337 uint8_t& out_bit_offset) { |
338 for (uint16_t i = table_cur; i < index_num; i++) { | 338 for (uint16_t i = table_cur; i < index_num; i++) { |
339 if (code_table[i].prefix == code_table[index_num].prefix && | 339 if (code_table[i].prefix == code_table[index_num].prefix && |
340 code_table[i].suffix == code_table[index_num].suffix) { | 340 code_table[i].suffix == code_table[index_num].suffix) { |
341 code_table[index_num].prefix = i; | 341 code_table[index_num].prefix = i; |
342 code_table[index_num].suffix = | 342 code_table[index_num].suffix = |
343 gif_cut_buf(buf, offset, src_bit_cut, bit_offset, src_bit_num); | 343 gif_cut_buf(buf, offset, src_bit_cut, out_bit_offset, src_bit_num); |
344 table_cur = i; | 344 table_cur = i; |
345 return TRUE; | 345 return TRUE; |
346 } | 346 } |
347 } | 347 } |
348 table_cur = code_end + 1; | 348 table_cur = code_end + 1; |
349 return FALSE; | 349 return FALSE; |
350 } | 350 } |
351 void CGifLZWEncoder::Finish(uint8_t*& dst_buf, | 351 void CGifLZWEncoder::Finish(uint8_t*& dst_buf, |
352 uint32_t& dst_len, | 352 uint32_t& dst_len, |
353 uint32_t& offset) { | 353 uint32_t& offset) { |
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1220 gif_ptr->cur_offset = cur_offset; | 1220 gif_ptr->cur_offset = cur_offset; |
1221 res = FALSE; | 1221 res = FALSE; |
1222 } | 1222 } |
1223 dst_len = gif_ptr->cur_offset; | 1223 dst_len = gif_ptr->cur_offset; |
1224 dst_buf[dst_len - 1] = GIF_SIG_TRAILER; | 1224 dst_buf[dst_len - 1] = GIF_SIG_TRAILER; |
1225 if (res) { | 1225 if (res) { |
1226 gif_ptr->frames++; | 1226 gif_ptr->frames++; |
1227 } | 1227 } |
1228 return res; | 1228 return res; |
1229 } | 1229 } |
OLD | NEW |