bmp.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /* bmp.h - header structure for Windows bitmap files */
  2. /*
  3. libzint - the open source barcode library
  4. Copyright (C) 2009-2024 Robin Stuart <rstuart114@gmail.com>
  5. Redistribution and use in source and binary forms, with or without
  6. modification, are permitted provided that the following conditions
  7. are met:
  8. 1. Redistributions of source code must retain the above copyright
  9. notice, this list of conditions and the following disclaimer.
  10. 2. Redistributions in binary form must reproduce the above copyright
  11. notice, this list of conditions and the following disclaimer in the
  12. documentation and/or other materials provided with the distribution.
  13. 3. Neither the name of the project nor the names of its contributors
  14. may be used to endorse or promote products derived from this software
  15. without specific prior written permission.
  16. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  17. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  18. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  19. ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
  20. FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  21. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  22. OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  23. HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  24. LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  25. OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  26. SUCH DAMAGE.
  27. */
  28. /* SPDX-License-Identifier: BSD-3-Clause */
  29. #ifndef Z_BMP_H
  30. #define Z_BMP_H
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif /* __cplusplus */
  34. #ifdef OUT_USE_PRAGMA_PACK
  35. #pragma pack(1)
  36. #endif
  37. typedef struct bitmap_file_header {
  38. uint16_t header_field;
  39. uint32_t file_size;
  40. uint32_t reserved;
  41. uint32_t data_offset;
  42. } OUT_PACK bitmap_file_header_t;
  43. typedef struct bitmap_info_header {
  44. uint32_t header_size;
  45. int32_t width;
  46. int32_t height;
  47. uint16_t colour_planes;
  48. uint16_t bits_per_pixel;
  49. uint32_t compression_method;
  50. uint32_t image_size;
  51. int32_t horiz_res;
  52. int32_t vert_res;
  53. uint32_t colours;
  54. uint32_t important_colours;
  55. } OUT_PACK bitmap_info_header_t;
  56. typedef struct color_ref {
  57. uint8_t blue;
  58. uint8_t green;
  59. uint8_t red;
  60. uint8_t reserved;
  61. } OUT_PACK color_ref_t;
  62. #ifdef OUT_USE_PRAGMA_PACK
  63. #pragma pack()
  64. #endif
  65. #ifdef __cplusplus
  66. }
  67. #endif /* __cplusplus */
  68. /* vim: set ts=4 sw=4 et : */
  69. #endif /* Z_BMP_H */