Files
imgproxy/vips/bmp.h
Victor Sokolov b18b678df2 IMG-25: load ICO files (#1458)
* disk_sink + fixes

* Always 4 bands for v3+ bmp on save

* bmpsave fixed (w/o orientation)

* fixed ico for target save

* icosave.c

* Removed leftover comments

* icoload.c

* Row buffer (skripatch) is not needed anymore

* Minor fixes for icoload/save

* Use wips_image_write instead of vips_copy

* Forgotten &

* Check resulting dimensions

* -debug printf
2025-07-12 00:00:08 +06:00

36 lines
1.1 KiB
C

/*
* BMP save/load
*/
#ifndef __BMP_H__
#define __BMP_H__
#define BMP_FILE_HEADER_LEN 14 // BMP header length
#define BMP_BITMAP_INFO_HEADER_LEN 40 // BITMAPINFOHEADER
#define BMP_V4_INFO_HEADER_LEN 108 // BITMAPV4HEADER
#define BMP_V5_INFO_HEADER_LEN 124 // BITMAPV5HEADER
#define COMPRESSION_BI_RGB 0 // no compression
#define COMPRESSION_BI_RLE8 1 // RLE8
#define COMPRESSION_BI_RLE4 2 // RLE4
#define COMPRESSION_BI_BITFIELDS 3 // Has RGB bit masks
#define COMPRESSION_BI_BITFIELDS_ALPHA 6 // Has RGBA bit masks
#define BMP_PALETTE_ITEM_SIZE 4 // 4 bytes per palette item (BGR + padding)
#define BMP_RLE_EOL 0 // end of line
#define BMP_RLE_EOF 1 // end of file
#define BMP_RLE_MOVE_TO 2 // move to position
// defined in bmpload.c
VIPS_API
int vips_bmpload_source(VipsSource *source, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
int vips_bmpload_source_go(VipsImgproxySource *source, VipsImage **out);
int
vips_bmpload_buffer(void *buf, size_t len, VipsImage **out, ...);
// defined in bmpsave.c
int vips_bmpsave_target_go(VipsImage *in, VipsTarget *target);
#endif