bmp.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * BMP save/load
  3. */
  4. #ifndef __BMP_H__
  5. #define __BMP_H__
  6. #define BMP_FILE_HEADER_LEN 14 // BMP header length
  7. #define BMP_BITMAP_INFO_HEADER_LEN 40 // BITMAPINFOHEADER
  8. #define BMP_V4_INFO_HEADER_LEN 108 // BITMAPV4HEADER
  9. #define BMP_V5_INFO_HEADER_LEN 124 // BITMAPV5HEADER
  10. #define COMPRESSION_BI_RGB 0 // no compression
  11. #define COMPRESSION_BI_RLE8 1 // RLE8
  12. #define COMPRESSION_BI_RLE4 2 // RLE4
  13. #define COMPRESSION_BI_BITFIELDS 3 // Has RGB bit masks
  14. #define COMPRESSION_BI_BITFIELDS_ALPHA 6 // Has RGBA bit masks
  15. #define BMP_PALETTE_ITEM_SIZE 4 // 4 bytes per palette item (BGR + padding)
  16. #define BMP_RLE_EOL 0 // end of line
  17. #define BMP_RLE_EOF 1 // end of file
  18. #define BMP_RLE_MOVE_TO 2 // move to position
  19. // defined in bmpload.c
  20. VIPS_API
  21. int vips_bmpload_source(VipsSource *source, VipsImage **out, ...)
  22. G_GNUC_NULL_TERMINATED;
  23. int vips_bmpload_source_go(VipsImgproxySource *source, VipsImage **out, ImgproxyLoadOptions lo);
  24. int
  25. vips_bmpload_buffer(void *buf, size_t len, VipsImage **out, ...);
  26. // defined in bmpsave.c
  27. int vips_bmpsave_target_go(VipsImage *in, VipsTarget *target, ImgproxySaveOptions opts);
  28. #endif