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

Interface for rendering images to concrete file formats. More...

#include "icanvas.h"

Classes

struct  _transformationInfo
 This structure holds the calculated transformation info. More...
 
struct  RGB
 Structure representing a color. More...
 
struct  RGBA
 Structure representing a color. More...
 

Public Types

typedef struct
HGL::ImageOutput::ICanvas::_transformationInfo 
TRANSFORMATIONINFO
 This structure holds the calculated transformation info. More...
 

Public Member Functions

virtual ~ICanvas ()
 Destructor. More...
 
Dimensions
virtual uint16_t getWidth () const =0
 Gets the width of the canvas. More...
 
virtual uint16_t getHeight () const =0
 Gets the height of the canvas. More...
 
virtual bool doExplicitScale () const =0
 Determines if explicit scale should be enabled. More...
 
Data access
virtual HGL::Type::IProject * getProject () const =0
 Gets the complete processed project. More...
 
virtual const RGBAgetRow (uint16_t row) const =0
 Gets a row of the canvas as array of colors. More...
 

Protected Member Functions

 ICanvas ()
 Constructor. More...
 

Color management

typedef std::set< RGBACOLORSPACE
 A colorspace set. More...
 
virtual const COLORSPACE getColorSpace () const =0
 Gets a sorted set with all unique colors in the current ICanvas. More...
 
virtual bool isBackground (uint16_t x, uint16_t y) const =0
 Checks if the given position is the unaltered background. More...
 
virtual const RGBAgetBackgroundColor () const =0
 Gets the background color of the ICanvas. More...
 
virtual int getSCQColors () const =0
 Returns the amount of colors for spatial color quantization. More...
 

Detailed Description

Interface for rendering images to concrete file formats.

Author
Heiko Schäfer heiko.nosp@m.@hgl.nosp@m..rang.nosp@m.un.d.nosp@m.e
Examples:
exampleoutput.cpp, and exampleoutput.h.

Member Typedef Documentation

A colorspace set.

Since
0.5.5

Constructor & Destructor Documentation

virtual HGL::ImageOutput::ICanvas::~ICanvas ( )
virtual

Destructor.

HGL::ImageOutput::ICanvas::ICanvas ( )
protected

Constructor.

Member Function Documentation

virtual bool HGL::ImageOutput::ICanvas::doExplicitScale ( ) const
pure virtual

Determines if explicit scale should be enabled.

Explicit scale is enabled if either the 'w' or 'h' option or both are given on the command line. If not the default values for width and height are taken and this function returns false.

Returns
bool true if the output image should get scaled explicitely, false otherwise
Since
0.5.2
virtual const RGBA& HGL::ImageOutput::ICanvas::getBackgroundColor ( ) const
pure virtual

Gets the background color of the ICanvas.

Returns
the background color of the ICanvas
Since
0.5.14
virtual const COLORSPACE HGL::ImageOutput::ICanvas::getColorSpace ( ) const
pure virtual

Gets a sorted set with all unique colors in the current ICanvas.

Returns
a set with unique color indices
See Also
RGBA::getColorIndex() const
COLORSPACEINDEX(colorspace, index)
Since
0.4.49
virtual uint16_t HGL::ImageOutput::ICanvas::getHeight ( ) const
pure virtual

Gets the height of the canvas.

Returns
the height in pixels
virtual HGL::Type::IProject* HGL::ImageOutput::ICanvas::getProject ( ) const
pure virtual

Gets the complete processed project.

Returns
the complete processed project
Since
0.5.21
virtual const RGBA* HGL::ImageOutput::ICanvas::getRow ( uint16_t  row) const
pure virtual

Gets a row of the canvas as array of colors.

Parameters
rownumber of the row
Returns
an array of colors of getWidth() size
virtual int HGL::ImageOutput::ICanvas::getSCQColors ( ) const
pure virtual

Returns the amount of colors for spatial color quantization.

Returns
the amount of colors or 0 if no spatial color quantization is requested
Since
0.4.50
virtual uint16_t HGL::ImageOutput::ICanvas::getWidth ( ) const
pure virtual

Gets the width of the canvas.

Returns
the width in pixels
virtual bool HGL::ImageOutput::ICanvas::isBackground ( uint16_t  x,
uint16_t  y 
) const
pure virtual

Checks if the given position is the unaltered background.

Parameters
xthe x-coordinate
ythe y-coordinate
Returns
true if the background is unaltered, false otherwise
Since
0.5.14