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_ |
| 8 #define CORE_SRC_FXCODEC_LBMP_FX_BMP_H_ |
| 9 |
7 #include <setjmp.h> | 10 #include <setjmp.h> |
8 | 11 |
9 #include "core/include/fxcrt/fx_basic.h" | 12 #include "core/include/fxcrt/fx_basic.h" |
10 | 13 |
11 #define BMP_SUPPORT_BITFIELD | 14 #define BMP_SUPPORT_BITFIELD |
12 #define BMP_WIDTHBYTES(width, bitCount) ((width * bitCount) + 31) / 32 * 4 | 15 #define BMP_WIDTHBYTES(width, bitCount) ((width * bitCount) + 31) / 32 * 4 |
13 #define BMP_PAL_ENCODE(a, r, g, b) \ | 16 #define BMP_PAL_ENCODE(a, r, g, b) \ |
14 (((FX_DWORD)(a) << 24) | ((r) << 16) | ((g) << 8) | (b)) | 17 (((FX_DWORD)(a) << 24) | ((r) << 16) | ((g) << 8) | (b)) |
15 #define BMP_D_STATUS_HEADER 0x01 | 18 #define BMP_D_STATUS_HEADER 0x01 |
16 #define BMP_D_STATUS_PAL 0x02 | 19 #define BMP_D_STATUS_PAL 0x02 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 FX_WORD biPlanes; | 56 FX_WORD biPlanes; |
54 FX_WORD biBitCount; | 57 FX_WORD biBitCount; |
55 FX_DWORD biCompression; | 58 FX_DWORD biCompression; |
56 FX_DWORD biSizeImage; | 59 FX_DWORD biSizeImage; |
57 int32_t biXPelsPerMeter; | 60 int32_t biXPelsPerMeter; |
58 int32_t biYPelsPerMeter; | 61 int32_t biYPelsPerMeter; |
59 FX_DWORD biClrUsed; | 62 FX_DWORD biClrUsed; |
60 FX_DWORD biClrImportant; | 63 FX_DWORD biClrImportant; |
61 } BmpInfoHeader, *BmpInfoHeaderPtr; | 64 } BmpInfoHeader, *BmpInfoHeaderPtr; |
62 #pragma pack() | 65 #pragma pack() |
| 66 |
63 typedef struct tag_bmp_decompress_struct bmp_decompress_struct; | 67 typedef struct tag_bmp_decompress_struct bmp_decompress_struct; |
64 typedef bmp_decompress_struct* bmp_decompress_struct_p; | 68 typedef bmp_decompress_struct* bmp_decompress_struct_p; |
65 typedef bmp_decompress_struct_p* bmp_decompress_struct_pp; | 69 typedef bmp_decompress_struct_p* bmp_decompress_struct_pp; |
66 struct tag_bmp_decompress_struct { | 70 struct tag_bmp_decompress_struct { |
67 jmp_buf jmpbuf; | 71 jmp_buf jmpbuf; |
68 FX_CHAR* err_ptr; | 72 FX_CHAR* err_ptr; |
69 void (*_bmp_error_fn)(bmp_decompress_struct_p gif_ptr, | 73 void (*_bmp_error_fn)(bmp_decompress_struct_p gif_ptr, |
70 const FX_CHAR* err_msg); | 74 const FX_CHAR* err_msg); |
71 | 75 |
72 void* context_ptr; | 76 void* context_ptr; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 FX_DWORD src_row; | 145 FX_DWORD src_row; |
142 uint8_t src_bpp; | 146 uint8_t src_bpp; |
143 FX_DWORD src_width; | 147 FX_DWORD src_width; |
144 FX_BOOL src_free; | 148 FX_BOOL src_free; |
145 FX_DWORD* pal_ptr; | 149 FX_DWORD* pal_ptr; |
146 FX_WORD pal_num; | 150 FX_WORD pal_num; |
147 #ifdef BMP_SUPPORT_BITFIELD | 151 #ifdef BMP_SUPPORT_BITFIELD |
148 uint8_t bit_type; | 152 uint8_t bit_type; |
149 #endif | 153 #endif |
150 }; | 154 }; |
| 155 |
151 bmp_compress_struct_p _bmp_create_compress(); | 156 bmp_compress_struct_p _bmp_create_compress(); |
152 void _bmp_destroy_compress(bmp_compress_struct_p bmp_ptr); | 157 void _bmp_destroy_compress(bmp_compress_struct_p bmp_ptr); |
153 FX_BOOL _bmp_encode_image(bmp_compress_struct_p bmp_ptr, | 158 FX_BOOL _bmp_encode_image(bmp_compress_struct_p bmp_ptr, |
154 uint8_t*& dst_buf, | 159 uint8_t*& dst_buf, |
155 FX_DWORD& dst_size); | 160 FX_DWORD& dst_size); |
| 161 |
| 162 #endif // CORE_SRC_FXCODEC_LBMP_FX_BMP_H_ |
OLD | NEW |