Simple++
Powerfull and lightning fast C++ Library
Namespaces | Classes | Typedefs | Enumerations | Functions
Graphic Namespace Reference

Namespaces

 BlendingFunc
 
 ColorFunc
 
 InterpolationFunc
 

Classes

class  _Image
 Image Class T Type of one pixel F Format of the image. More...
 
struct  _ImageSumType
 Struct used to retrieve the type of a summation of multiple pixel components. More...
 
struct  _ImageSumType< double >
 
struct  _ImageSumType< float >
 
class  Font
 
class  FontLoadable
 
class  FreeImage
 
class  FreeTypeChar
 
class  Gradient
 Represent a 2D Gradient for 2D image processing. More...
 
class  GradientHorizontal
 
class  GradientInterpolation
 base class of an interpolated gradient More...
 
class  GradientLinear
 
class  GradientPoint
 A point in a gradient C Type for one color. More...
 
class  GradientRadial
 
class  GradientVertical
 
class  Texture
 
class  TextureLoadable
 

Typedefs

template<typename T = unsigned char>
using ColorRGBA = Math::Vec4< T >
 
template<typename T = unsigned char>
using ColorRGB = Math::Vec3< T >
 
template<typename T = unsigned char>
using ColorR = T
 
typedef ColorRGBA< float > ColorRGBAf
 
typedef ColorRGB< float > ColorRGBf
 
typedef ColorR< float > ColorRf
 
typedef int Size
 
typedef Math::Vec2< int > Point
 
typedef Math::Vec2< float > PointF
 
typedef Math::Rectangle< int > Rectangle
 
typedef Math::Line< int > Line
 
typedef Math::Line< float > LineF
 
typedef _Image< unsigned char > Image
 
typedef _Image< float > ImageF
 

Enumerations

enum  Format : unsigned int { Format::R = 1, Format::RGB = 3, Format::RGBA = 4 }
 
enum  LoadingFormat {
  LoadingFormat::R, LoadingFormat::RGB, LoadingFormat::BGR, LoadingFormat::RGBA,
  LoadingFormat::BGRA
}
 

Functions

template<typename T , typename C , typename InterFunc , typename BlendFunc = BlendingFunc::Normal>
void drawText (_Image< T > *image, const Font &font, const Point &point, const UTF8String &text, const GradientHorizontal< C, InterFunc > &gradient, const Math::Vec2< bool > &centered=Math::Vec2< bool >(false), const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw the text to the specified position More...
 
template<typename T , typename C , typename InterFunc , typename BlendFunc = BlendingFunc::Normal>
void drawText (_Image< T > *image, const Font &font, const Rectangle &rectangle, const UTF8String &text, const GradientHorizontal< C, InterFunc > &gradient, const Math::Vec2< bool > &centered=Math::Vec2< bool >(false), const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw the text to the specified position More...
 
template<typename T , typename C , typename InterFunc , typename BlendFunc = BlendingFunc::Normal>
void drawText (_Image< T > *image, const Font &font, const Point &point, const UTF8String &text, const GradientVertical< C, InterFunc > &gradient, const Math::Vec2< bool > &centered=Math::Vec2< bool >(false), const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw the text to the specified position More...
 
template<typename T , typename C , typename InterFunc , typename BlendFunc = BlendingFunc::Normal>
void drawText (_Image< T > *image, const Font &font, const Rectangle &rectangle, const UTF8String &text, const GradientVertical< C, InterFunc > &gradient, const Math::Vec2< bool > &centered=Math::Vec2< bool >(false), const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw the text to the specified position More...
 
template<typename T , typename BlendFunc = BlendingFunc::Normal>
void drawText (_Image< T > *image, const Font &font, const Point &point, const UTF8String &text, const ColorR< T > &color, const Math::Vec2< bool > &centered=Math::Vec2< bool >(false), const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw the text to the specified position More...
 
template<typename T , typename BlendFunc = BlendingFunc::Normal>
void drawText (_Image< T > *image, const Font &font, const Rectangle &rectangle, const UTF8String &text, const ColorR< T > &color, const Math::Vec2< bool > &centered=Math::Vec2< bool >(false), const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw the text to the specified position More...
 
template<typename T , typename BlendFunc = BlendingFunc::Normal>
void drawText (_Image< T > *image, const Font &font, const Point &point, const UTF8String &text, const ColorRGB< T > &color, const Math::Vec2< bool > &centered=Math::Vec2< bool >(false), const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw the text to the specified position More...
 
template<typename T , typename BlendFunc = BlendingFunc::Normal>
void drawText (_Image< T > *image, const Font &font, const Rectangle &rectangle, const UTF8String &text, const ColorRGB< T > &color, const Math::Vec2< bool > &centered=Math::Vec2< bool >(false), const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw the text to the specified position More...
 
template<typename T , typename BlendFunc = BlendingFunc::Normal>
void drawText (_Image< T > *image, const Font &font, const Point &point, const UTF8String &text, const ColorRGBA< T > &color, const Math::Vec2< bool > &centered=Math::Vec2< bool >(false), const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw the text to the specified position More...
 
template<typename T , typename BlendFunc = BlendingFunc::Normal>
void drawText (_Image< T > *image, const Font &font, const Rectangle &rectangle, const UTF8String &text, const ColorRGBA< T > &color, const Math::Vec2< bool > &centered=Math::Vec2< bool >(false), const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw the text to the specified position More...
 
template<typename T >
void drawText (_Image< T > *image, const Font &font, const Point &point, const UTF8String &text, const Math::Vec2< bool > &centered=Math::Vec2< bool >(false))
 draw the text to the specified position without a blending, the character bitmap will directly by copied to the specified image More...
 
template<typename T >
void drawText (_Image< T > *image, const Font &font, const Rectangle &rectangle, const UTF8String &text, const Math::Vec2< bool > &centered=Math::Vec2< bool >(false))
 draw the text to the specified position without a blending, the character bitmap will directly by copied to the specified image More...
 
template<typename T , typename C , typename BlendFunc >
void _drawText (_Image< T > *image, const Font &font, const Point &point, const UTF8String &text, const C &color, const Math::Vec2< bool > &centered, const BlendFunc &blendFunc)
 private function do not touch this. More...
 
template<typename T , typename C , typename BlendFunc >
void _drawText (_Image< T > *image, const Font &font, const Rectangle &rectangle, const UTF8String &text, const C &color, const Math::Vec2< bool > &centered, const BlendFunc &blendFunc)
 private function do not touch this. More...
 
template<typename Func >
void _drawText (const Font &font, const Point &point, const UTF8String &text, const Math::Vec2< bool > &centered, Func &func)
 private function do not touch this. More...
 
template<typename Func >
void _drawTextWBB (const Font &font, const Point &point, const UTF8String &text, const Math::Vec2< bool > &centered, Func &func)
 private function do not touch this. More...
 
template<typename Func >
void _drawText (const Font &font, const Rectangle &rectangle, const UTF8String &text, const Math::Vec2< bool > &centered, Func &func)
 private function do not touch this. More...
 

Typedef Documentation

template<typename T = unsigned char>
using Graphic::ColorR = typedef T
typedef ColorR<float> Graphic::ColorRf
template<typename T = unsigned char>
using Graphic::ColorRGB = typedef Math::Vec3<T>
template<typename T = unsigned char>
using Graphic::ColorRGBA = typedef Math::Vec4<T>
typedef ColorRGB<float> Graphic::ColorRGBf
typedef _Image<unsigned char> Graphic::Image
typedef _Image<float> Graphic::ImageF
typedef Math::Line<int> Graphic::Line
typedef Math::Line<float> Graphic::LineF
typedef Math::Vec2<int> Graphic::Point
typedef Math::Vec2<float> Graphic::PointF
typedef int Graphic::Size

Enumeration Type Documentation

enum Graphic::Format : unsigned int
strong
Enumerator
RGB 
RGBA 
Enumerator
RGB 
BGR 
RGBA 
BGRA 

Function Documentation

template<typename T , typename C , typename BlendFunc >
void Graphic::_drawText ( _Image< T > *  image,
const Font font,
const Point point,
const UTF8String text,
const C &  color,
const Math::Vec2< bool > &  centered,
const BlendFunc &  blendFunc 
)

private function do not touch this.

template<typename T , typename C , typename BlendFunc >
void Graphic::_drawText ( _Image< T > *  image,
const Font font,
const Rectangle rectangle,
const UTF8String text,
const C &  color,
const Math::Vec2< bool > &  centered,
const BlendFunc &  blendFunc 
)

private function do not touch this.

template<typename Func >
void Graphic::_drawText ( const Font font,
const Point point,
const UTF8String text,
const Math::Vec2< bool > &  centered,
Func &  func 
)

private function do not touch this.

template<typename Func >
void Graphic::_drawText ( const Font font,
const Rectangle rectangle,
const UTF8String text,
const Math::Vec2< bool > &  centered,
Func &  func 
)

private function do not touch this.

template<typename Func >
void Graphic::_drawTextWBB ( const Font font,
const Point point,
const UTF8String text,
const Math::Vec2< bool > &  centered,
Func &  func 
)

private function do not touch this.

template<typename T , typename C , typename InterFunc , typename BlendFunc = BlendingFunc::Normal>
void Graphic::drawText ( _Image< T > *  image,
const Font font,
const Point point,
const UTF8String text,
const GradientHorizontal< C, InterFunc > &  gradient,
const Math::Vec2< bool > &  centered = Math::Vec2<bool>( false ),
const BlendFunc &  blendFunc = BlendingFunc::Normal() 
)

draw the text to the specified position

Parameters
fontFont object to use
pointPosition where to draw (left bottom anchor of the text)
textText to draw
gradientto use to draw the text
centeredIf the text has to be centered vertically or horizontally.
blendFuncFunctor with operator() overloaded with "void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;"
template<typename T , typename C , typename InterFunc , typename BlendFunc = BlendingFunc::Normal>
void Graphic::drawText ( _Image< T > *  image,
const Font font,
const Rectangle rectangle,
const UTF8String text,
const GradientHorizontal< C, InterFunc > &  gradient,
const Math::Vec2< bool > &  centered = Math::Vec2<bool>( false ),
const BlendFunc &  blendFunc = BlendingFunc::Normal() 
)

draw the text to the specified position

Parameters
fontFont object to use
rectangleRectangle where the text will be.
textText to draw
gradientto use to draw the text
centeredIf the text has to be centered vertically or horizontally.
blendFuncFunctor with operator() overloaded with "void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;"
template<typename T , typename C , typename InterFunc , typename BlendFunc = BlendingFunc::Normal>
void Graphic::drawText ( _Image< T > *  image,
const Font font,
const Point point,
const UTF8String text,
const GradientVertical< C, InterFunc > &  gradient,
const Math::Vec2< bool > &  centered = Math::Vec2<bool>( false ),
const BlendFunc &  blendFunc = BlendingFunc::Normal() 
)

draw the text to the specified position

Parameters
fontFont object to use
pointPosition where to draw (left bottom anchor of the text)
textText to draw
gradientto use to draw the text
centeredIf the text has to be centered vertically or horizontally.
blendFuncFunctor with operator() overloaded with "void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;"
template<typename T , typename C , typename InterFunc , typename BlendFunc = BlendingFunc::Normal>
void Graphic::drawText ( _Image< T > *  image,
const Font font,
const Rectangle rectangle,
const UTF8String text,
const GradientVertical< C, InterFunc > &  gradient,
const Math::Vec2< bool > &  centered = Math::Vec2<bool>( false ),
const BlendFunc &  blendFunc = BlendingFunc::Normal() 
)

draw the text to the specified position

Parameters
fontFont object to use
rectangleRectangle where the text will be.
textText to draw
gradientto use to draw the text
centeredIf the text has to be centered vertically or horizontally.
blendFuncFunctor with operator() overloaded with "void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;"
template<typename T , typename BlendFunc = BlendingFunc::Normal>
void Graphic::drawText ( _Image< T > *  image,
const Font font,
const Point point,
const UTF8String text,
const ColorR< T > &  color,
const Math::Vec2< bool > &  centered = Math::Vec2<bool>( false ),
const BlendFunc &  blendFunc = BlendingFunc::Normal() 
)

draw the text to the specified position

Parameters
fontFont object to use
pointPosition where to draw (left bottom anchor of the text)
textText to draw
colorto use to draw the text
centeredIf the text has to be centered vertically or horizontally.
blendFuncFunctor with operator() overloaded with "void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;"
template<typename T , typename BlendFunc = BlendingFunc::Normal>
void Graphic::drawText ( _Image< T > *  image,
const Font font,
const Rectangle rectangle,
const UTF8String text,
const ColorR< T > &  color,
const Math::Vec2< bool > &  centered = Math::Vec2<bool>( false ),
const BlendFunc &  blendFunc = BlendingFunc::Normal() 
)

draw the text to the specified position

Parameters
fontFont object to use
rectangleRectangle where the text will be.
textText to draw
colorto use to draw the text
centeredIf the text has to be centered vertically or horizontally.
blendFuncFunctor with operator() overloaded with "void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;"
template<typename T , typename BlendFunc = BlendingFunc::Normal>
void Graphic::drawText ( _Image< T > *  image,
const Font font,
const Point point,
const UTF8String text,
const ColorRGB< T > &  color,
const Math::Vec2< bool > &  centered = Math::Vec2<bool>( false ),
const BlendFunc &  blendFunc = BlendingFunc::Normal() 
)

draw the text to the specified position

Parameters
fontFont object to use
pointPosition where to draw (left bottom anchor of the text)
textText to draw
colorto use to draw the text
centeredIf the text has to be centered vertically or horizontally.
blendFuncFunctor with operator() overloaded with "void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;"
template<typename T , typename BlendFunc = BlendingFunc::Normal>
void Graphic::drawText ( _Image< T > *  image,
const Font font,
const Rectangle rectangle,
const UTF8String text,
const ColorRGB< T > &  color,
const Math::Vec2< bool > &  centered = Math::Vec2<bool>( false ),
const BlendFunc &  blendFunc = BlendingFunc::Normal() 
)

draw the text to the specified position

Parameters
fontFont object to use
rectangleRectangle where the text will be.
textText to draw
colorto use to draw the text
centeredIf the text has to be centered vertically or horizontally.
blendFuncFunctor with operator() overloaded with "void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;"
template<typename T , typename BlendFunc = BlendingFunc::Normal>
void Graphic::drawText ( _Image< T > *  image,
const Font font,
const Point point,
const UTF8String text,
const ColorRGBA< T > &  color,
const Math::Vec2< bool > &  centered = Math::Vec2<bool>( false ),
const BlendFunc &  blendFunc = BlendingFunc::Normal() 
)

draw the text to the specified position

Parameters
fontFont object to use
pointPosition where to draw (left bottom anchor of the text)
textText to draw
colorto use to draw the text
centeredIf the text has to be centered vertically or horizontally.
blendFuncFunctor with operator() overloaded with "void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;"
template<typename T , typename BlendFunc = BlendingFunc::Normal>
void Graphic::drawText ( _Image< T > *  image,
const Font font,
const Rectangle rectangle,
const UTF8String text,
const ColorRGBA< T > &  color,
const Math::Vec2< bool > &  centered = Math::Vec2<bool>( false ),
const BlendFunc &  blendFunc = BlendingFunc::Normal() 
)

draw the text to the specified position

Parameters
fontFont object to use
rectangleRectangle where the text will be.
textText to draw
colorto use to draw the text
centeredIf the text has to be centered vertically or horizontally.
blendFuncFunctor with operator() overloaded with "void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;"
template<typename T >
void Graphic::drawText ( _Image< T > *  image,
const Font font,
const Point point,
const UTF8String text,
const Math::Vec2< bool > &  centered = Math::Vec2<bool>( false ) 
)

draw the text to the specified position without a blending, the character bitmap will directly by copied to the specified image

Parameters
fontFont object to use
pointPosition where to draw (left bottom anchor of the text)
textText to draw
centeredIf the text has to be centered vertically or horizontally.
template<typename T >
void Graphic::drawText ( _Image< T > *  image,
const Font font,
const Rectangle rectangle,
const UTF8String text,
const Math::Vec2< bool > &  centered = Math::Vec2<bool>( false ) 
)

draw the text to the specified position without a blending, the character bitmap will directly by copied to the specified image

Parameters
fontFont object to use
rectangleRectangle where the text will be.
textText to draw
centeredIf the text has to be centered vertically or horizontally.