|
iPXE
|
Portable anymap format (PNM) More...
#include <stdlib.h>#include <string.h>#include <errno.h>#include <ctype.h>#include <ipxe/image.h>#include <ipxe/pixbuf.h>#include <ipxe/pnm.h>Go to the source code of this file.
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| static int | pnm_ascii (struct image *image, struct pnm_context *pnm) |
| Extract PNM ASCII value. | |
| static int | pnm_binary (struct image *image, struct pnm_context *pnm) |
| Extract PNM binary value. | |
| static int | pnm_scale (struct image *image, struct pnm_context *pnm, unsigned int value) |
| Scale PNM scalar value. | |
| static uint32_t | pnm_bitmap (uint32_t composite, unsigned int index) |
| Convert PNM bitmap composite value to RGB. | |
| static uint32_t | pnm_greymap (uint32_t composite, unsigned int index __unused) |
| Convert PNM greymap composite value to RGB. | |
| static uint32_t | pnm_pixmap (uint32_t composite, unsigned int index __unused) |
| Convert PNM pixmap composite value to RGB. | |
| static int | pnm_data (struct image *image, struct pnm_context *pnm, struct pixel_buffer *pixbuf) |
| Extract PNM pixel data. | |
| static struct pnm_type * | pnm_type (struct image *image) |
| Determine PNM image type. | |
| static int | pnm_pixbuf (struct image *image, struct pixel_buffer **pixbuf) |
| Convert PNM image to pixel buffer. | |
| static int | pnm_probe (struct image *image) |
| Probe PNM image. | |
| struct image_type pnm_image_type | __image_type (PROBE_NORMAL) |
| PNM image type. | |
Variables | |
| static struct pnm_type | pnm_types [] |
| PNM image types. | |
Portable anymap format (PNM)
Definition in file pnm.c.
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
Extract PNM ASCII value.
| image | PNM image |
| pnm | PNM context |
| value | Value, or negative error |
Definition at line 47 of file pnm.c.
References pnm_context::ascii_len, ch, image::data, DBGC, EINVAL, isspace(), image::len, len, memcpy(), image::name, pnm_context::offset, strtoul(), and value.
Referenced by pnm_pixbuf().
|
static |
Extract PNM binary value.
| image | PNM image |
| pnm | PNM context |
| value | Value, or negative error |
Definition at line 107 of file pnm.c.
References image::data, DBGC, EINVAL, image::len, image::name, pnm_context::offset, and value.
|
static |
Scale PNM scalar value.
| image | PNM image |
| pnm | PNM context |
| value | Raw value |
| value | Scaled value (in range 0-255) |
Definition at line 130 of file pnm.c.
References DBGC, EINVAL, pnm_context::max, image::name, and value.
Referenced by pnm_data().
Convert PNM greymap composite value to RGB.
| composite | Composite value |
| index | Pixel index within this composite value |
| rgb | 24-bit RGB value |
Definition at line 161 of file pnm.c.
|
static |
Extract PNM pixel data.
| image | PNM image |
| pnm | PNM context |
| pixbuf | Pixel buffer |
| rc | Return status code |
Definition at line 188 of file pnm.c.
References pixel_buffer::data, DBGC, EINVAL, index, image::name, pixel_buffer::pixels, pnm_scale(), pnm_type::scalar, pnm_context::type, type, and pixel_buffer::width.
|
static |
Determine PNM image type.
| image | PNM image |
| type | PNM image type, or NULL if not found |
Definition at line 285 of file pnm.c.
References assert, image::data, image::len, NULL, pnm_types, signature, and type.
Referenced by pnm_pixbuf().
|
static |
Convert PNM image to pixel buffer.
| image | PNM image |
| pixbuf | Pixel buffer to fill in |
| rc | Return status code |
Definition at line 311 of file pnm.c.
References pnm_context::ascii_len, ENOTSUP, pnm_type::flags, max, pnm_context::max, pnm_context::offset, pnm_ascii(), PNM_ASCII_LEN, PNM_BITMAP, pnm_type(), rc, and pnm_context::type.
Referenced by __image_type().
|
static |
Probe PNM image.
| image | PNM image |
| rc | Return status code |
Definition at line 388 of file pnm.c.
References image::data, DBGC, ENOEXEC, isdigit(), isspace(), image::len, image::name, PNM_MAGIC, and signature.
Referenced by __image_type().
| struct image_type pnm_image_type __image_type | ( | PROBE_NORMAL | ) |
PNM image type.
References __image_type, pnm_pixbuf(), pnm_probe(), and PROBE_NORMAL.
|
static |
PNM image types.
Definition at line 232 of file pnm.c.
Referenced by pnm_type().