Main Page
Classes
Files
File List
File Members
include
common
pam.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
This library is free software; you can redistribute it and/or
9
modify it under the terms of the GNU Lesser General Public
10
License as published by the Free Software Foundation; either
11
version 2.1 of the License, or (at your option) any later version.
12
13
This library is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
Lesser General Public License for more details.
17
18
You should have received a copy of the GNU Lesser General Public
19
License along with this library; if not, see <http://www.gnu.org/licenses/>.
20
*/
21
22
#ifndef _PAM_H
23
#define _PAM_H
24
25
#include <stdint.h>
26
27
enum
{
PAM_GRAYSCALE_ALPHA
= 5000,
PAM_RGB_ALPHA
,
PAM_RGB
,
PAM_GRAYSCALE
};
28
29
typedef
struct
pam
pam_t
;
30
struct
pam
31
{
32
int
type
;
// one of PAM_*
33
34
int
width
,
height
;
// note, stride always width.
35
int
depth
;
// bytes per pixel
36
int
maxval
;
// maximum value per channel, e.g. 255 for 8bpp
37
38
int
datalen
;
// in bytes
39
uint8_t *
data
;
40
};
41
42
pam_t
*
pam_create_from_file
(
const
char
*inpath);
43
int
pam_write_file
(
pam_t
*
pam
,
const
char
*outpath);
44
void
pam_destroy
(
pam_t
*
pam
);
45
46
pam_t
*
pam_copy
(
pam_t
*
pam
);
47
48
// NB doesn't handle many conversions yet.
49
pam_t
*
pam_convert
(
pam_t
*in,
int
type
);
50
51
#endif
PAM_GRAYSCALE_ALPHA
Definition:
pam.h:27
pam::data
uint8_t * data
Definition:
pam.h:39
pam_write_file
int pam_write_file(pam_t *pam, const char *outpath)
Definition:
pam.c:152
PAM_RGB_ALPHA
Definition:
pam.h:27
pam::datalen
int datalen
Definition:
pam.h:38
pam_copy
pam_t * pam_copy(pam_t *pam)
Definition:
pam.c:198
PAM_GRAYSCALE
Definition:
pam.h:27
pam::height
int height
Definition:
pam.h:34
pam::type
int type
Definition:
pam.h:32
pam_convert
pam_t * pam_convert(pam_t *in, int type)
Definition:
pam.c:214
pam::depth
int depth
Definition:
pam.h:35
pam
Definition:
pam.h:30
pam::maxval
int maxval
Definition:
pam.h:36
pam_create_from_file
pam_t * pam_create_from_file(const char *inpath)
Definition:
pam.c:29
pam_destroy
void pam_destroy(pam_t *pam)
Definition:
pam.c:189
PAM_RGB
Definition:
pam.h:27
pam::width
int width
Definition:
pam.h:34
apriltags2
Author(s): Danylo Malyuta
autogenerated on Fri Oct 19 2018 04:02:32