| 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 CORE_SRC_FXCODEC_LBMP_FX_BMP_H_ | 7 #ifndef CORE_SRC_FXCODEC_LBMP_FX_BMP_H_ |
| 8 #define CORE_SRC_FXCODEC_LBMP_FX_BMP_H_ | 8 #define CORE_SRC_FXCODEC_LBMP_FX_BMP_H_ |
| 9 | 9 |
| 10 #include <setjmp.h> | 10 #include <setjmp.h> |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 int32_t _bmp_decode_rle4(bmp_decompress_struct_p bmp_ptr); | 122 int32_t _bmp_decode_rle4(bmp_decompress_struct_p bmp_ptr); |
| 123 uint8_t* _bmp_read_data(bmp_decompress_struct_p bmp_ptr, | 123 uint8_t* _bmp_read_data(bmp_decompress_struct_p bmp_ptr, |
| 124 uint8_t** des_buf_pp, | 124 uint8_t** des_buf_pp, |
| 125 FX_DWORD data_size); | 125 FX_DWORD data_size); |
| 126 void _bmp_save_decoding_status(bmp_decompress_struct_p bmp_ptr, int32_t status); | 126 void _bmp_save_decoding_status(bmp_decompress_struct_p bmp_ptr, int32_t status); |
| 127 void _bmp_input_buffer(bmp_decompress_struct_p bmp_ptr, | 127 void _bmp_input_buffer(bmp_decompress_struct_p bmp_ptr, |
| 128 uint8_t* src_buf, | 128 uint8_t* src_buf, |
| 129 FX_DWORD src_size); | 129 FX_DWORD src_size); |
| 130 FX_DWORD _bmp_get_avail_input(bmp_decompress_struct_p bmp_ptr, | 130 FX_DWORD _bmp_get_avail_input(bmp_decompress_struct_p bmp_ptr, |
| 131 uint8_t** avial_buf_ptr); | 131 uint8_t** avial_buf_ptr); |
| 132 #define BMP_PTR_NOT_NULL(ptr, bmp_ptr) \ | |
| 133 if (ptr == NULL) { \ | |
| 134 _bmp_error(bmp_ptr, "Out Of Memory"); \ | |
| 135 return 0; \ | |
| 136 } | |
| 137 typedef struct tag_bmp_compress_struct bmp_compress_struct; | 132 typedef struct tag_bmp_compress_struct bmp_compress_struct; |
| 138 typedef bmp_compress_struct* bmp_compress_struct_p; | 133 typedef bmp_compress_struct* bmp_compress_struct_p; |
| 139 typedef bmp_compress_struct_p* bmp_compress_struct_pp; | 134 typedef bmp_compress_struct_p* bmp_compress_struct_pp; |
| 140 struct tag_bmp_compress_struct { | 135 struct tag_bmp_compress_struct { |
| 141 BmpFileHeader file_header; | 136 BmpFileHeader file_header; |
| 142 BmpInfoHeader info_header; | 137 BmpInfoHeader info_header; |
| 143 uint8_t* src_buf; | 138 uint8_t* src_buf; |
| 144 FX_DWORD src_pitch; | 139 FX_DWORD src_pitch; |
| 145 FX_DWORD src_row; | 140 FX_DWORD src_row; |
| 146 uint8_t src_bpp; | 141 uint8_t src_bpp; |
| 147 FX_DWORD src_width; | 142 FX_DWORD src_width; |
| 148 FX_BOOL src_free; | 143 FX_BOOL src_free; |
| 149 FX_DWORD* pal_ptr; | 144 FX_DWORD* pal_ptr; |
| 150 FX_WORD pal_num; | 145 FX_WORD pal_num; |
| 151 #ifdef BMP_SUPPORT_BITFIELD | 146 #ifdef BMP_SUPPORT_BITFIELD |
| 152 uint8_t bit_type; | 147 uint8_t bit_type; |
| 153 #endif | 148 #endif |
| 154 }; | 149 }; |
| 155 | 150 |
| 156 bmp_compress_struct_p _bmp_create_compress(); | 151 bmp_compress_struct_p _bmp_create_compress(); |
| 157 void _bmp_destroy_compress(bmp_compress_struct_p bmp_ptr); | 152 void _bmp_destroy_compress(bmp_compress_struct_p bmp_ptr); |
| 158 FX_BOOL _bmp_encode_image(bmp_compress_struct_p bmp_ptr, | 153 FX_BOOL _bmp_encode_image(bmp_compress_struct_p bmp_ptr, |
| 159 uint8_t*& dst_buf, | 154 uint8_t*& dst_buf, |
| 160 FX_DWORD& dst_size); | 155 FX_DWORD& dst_size); |
| 161 | 156 |
| 162 #endif // CORE_SRC_FXCODEC_LBMP_FX_BMP_H_ | 157 #endif // CORE_SRC_FXCODEC_LBMP_FX_BMP_H_ |
| OLD | NEW |