Home | Develop | Download | Contact
RaBmp.hpp
1/*
2 * RaBmp.hpp
3 *
4 * Copyright 2018 Fernando Pujaico Rivera <fernando.pujaico.rivera@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 * MA 02110-1301, USA.
20 *
21 */
22
30#ifndef __PDS_RABMP_HPP__
31#define __PDS_RABMP_HPP__
32
33#include <string>
34#include <cstdio>
35#include <list>
36
46namespace Pds{
51namespace Ra{
52
53typedef struct { // Total: 54 bytes
54 // Cabecera BMP
55 unsigned char type[2]; // Magic identifier: 0x4d42
56 uint32_t size; // File size in bytes
57 uint16_t reserved1; // Not used
58 uint16_t reserved2; // Not used
59 uint32_t offset; // Offset to image data in bytes from beginning of file (54 bytes)
60 // Encabezado DIB
61 uint32_t dib_header_size; // DIB Header size in bytes (40 bytes)
62 int32_t width_px; // Width of the image
63 int32_t height_px; // Height of image
64 uint16_t num_planes; // Number of color planes
65 uint16_t bits_per_pixel; // Bits per pixel
66 uint32_t compression; // Compression type
67 uint32_t image_size_bytes; // Image size in bytes
68 int32_t x_resolution_ppm; // Pixels per meter
69 int32_t y_resolution_ppm; // Pixels per meter
70 uint32_t num_colors; // Number of colors
71 uint32_t important_colors; // Important colors
72} BmpHeader; // 54 bytes
73
74
93
104 Pds::Ra::BmpHeader ReadBmpHeader(const std::string &filename);
105
116
122} // namespace Ra
123} // namespace Pds
124
125
130#endif /* __PDS_RABMP_HPP__ */
void PrintBmpHeader(Pds::Ra::BmpHeader Header)
Imprime los datos de una estructura con los datos de cabecera de un archivo bmp.
Pds::Ra::BmpHeader ReadBmpHeader(FILE *fd)
Retorna una estructura con los datos de cabecera de un archivo bmp.
Nombre de espacio para Pds (Procesamiento Digital de Senales)
Definition: AbstractRV.hpp:42
uint16_t reserved1
Definition: RaBmp.hpp:57
uint16_t bits_per_pixel
Definition: RaBmp.hpp:65
int32_t x_resolution_ppm
Definition: RaBmp.hpp:68
uint32_t size
Definition: RaBmp.hpp:56
uint32_t image_size_bytes
Definition: RaBmp.hpp:67
uint16_t reserved2
Definition: RaBmp.hpp:58
uint32_t important_colors
Definition: RaBmp.hpp:71
uint32_t offset
Definition: RaBmp.hpp:59
int32_t width_px
Definition: RaBmp.hpp:62
uint16_t num_planes
Definition: RaBmp.hpp:64
uint32_t dib_header_size
Definition: RaBmp.hpp:61
uint32_t compression
Definition: RaBmp.hpp:66
int32_t height_px
Definition: RaBmp.hpp:63
uint32_t num_colors
Definition: RaBmp.hpp:70
int32_t y_resolution_ppm
Definition: RaBmp.hpp:69

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed