pnm.h
Go to the documentation of this file.
1 /* Copyright (C) 2013-2016, The Regents of The University of Michigan.
2 All rights reserved.
3 
4 This software was developed in the APRIL Robotics Lab under the
5 direction of Edwin Olson, ebolson@umich.edu. This software may be
6 available under alternative licensing terms; contact the address above.
7 
8 Redistribution and use in source and binary forms, with or without
9 modification, are permitted provided that the following conditions are met:
10 
11 1. Redistributions of source code must retain the above copyright notice, this
12  list of conditions and the following disclaimer.
13 2. Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16 
17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
21 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 
28 The views and conclusions contained in the software and documentation are those
29 of the authors and should not be interpreted as representing official policies,
30 either expressed or implied, of the Regents of The University of Michigan.
31 */
32 
33 #ifndef _PNM_H
34 #define _PNM_H
35 
36 #include <stdint.h>
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 #define PNM_FORMAT_BINARY 4
43 #define PNM_FORMAT_GRAY 5
44 #define PNM_FORMAT_RGB 6
45 
46 // supports ppm, pnm, pgm
47 
48 typedef struct pnm pnm_t;
49 struct pnm
50 {
51  int width, height;
52  int format;
53  int max; // 1 = binary, 255 = one byte, 65535 = two bytes
54 
55  uint32_t buflen;
56  uint8_t *buf; // if max=65535, in big endian
57 };
58 
59 pnm_t *pnm_create_from_file(const char *path);
60 void pnm_destroy(pnm_t *pnm);
61 
62 #ifdef __cplusplus
63 }
64 #endif
65 
66 #endif
int height
Definition: pnm.h:51
int format
Definition: pnm.h:52
uint8_t * buf
Definition: pnm.h:56
Definition: pnm.h:49
int width
Definition: pnm.h:51
int max
Definition: pnm.h:53
pnm_t * pnm_create_from_file(const char *path)
Definition: pnm.c:40
void pnm_destroy(pnm_t *pnm)
Definition: pnm.c:153
uint32_t buflen
Definition: pnm.h:55


apriltags2
Author(s): Danylo Malyuta
autogenerated on Fri Oct 19 2018 04:02:32