Advertisement
kolychestiy

bmp.h

Dec 12th, 2021
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.07 KB | None | 0 0
  1. #ifndef BMP_H
  2. #define BMP_H
  3.  
  4. #include <stdint.h>
  5.  
  6. /* Структура заголовка BMP-файла */
  7. typedef struct _bmp_header {
  8.    
  9.     /* Данные файлового заголовка */
  10.     uint16_t signature;
  11.     uint32_t file_size;
  12.     uint16_t reserved1;
  13.     uint16_t reserved2;
  14.     uint32_t pixel_array_offset;
  15.    
  16.     /* Данные информационного заголовка */
  17.     uint32_t header_size;
  18.     int32_t width;
  19.     int32_t height;
  20.     uint16_t color_planes;
  21.     uint16_t bits_per_pixel;
  22.     uint32_t compression_method;
  23.     uint32_t image_size;
  24.     int32_t horizontal_resolution;
  25.     int32_t vertical_resolution;
  26.     uint32_t colors;
  27.     uint32_t important_colors;    
  28. } bmp_header;
  29.  
  30. typedef double *bmp_pixel_array;
  31.  
  32. typedef struct _bmp_image {
  33.     bmp_header header;
  34.     bmp_pixel_array pixel_array;
  35. } bmp_image;
  36.  
  37. bmp_image bmp_read(char *bmp_file_path);
  38.  
  39. void bmp_write(char *bmp_file_path, bmp_image image);
  40.  
  41. void bmp_replace(bmp_image image, bmp_image background, double k, int argc, char *argv[]);
  42.  
  43. #endif
  44.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement