hgl 0.5.25
A compiler/interpreter suite for developing images (plugin development)
Public Types | List of all members
HGL::ImageOutput::IPreRenderOutput Interface Referenceabstract

Interface for writing images into a file. More...

#include "iprerenderoutput.h"

Public Types

enum  RENDEREVENT {
  START,
  END
}
 Indicates the state of rendering. More...
 

Public Member Functions

Pre-render notifications
virtual void update (const RENDEREVENT evt)=0 throw (ImageOutputException)
 Notification about an general render event. More...
 
virtual void update (const ICanvas::TRANSFORMATIONINFO *const ti)=0 throw (ImageOutputException)
 Notification about transformation information available. More...
 
virtual void update (const PointPrimitive *const primitive)=0 throw (ImageOutputException)
 Notification about a point to render. More...
 
virtual void update (const LinePrimitive *const primitive)=0 throw (ImageOutputException)
 Notification about a line to render. More...
 
virtual void update (const CurvePrimitive *const primitive)=0 throw (ImageOutputException)
 Notification about a curve to render. More...
 
virtual void update (const PolyPrimitive *const primitive)=0 throw (ImageOutputException)
 Notification about a poly to render. More...
 
virtual void update (const EllipsePrimitive *const primitive)=0 throw (ImageOutputException)
 Notification about an ellipse to render. More...
 
virtual void update (const TextPrimitive *const primitive)=0 throw (ImageOutputException)
 Notification about a text to render. More...
 
Information functions
virtual std::string getOutputFilename () const =0
 Get the effective output filename of the rendered picture. More...
 
Bitmap render methods
virtual void writeImage (const ICanvas &canvas, const std::string &filename=std::string()) const =0 throw (ImageOutputException)
 Writes an ICanvas bitmap into an image. More...
 
Command line options support
virtual struct::poptOption * getPoptOptions () const
 Get plugin supplied command line options. More...
 

Detailed Description

Interface for writing images into a file.

Note
If you need to keep the primitives you got from the update methods, make a copy of them, since it is not guaranteed they exist over all the lifetime of the plugin.

See Image Output Plugins in detail for more information.

See Also
REGISTER_IOPLUGIN
Author
Heiko Schäfer heiko.nosp@m.@hgl.nosp@m..rang.nosp@m.un.d.nosp@m.e
Since
0.4.70
Examples:
exampleoutput.h.

Member Enumeration Documentation

Indicates the state of rendering.

Since
0.4.70
Enumerator
START 

overall rendering has started

END 

overall rendering has ended

Member Function Documentation

virtual std::string HGL::ImageOutput::IOutput::getOutputFilename ( ) const
pure virtualinherited

Get the effective output filename of the rendered picture.

It should return an empty std::string if the standard output is used

Returns
the output filename of the rendered picture

Implemented in HGL::ImageOutput::DefaultPreRenderOutput.

virtual struct ::poptOption* HGL::Common::IPluginPoptOptions::getPoptOptions ( ) const
virtualinherited

Get plugin supplied command line options.

Note
See http://linux.die.net/man/3/popt for how to create and use the popt structure and Command line options support for details on how to use it in your plugins.

The default implementation returns NULL i.e. it won't provide own command line options

In your POPT_ARG_CALLBACK you can indicate HGL to exit gracefully by throwing HGL::Exception::PoptExitException

Returns
structure to popt options
Since
0.4.53
virtual void HGL::ImageOutput::IPreRenderOutput::update ( const RENDEREVENT  evt)
throw (ImageOutputException
)
pure virtual

Notification about an general render event.

Parameters
evtthe event
Exceptions
HGL::ImageOutput::ImageOutputExceptionin case of an unrecoverable error
Since
0.4.70

Implemented in HGL::ImageOutput::DefaultPreRenderOutput.

virtual void HGL::ImageOutput::IPreRenderOutput::update ( const ICanvas::TRANSFORMATIONINFO *const  ti)
throw (ImageOutputException
)
pure virtual

Notification about transformation information available.

Parameters
tithe transformation information
Exceptions
HGL::ImageOutput::ImageOutputExceptionin case of an unrecoverable error
Since
0.5.2

Implemented in HGL::ImageOutput::DefaultPreRenderOutput.

virtual void HGL::ImageOutput::IPreRenderOutput::update ( const PointPrimitive *const  primitive)
throw (ImageOutputException
)
pure virtual

Notification about a point to render.

Parameters
primitivethe point primitive
Exceptions
HGL::ImageOutput::ImageOutputExceptionin case of an unrecoverable error
Since
0.4.70

Implemented in HGL::ImageOutput::DefaultPreRenderOutput.

virtual void HGL::ImageOutput::IPreRenderOutput::update ( const LinePrimitive *const  primitive)
throw (ImageOutputException
)
pure virtual

Notification about a line to render.

Parameters
primitivethe line primitive
Exceptions
HGL::ImageOutput::ImageOutputExceptionin case of an unrecoverable error
Since
0.4.70

Implemented in HGL::ImageOutput::DefaultPreRenderOutput.

virtual void HGL::ImageOutput::IPreRenderOutput::update ( const CurvePrimitive *const  primitive)
throw (ImageOutputException
)
pure virtual

Notification about a curve to render.

Parameters
primitivethe curve primitive
Exceptions
HGL::ImageOutput::ImageOutputExceptionin case of an unrecoverable error
Since
0.5.0

Implemented in HGL::ImageOutput::DefaultPreRenderOutput.

virtual void HGL::ImageOutput::IPreRenderOutput::update ( const PolyPrimitive *const  primitive)
throw (ImageOutputException
)
pure virtual

Notification about a poly to render.

Parameters
primitivethe poly primitive
Exceptions
HGL::ImageOutput::ImageOutputExceptionin case of an unrecoverable error
Since
0.4.70

Implemented in HGL::ImageOutput::DefaultPreRenderOutput.

virtual void HGL::ImageOutput::IPreRenderOutput::update ( const EllipsePrimitive *const  primitive)
throw (ImageOutputException
)
pure virtual

Notification about an ellipse to render.

Parameters
primitivethe ellipse primitive
Exceptions
HGL::ImageOutput::ImageOutputExceptionin case of an unrecoverable error
Since
0.4.70

Implemented in HGL::ImageOutput::DefaultPreRenderOutput.

virtual void HGL::ImageOutput::IPreRenderOutput::update ( const TextPrimitive *const  primitive)
throw (ImageOutputException
)
pure virtual

Notification about a text to render.

Parameters
primitivethe text primitive
Exceptions
HGL::ImageOutput::ImageOutputExceptionin case of an unrecoverable error
Since
0.4.70

Implemented in HGL::ImageOutput::DefaultPreRenderOutput.

virtual void HGL::ImageOutput::IOutput::writeImage ( const ICanvas canvas,
const std::string &  filename = std::string() 
) const
throw (ImageOutputException
)
pure virtualinherited

Writes an ICanvas bitmap into an image.

Parameters
canvasthe ICanvas bitmap to write
filenamefilename to write the image to, if the filename is the empty string it should write to the standard output
Exceptions
ImageOutputExceptionif an unrecoverable error occured while writing
See Also
Writer

Implemented in HGL::ImageOutput::DefaultPreRenderOutput.