6 * Portable anymap format (PNM)
10 FILE_LICENCE ( GPL2_OR_LATER );
13 #include <ipxe/uaccess.h>
14 #include <ipxe/image.h>
17 struct pnm_signature {
18 /** Magic byte ('P') */
24 } __attribute__ (( packed ));
32 struct pnm_type *type;
33 /** Current byte offset */
35 /** Maximum length of ASCII values */
37 /** Maximum pixel value */
41 /** Default maximum length of ASCII values */
42 #define PNM_ASCII_LEN 16
48 /** Number of scalar values per pixel */
50 /** Number of pixels per composite value */
54 /** Extract scalar value
58 * @ret value Value, or negative error
60 int ( * scalar ) ( struct image *image, struct pnm_context *pnm );
61 /** Convert composite value to 24-bit RGB
63 * @v composite Composite value
64 * @v index Pixel index within this composite value
65 * @ret rgb 24-bit RGB value
67 uint32_t ( * rgb ) ( uint32_t composite, unsigned int index );
74 * If set, this flag indicates that:
76 * - the maximum scalar value is predefined as being equal to
77 * (2^packing-1), and is not present within the file, and
79 * - the maximum length of ASCII values is 1.
84 extern struct image_type pnm_image_type __image_type ( PROBE_NORMAL );
86 #endif /* _IPXE_PNM_H */