iPXE
Main Page
Related Pages
Modules
+
Data Structures
Data Structures
Data Structure Index
+
Data Fields
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
b
d
i
p
s
t
u
v
x
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
+
Files
File List
+
Globals
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
+
Enumerations
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
include
ipxe
pnm.h
Go to the documentation of this file.
1
#ifndef _IPXE_PNM_H
2
#define _IPXE_PNM_H
3
4
/** @file
5
*
6
* Portable anymap format (PNM)
7
*
8
*/
9
10
FILE_LICENCE
( GPL2_OR_LATER_OR_UBDL );
11
12
#include <
stdint.h
>
13
#include <
ipxe/uaccess.h
>
14
#include <
ipxe/image.h
>
15
16
/** PNM signature */
17
struct
pnm_signature
{
18
/** Magic byte ('P') */
19
char
magic
;
20
/** PNM type */
21
char
type
;
22
/** Whitespace */
23
char
space
;
24
}
__attribute__
(( packed ));
25
26
/** PNM magic byte */
27
#define PNM_MAGIC 'P'
28
29
/** PNM context */
30
struct
pnm_context
{
31
/** PNM type */
32
struct
pnm_type
*
type
;
33
/** Current byte offset */
34
size_t
offset
;
35
/** Maximum length of ASCII values */
36
size_t
ascii_len
;
37
/** Maximum pixel value */
38
unsigned
int
max
;
39
};
40
41
/** Default maximum length of ASCII values */
42
#define PNM_ASCII_LEN 16
43
44
/** PNM type */
45
struct
pnm_type
{
46
/** PNM type */
47
char
type
;
48
/** Number of scalar values per pixel */
49
uint8_t
depth
;
50
/** Number of pixels per composite value */
51
uint8_t
packing
;
52
/** Flags */
53
uint8_t
flags
;
54
/** Extract scalar value
55
*
56
* @v image PNM image
57
* @v pnm PNM context
58
* @ret value Value, or negative error
59
*/
60
int ( *
scalar
) (
struct
image
*
image
,
struct
pnm_context
*pnm );
61
/** Convert composite value to 24-bit RGB
62
*
63
* @v composite Composite value
64
* @v index Pixel index within this composite value
65
* @ret rgb 24-bit RGB value
66
*/
67
uint32_t
( *
rgb
) (
uint32_t
composite,
unsigned
int
index
);
68
};
69
70
/** PNM flags */
71
enum
pnm_flags
{
72
/** Bitmap format
73
*
74
* If set, this flag indicates that:
75
*
76
* - the maximum scalar value is predefined as being equal to
77
* (2^packing-1), and is not present within the file, and
78
*
79
* - the maximum length of ASCII values is 1.
80
*/
81
PNM_BITMAP
= 0x01,
82
};
83
84
extern
struct
image_type
pnm_image_type
__image_type
(
PROBE_NORMAL
);
85
86
#endif
/* _IPXE_PNM_H */
__attribute__
#define __attribute__(x)
Definition:
compiler.h:10
pnm_signature::space
char space
Whitespace.
Definition:
pnm.h:23
pnm_type::scalar
int(* scalar)(struct image *image, struct pnm_context *pnm)
Extract scalar value.
Definition:
pnm.h:60
pnm_type::flags
uint8_t flags
Flags.
Definition:
pnm.h:53
__image_type
struct image_type pnm_image_type __image_type(PROBE_NORMAL)
image_type
An executable image type.
Definition:
image.h:76
index
long index
Definition:
bigint.h:62
PROBE_NORMAL
#define PROBE_NORMAL
Normal image probe priority.
Definition:
image.h:137
pnm_signature::type
char type
PNM type.
Definition:
pnm.h:21
image
An executable image.
Definition:
image.h:24
pnm_context::max
unsigned int max
Maximum pixel value.
Definition:
pnm.h:38
uaccess.h
Access to external ("user") memory.
FILE_LICENCE
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
pnm_flags
pnm_flags
PNM flags.
Definition:
pnm.h:71
image.h
Executable images.
pnm_context::ascii_len
size_t ascii_len
Maximum length of ASCII values.
Definition:
pnm.h:36
pnm_type::packing
uint8_t packing
Number of pixels per composite value.
Definition:
pnm.h:51
uint8_t
unsigned char uint8_t
Definition:
stdint.h:10
pnm_type
PNM type.
Definition:
pnm.h:45
uint32_t
unsigned int uint32_t
Definition:
stdint.h:12
pnm_context::type
struct pnm_type * type
PNM type.
Definition:
pnm.h:32
pnm_signature
PNM signature.
Definition:
pnm.h:17
pnm_type::type
char type
PNM type.
Definition:
pnm.h:47
pnm_signature::magic
char magic
Magic byte ('P')
Definition:
pnm.h:19
PNM_BITMAP
Bitmap format.
Definition:
pnm.h:81
stdint.h
pnm_type::depth
uint8_t depth
Number of scalar values per pixel.
Definition:
pnm.h:49
pnm_context::offset
size_t offset
Current byte offset.
Definition:
pnm.h:34
pnm_type::rgb
uint32_t(* rgb)(uint32_t composite, unsigned int index)
Convert composite value to 24-bit RGB.
Definition:
pnm.h:67
pnm_context
PNM context.
Definition:
pnm.h:30
Generated by
1.8.15