ContRap-Libraries
Public Member Functions

crp::PGMVideo Class Reference

Class PGMVideo loads and saves video files in the format consisting of a PGM header following by headerless images. More...

#include <pgmvideo.h>

Public Member Functions

 PGMVideo (int width=0, int height=0, int frames=0)
 Creates an empty video.
 ~PGMVideo ()
 Cleans up the data.
bool load (const std::string &file_name)
 Loads a video file by discarding the current data.
bool save (const std::string &file_name) const
 Saves the current video to a file.
bool get_image (RawImage &image, int frame)
 Returns an image.
int get_frame_number () const
 Returns the number of frames.

Detailed Description

Class PGMVideo loads and saves video files in the format consisting of a PGM header following by headerless images.


Constructor & Destructor Documentation

crp::PGMVideo::PGMVideo ( int  width = 0,
int  height = 0,
int  frames = 0 
)

Creates an empty video.

Parameters:
widthWidth of each image
heightHeight of each image
framesNumber of images
crp::PGMVideo::~PGMVideo ( )

Cleans up the data.


Member Function Documentation

int crp::PGMVideo::get_frame_number ( ) const [inline]

Returns the number of frames.

Returns:
Number of frames
bool crp::PGMVideo::get_image ( RawImage image,
int  frame 
)

Returns an image.

Parameters:
imageImage to fill the data
frameFrame number
Returns:
True if operation was successful
bool crp::PGMVideo::load ( const std::string &  file_name)

Loads a video file by discarding the current data.

Parameters:
file_nameName of the file to load
Returns:
True if the operation was successful
bool crp::PGMVideo::save ( const std::string &  file_name) const

Saves the current video to a file.

Parameters:
file_nameName of the file to save
Returns:
True if the operation was successful

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