|
For reading and writing images in PNM format. More...
#include <FilePnm.h>
Public Types | |
enum | FileType { UNDEFINED =0 , PBM_ASC =1 , PGM_ASC =2 , PPM_ASC =3 , PBM_RAW =4 , PGM_RAW =5 , PPM_RAW =6 } |
Static Public Member Functions | |
static void | read (Image &image, const std::string &path) |
Reads a pnm file to an image. More... | |
static FileType | readHeader (drain::image::ImageConf &conf, drain::FlexVariableMap &properties, std::istream &infile) |
Read image array after essential metadata (type and geometry) has been processed. | |
static void | readFrame (ImageFrame &image, const std::string &path) |
Read image array, assuming type and geometry already set. | |
static void | readFrame (ImageFrame &image, std::istream &infile, FileType fileType=PGM_RAW) |
Read image array after essential metadata (type and geometry) has been processed. More... | |
static void | write (const ImageFrame &image, const std::string &path) |
Read image array after essential metadata (type and geometry) has been processed. More... | |
Static Public Attributes | |
static const FileInfo | fileInfo |
Syntax for recognising pnm files. More... | |
For reading and writing images in PNM format.
A lighter alternative for Magick++ which supports tens of image formats. Portable N M ? (PNM) format is an old yet flexible image format for gray level and color images.
|
static |
Reads a pnm file to an image.
Converts indexed (palette) images to RGB or RGBA. Scales data to 8 or 16 bits, according to template class. Floating point images will be scaled as 16 bit integral (unsigned short int).
In addition to reading to Image, supports reading to ImageFrame if type and geometry match.
T | - Image or ImageFrame |
|
static |
Read image array after essential metadata (type and geometry) has been processed.
Writes drain::Image to a png image file applying G,GA, RGB or RGBA color model. Writes in 8 or 16 bits, according to template class. Floating point images will be scaled as 16 bit integral (unsigned short int).
|
static |
Read image array after essential metadata (type and geometry) has been processed.
Writes image to a pgm binary file. Writes drain::Image to a png image file applying G,GA, RGB or RGBA color model. Writes in 8 or 16 bits, according to template class. Floating point images will be scaled as 16 bit integral (unsigned short int).
image | - image |
pathPrefix | - |
Writes drain::Image to a png image file applying G,GA, RGB or RGBA color model. Writes in 8 or 16 bits, according to template class. Floating point images will be scaled as 16 bit integral (unsigned short int).
FILE HEADER
|
static |
Syntax for recognising pnm files.
Syntax for recognising PNM image files.