mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-10-04 18:33:36 +02:00
IMG-24: load BMP via source (#1451)
* bmpload.c * #ifdef VIPS_META_PALETTE * int32 height/width * Separate #ifdef for VIPS_META_BITS_PER_SAMPLE * RLE fixes * bufsize * += fix * Move rel to x * Allocate load buffer in load()
This commit is contained in:
30
vips/bmp.h
Normal file
30
vips/bmp.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* 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);
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user