This writer will periodically write images in PPM format. More...
#include <ppmwriter.h>
Inherits Clonable< Writer< CELL_TYPE >, PPMWriter< CELL_TYPE, CELL_PLOTTER > >.
Public Types | |
typedef Writer< CELL_TYPE > ::GridType | GridType |
Public Member Functions | |
template<typename MEMBER > | |
PPMWriter (MEMBER CELL_TYPE::*member, MEMBER minValue, MEMBER maxValue, const std::string &prefix, const unsigned period=1, const Coord< 2 > &cellDimensions=Coord< 2 >(8, 8)) | |
This PPMWriter will render a given member (e.g. | |
template<typename MEMBER , typename PALETTE > | |
PPMWriter (MEMBER CELL_TYPE::*member, const PALETTE &palette, const std::string &prefix, const unsigned period=1, const Coord< 2 > &cellDimensions=Coord< 2 >(8, 8)) | |
Creates a PPMWriter which will render the values of the given member variable. | |
virtual void | stepFinished (const GridType &grid, unsigned step, WriterEvent event) |
is called back from sim after each simulation step. | |
Private Member Functions | |
void | writePPM (const Image &img, unsigned step) |
Private Attributes | |
Plotter< CELL_TYPE, CELL_PLOTTER > | plotter |
Friends | |
class | PPMWriterTest |
This writer will periodically write images in PPM format.
The CELL_PLOTTER is responsible for rendering individual cells into tiles. The default will render uniformly colored tiles.
typedef Writer<CELL_TYPE>::GridType LibGeoDecomp::PPMWriter< CELL_TYPE, CELL_PLOTTER >::GridType |
Reimplemented from LibGeoDecomp::Writer< CELL_TYPE >.
LibGeoDecomp::PPMWriter< CELL_TYPE, CELL_PLOTTER >::PPMWriter | ( | MEMBER CELL_TYPE::* | member, | |
MEMBER | minValue, | |||
MEMBER | maxValue, | |||
const std::string & | prefix, | |||
const unsigned | period = 1 , |
|||
const Coord< 2 > & | cellDimensions = Coord<2>(8, 8) | |||
) | [inline, explicit] |
This PPMWriter will render a given member (e.g.
&Cell::fooBar). Colouring is handled by a predefined palette. The color range is mapped to the value range defined by [minValue, maxValue].
LibGeoDecomp::PPMWriter< CELL_TYPE, CELL_PLOTTER >::PPMWriter | ( | MEMBER CELL_TYPE::* | member, | |
const PALETTE & | palette, | |||
const std::string & | prefix, | |||
const unsigned | period = 1 , |
|||
const Coord< 2 > & | cellDimensions = Coord<2>(8, 8) | |||
) | [inline, explicit] |
virtual void LibGeoDecomp::PPMWriter< CELL_TYPE, CELL_PLOTTER >::stepFinished | ( | const GridType & | grid, | |
unsigned | step, | |||
WriterEvent | event | |||
) | [inline, virtual] |
is called back from sim after each simulation step.
event specifies the phase in which the simulation is currently in. This may be used for instance to open/close files at the beginning/end of the simulation.
Implements LibGeoDecomp::Writer< CELL_TYPE >.
void LibGeoDecomp::PPMWriter< CELL_TYPE, CELL_PLOTTER >::writePPM | ( | const Image & | img, | |
unsigned | step | |||
) | [inline, private] |
References LibGeoDecomp::GridBase< CELL, DIMENSIONS >::boundingBox(), LibGeoDecomp::Plotter< CELL, CELL_PLOTTER >::calcImageDim(), LibGeoDecomp::Writer< CELL_TYPE >::period, LibGeoDecomp::Plotter< CELL, CELL_PLOTTER >::plotGrid(), LibGeoDecomp::PPMWriter< CELL_TYPE, CELL_PLOTTER >::plotter, and LibGeoDecomp::WRITER_STEP_FINISHED.
friend class PPMWriterTest [friend] |
Plotter<CELL_TYPE, CELL_PLOTTER> LibGeoDecomp::PPMWriter< CELL_TYPE, CELL_PLOTTER >::plotter [private] |