hgl 0.5.42~jessie
A compiler/interpreter suite for developing images (plugin development)
|
Image output plugins are far the most easy to implement plugins.
Simply one of your classes must inherit from HGL::ImageOutput::IPreRenderOutput and implement the HGL::ImageOutput::IPreRenderOutput::writeImage method.
Further it must register to HGL by using #REGISTER_IOPLUGIN in your definition file of the derived class.
The rest is subject to your implemenentation of the plugin. You can throw an HGL::ImageOutput::ImageOutputException if there is an unrecoverable error in your plugin. HGL will display it as message and exits then.
You must support output to the standard output if no filename (i.e. an empty string) is given, otherwise write your image to that file.
The data of the image can get accessed by the provided HGL::ImageOutput::ICanvas interface.
As you can see it is quite straightforward to develop image output plugins for HGL.
Below is an code example how to write an plugin.
The exampleoutput.h:
The exampleoutput.cpp:
Finally you must produce the actual plugin. On Linux
it can be done the following way:
g++ -fPIC -DPIC -c example.cpp
g++ -shared -module -o libhglioexm.so -Wl,-soname,libhglioexm.so example.o /usr/lib/i386-linux-gnu/hgl/libhglimageoutput.so
cp libhglioexm.so /usr/lib/i386-linux-gnu/hgl/plugins
libhglio*
For classes, methods, etc see ioplugins.