ompl::PPM Class Reference

Load and save .ppm files - "portable pixmap format" an image file formats designed to be easily exchanged between platforms. More...

#include <ompl/util/PPM.h>

Classes

struct  Color
 

Public Member Functions

 PPM (const char *filename)
 
void loadFile (const char *filename)
 Load a .ppm file. Throw an exception in case of an error.
 
void saveFile (const char *filename)
 Save image data to a .ppm file. Throw an exception in case of an error.
 
unsigned int getWidth () const
 Get the width of the loaded image.
 
unsigned int getHeight () const
 Get the height of the loaded image.
 
void setWidth (unsigned int width)
 Set the width for the loaded image. This must eventually match the number of pixels, if saveFile() gets called.
 
void setHeight (unsigned int height)
 Set the height for the loaded image. This must eventually match the number of pixels, if saveFile() gets called.
 
const std::vector< Color > & getPixels () const
 Get read-only access to the pixels in the image. To access a pixel at coordinate (row,col), use getPixels()[row * getWidth() + col].
 
std::vector< Color > & getPixels ()
 Get write access to the pixels in the image. To access a pixel at coordinate (row,col), use getPixels()[row * getWidth() + col]. This must eventually match the width & height set by setWidth() and setHeight().
 
const ColorgetPixel (const int row, const int col) const
 Directly access a pixel in the image.
 
ColorgetPixel (const int row, const int col)
 Directly access a pixel in the image.
 

Detailed Description

Load and save .ppm files - "portable pixmap format" an image file formats designed to be easily exchanged between platforms.

Definition at line 78 of file PPM.h.


The documentation for this class was generated from the following files: