GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
gp_bmp.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later
2/*
3 * Copyright (C) 2009-2020 Cyril Hrubis <metan@ucw.cz>
4 */
5
15#ifndef GP_BMP_H
16#define GP_BMP_H
17
25 uint32_t pixel_offset;
26
28 uint32_t header_offset;
29
31 uint32_t header_size;
32
36 int32_t w;
42 int32_t h;
43
44 uint16_t bpp;
45 uint32_t compress_type;
53 uint32_t R_mask;
55 uint32_t G_mask;
57 uint32_t B_mask;
59 uint32_t A_mask;
60};
61
83
103
117
129
138
150 gp_pixmap *pixmap, gp_progress_cb *callback);
151
152#endif /* GP_BMP_H */
uint32_t gp_bmp_palette_size(struct gp_bmp_info_header *header)
Returns palette size in bytes.
int gp_bmp_read_info_header(gp_io *io, struct gp_bmp_info_header *header)
Attempts to parse BMP info header at current offset in the file IO.
int gp_bmp_read_pixels(gp_io *io, struct gp_bmp_info_header *header, gp_pixmap *pixmap, gp_progress_cb *callback)
Reads a pixel data.
gp_bmp_info_header_size
BMP header size.
Definition gp_bmp.h:87
@ BITMAPCOREHEADER2
OS/2.
Definition gp_bmp.h:91
@ BITMAPINFOHEADER
Most common.
Definition gp_bmp.h:93
@ BITMAPINFOHEADER3
Undocummented.
Definition gp_bmp.h:97
@ BITMAPINFOHEADER4
Adds color space + gamma - win 95/NT4.
Definition gp_bmp.h:99
@ BITMAPCOREHEADER
Old OS/2 format + win 3.0.
Definition gp_bmp.h:89
@ BITMAPINFOHEADER5
Adds ICC color profiles win 98+.
Definition gp_bmp.h:101
@ BITMAPINFOHEADER2
Undocummented.
Definition gp_bmp.h:95
gp_pixel_type gp_bmp_pixel_type(struct gp_bmp_info_header *header)
Returns a pixel type suitable for a BMP info header.
gp_bmp_compress
BMP compression type.
Definition gp_bmp.h:65
@ COMPRESS_RLE8
Run-length encoded bitmap.
Definition gp_bmp.h:69
@ COMPRESS_BITFIELDS
Bitfield for each channel.
Definition gp_bmp.h:73
@ COMPRESS_RGB
Uncompressed.
Definition gp_bmp.h:67
@ COMPRESS_PNG
Only for printers.
Definition gp_bmp.h:77
@ COMPRESS_RLE4
Run-length encoded bitmap.
Definition gp_bmp.h:71
@ COMPRESS_ALPHABITFIELDS
Bitfields for each channel with alpha.
Definition gp_bmp.h:79
@ COMPRESS_JPEG
Only for printers.
Definition gp_bmp.h:75
@ COMPRESS_MAX
Terminating entry.
Definition gp_bmp.h:81
gp_pixel_type
List of all pixel types.
A BMP header.
Definition gp_bmp.h:23
uint32_t header_size
Header size (palette is on offset header_size + 14)
Definition gp_bmp.h:31
uint32_t pixel_offset
Offset to image data.
Definition gp_bmp.h:25
int32_t w
Image width in pixels.
Definition gp_bmp.h:36
uint32_t palette_colors
Number of palette colors.
Definition gp_bmp.h:51
uint32_t R_mask
Red mask for bitfields compression.
Definition gp_bmp.h:53
int32_t h
Image height in pixels.
Definition gp_bmp.h:42
uint32_t header_offset
Offset to the start of the info header.
Definition gp_bmp.h:28
uint32_t A_mask
Alpha mask for bitfields compression.
Definition gp_bmp.h:59
uint32_t B_mask
Blue mask for bitfields compression.
Definition gp_bmp.h:57
uint32_t G_mask
Green mask for bitfields compression.
Definition gp_bmp.h:55
An I/O abstraction.
Definition gp_io.h:23
A pixmap buffer.
Definition gp_pixmap.h:33
Progress callback.