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>
|
| 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 Color & | getPixel (const int row, const int col) const |
| Directly access a pixel in the image.
|
|
Color & | getPixel (const int row, const int col) |
| Directly access a pixel in the image.
|
|
Load and save .ppm files - "portable pixmap format" an image file formats designed to be easily exchanged between platforms.
Definition at line 46 of file PPM.h.
◆ PPM()
ompl::PPM::PPM |
( |
const char * | filename | ) |
|
|
inline |
Definition at line 63 of file PPM.h.
◆ getHeight()
unsigned int ompl::PPM::getHeight |
( |
| ) |
const |
|
inline |
Get the height of the loaded image.
Definition at line 81 of file PPM.h.
◆ getPixel() [1/2]
Color & ompl::PPM::getPixel |
( |
const int | row, |
|
|
const int | col ) |
|
inline |
Directly access a pixel in the image.
Definition at line 121 of file PPM.h.
◆ getPixel() [2/2]
const Color & ompl::PPM::getPixel |
( |
const int | row, |
|
|
const int | col ) const |
|
inline |
Directly access a pixel in the image.
Definition at line 115 of file PPM.h.
◆ getPixels() [1/2]
std::vector< Color > & ompl::PPM::getPixels |
( |
| ) |
|
|
inline |
◆ getPixels() [2/2]
const std::vector< Color > & ompl::PPM::getPixels |
( |
| ) |
const |
|
inline |
Get read-only access to the pixels in the image. To access a pixel at coordinate (row,col), use getPixels()[row * getWidth() + col].
Definition at line 102 of file PPM.h.
◆ getWidth()
unsigned int ompl::PPM::getWidth |
( |
| ) |
const |
|
inline |
Get the width of the loaded image.
Definition at line 75 of file PPM.h.
◆ loadFile()
void ompl::PPM::loadFile |
( |
const char * | filename | ) |
|
Load a .ppm file. Throw an exception in case of an error.
Definition at line 41 of file PPM.cpp.
◆ saveFile()
void ompl::PPM::saveFile |
( |
const char * | filename | ) |
|
Save image data to a .ppm file. Throw an exception in case of an error.
Definition at line 84 of file PPM.cpp.
◆ setHeight()
void ompl::PPM::setHeight |
( |
unsigned int | height | ) |
|
|
inline |
Set the height for the loaded image. This must eventually match the number of pixels, if saveFile() gets called.
Definition at line 95 of file PPM.h.
◆ setWidth()
void ompl::PPM::setWidth |
( |
unsigned int | width | ) |
|
|
inline |
Set the width for the loaded image. This must eventually match the number of pixels, if saveFile() gets called.
Definition at line 88 of file PPM.h.
The documentation for this class was generated from the following files: