This class handles reading/parsing of PBM/PGM/PPM image files. More...
#include <Raster/PnmParser.H>
Classes | |
struct | Rep |
Public Member Functions | |
PnmParser (const char *fname) | |
Initialize with a PBM, PGM or PPM file. | |
PnmParser (std::istream &strm) | |
Initialize with a stream that will contain PBM, PGM or PPM data. | |
virtual | ~PnmParser () |
Destructor. | |
virtual GenericFrameSpec | getFrameSpec () const |
Get the specifications of the image without fully reading it. | |
virtual std::string | getComments () const |
Get the comments from the image without fully reading it. | |
virtual uint | getTagCount () const |
Get image tags if the image supports them. | |
virtual bool | getTag (uint tag, std::string &name, std::string &value) const |
Get image tags if the image supports them. | |
virtual GenericFrame | getFrame () |
Get a GenericFrame representation from the raster file. |
This class handles reading/parsing of PBM/PGM/PPM image files.
All six pbm modes are supported:
-P1: plain/ascii 1-bit black+white -P2: plain/ascii grayscale -P3: plain/ascii RGB -P4: raw/binary packed 1-bit black+white (8 pixels per byte) -P5: raw/binary 8-bit grayscale -P6: raw/binary 24-bit RGB
Definition at line 62 of file PnmParser.H.
PnmParser::PnmParser | ( | const char * | fname | ) |
Initialize with a PBM, PGM or PPM file.
Definition at line 356 of file PnmParser.C.
PnmParser::PnmParser | ( | std::istream & | strm | ) |
Initialize with a stream that will contain PBM, PGM or PPM data.
Definition at line 363 of file PnmParser.C.
PnmParser::~PnmParser | ( | ) | [virtual] |
Destructor.
Definition at line 370 of file PnmParser.C.
std::string PnmParser::getComments | ( | ) | const [virtual] |
Get the comments from the image without fully reading it.
Implements RasterParser.
Definition at line 413 of file PnmParser.C.
GenericFrame PnmParser::getFrame | ( | ) | [virtual] |
Get a GenericFrame representation from the raster file.
This can subsequently be converted to rgb, grayscale, floating-point, or video-yuv.
Implements RasterParser.
Definition at line 425 of file PnmParser.C.
References NO_INIT, PnmParser::Rep::parseBW(), PnmParser::Rep::parseGrayU16(), PnmParser::Rep::parseGrayU8(), PnmParser::Rep::parseRgbU16(), and PnmParser::Rep::parseRgbU8().
Referenced by BitObject::readFromStream().
GenericFrameSpec PnmParser::getFrameSpec | ( | ) | const [virtual] |
Get the specifications of the image without fully reading it.
Implements RasterParser.
Definition at line 376 of file PnmParser.C.
References GenericFrame::GRAY_F32, GenericFrame::GRAY_U8, GenericFrame::RGB_F32, and GenericFrame::RGB_U8.
bool PnmParser::getTag | ( | uint | tag, | |
std::string & | name, | |||
std::string & | value | |||
) | const [virtual] |
Get image tags if the image supports them.
Implements RasterParser.
Definition at line 421 of file PnmParser.C.
uint PnmParser::getTagCount | ( | ) | const [virtual] |
Get image tags if the image supports them.
Implements RasterParser.
Definition at line 417 of file PnmParser.C.