Simple++
Powerfull and lightning fast C++ Library
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Graphic::_Image< T > Class Template Reference

Image Class T Type of one pixel F Format of the image. More...

#include <Image.h>

Inheritance diagram for Graphic::_Image< T >:
BasicIO BasicSimpleIO Graphic::FreeTypeChar

Public Types

enum  ResamplingMode { ResamplingMode::Nearest, ResamplingMode::Linear, ResamplingMode::Lanczos }
 
enum  ConvolutionMode { ConvolutionMode::NormalSize, ConvolutionMode::ExtendedSize }
 
enum  ConversionMode { ConversionMode::Luminance, ConversionMode::Trunquate, ConversionMode::Alpha }
 
enum  StrokeType { StrokeType::Outside, StrokeType::Inside, StrokeType::Middle }
 
typedef _ImageSumType< T >::Type SumType
 Type used to sum multiple pixels components. More...
 

Public Member Functions

template<typename C >
 _Image (const _Image< C > &image)
 copy constructor with an another storage type More...
 
 _Image (Format format=Format::RGB)
 Empty constructor, create an image unallocated of size (0:0) More...
 
 _Image (const Math::Vec2< Size > &size, Format format=Format::RGB)
 Constructor to create an initialized image of specified size. More...
 
 _Image (std::fstream *fileStream)
 create a new image data from a file stream. More...
 
 _Image (const T *data, const Math::Vec2< Size > &size, LoadingFormat loadingFormat=LoadingFormat::RGB, bool invertY=false, size_t stride=0)
 Constructor to create an image from a data buffer. More...
 
 _Image (const _Image< T > &image)
 copy constructor More...
 
 _Image (_Image< T > &&image)
 move constructor More...
 
 ~_Image ()
 
const Math::Vec2< Size > & getSize () const
 get the actual size (width:height) of the image More...
 
Size getWidth () const
 get the actual width of the image More...
 
Size getHeight () const
 get the actual height of the image More...
 
size_t getNbPixels () const
 get the number of pixels of this image More...
 
void clear (const Math::Vec2< Size > &size)
 reset this image with a new size. More...
 
void clear (const Math::Vec2< Size > &size, Format format)
 reset this image with a new size and a new format More...
 
void setDatas (const T *data, const Math::Vec2< Size > &size, LoadingFormat loadingFormat=LoadingFormat::RGB, bool invertY=false, size_t stride=0)
 set the data from an another data buffer. More...
 
_Image< T > * createMipmap ()
 create a new image from this one with a size of width / 2 and height / 2 More...
 
const T * getDatas () const
 get the data buffer of this image More...
 
T * getDatas ()
 get the data buffer of this image More...
 
const T * getDatas (Size x, Size y) const
 get the data buffer of this image starting with the selected pixel More...
 
T * getDatas (Size x, Size y)
 get the data buffer of this image starting with the selected pixel More...
 
const T * getPixel (Size x, Size y) const
 get a pixel from this image More...
 
T * getPixel (Size x, Size y)
 get a pixel from this image More...
 
size_t getDataOffset (Size x, Size y) const
 get the offset of pixel from the beginning of the data More...
 
void setPixel (Size x, Size y, const T *p)
 set a pixel inside this image More...
 
template<typename C >
_Image< T > & operator= (const _Image< C > &image)
 copy operator with another type More...
 
_Image< T > & operator= (const _Image< T > &image)
 copy operator More...
 
_Image< T > & operator= (_Image< T > &&image)
 move operator More...
 
bool read (std::fstream *fileStream)
 read from a file stream More...
 
bool write (std::fstream *fileStream) const
 write this object as binary into a file stream More...
 
Format getFormat () const
 get the format of this image More...
 
unsigned int getNbComponents () const
 get the number of components per pixels of this image. More...
 
_Image< T > toFormat (Format newFormat, ConversionMode conversionMode=ConversionMode::Luminance) const
 Create a new Image from this one with a new format. More...
 
template<typename C , typename InterFunc >
size_t computeInterpolation (const GradientHorizontal< C, InterFunc > &gradient, C **buffer, const Rectangle &rectangle, Math::Rectangle< Size > *clampedRectangle) const
 Compute the interpolation for horizontal gradient. More...
 
template<typename C , typename InterFunc >
size_t computeInterpolation (const GradientVertical< C, InterFunc > &gradient, C **buffer, const Rectangle &rectangle, Math::Rectangle< Size > *clampedRectangle) const
 Compute the interpolation for vertical gradient. More...
 
template<typename C , typename InterFunc >
size_t computeInterpolation (const GradientLinear< C, InterFunc > &gradient, C **buffer, const Rectangle &rectangle, Math::Rectangle< Size > *clampedRectangle) const
 Compute the interpolation for Linear gradient. More...
 
template<typename C , typename InterFunc >
size_t computeInterpolation (const GradientRadial< C, InterFunc > &gradient, C **buffer, const Rectangle &rectangle, Math::Rectangle< Size > *clampedRectangle) const
 Compute the interpolation for Radial gradient. More...
 
template<typename ThreshFunc >
void threshold (const ColorRGBA< T > &colorTrue, const ColorRGBA< T > &colorFalse, const ThreshFunc &threshFunc)
 Threshold the image with a specified functor. More...
 
void threshold (const ColorRGBA< T > &colorOver, const ColorRGBA< T > &colorUnder, const ColorRGBA< T > &limit)
 Threshold the image with a specified threshold. More...
 
template<typename BlendFunc = BlendingFunc::Normal>
void drawLine (const LineF &l, const ColorR< T > &color, unsigned int thickness=1, const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw an anti aliased line from point p1 to point p2 More...
 
template<typename BlendFunc = BlendingFunc::Normal>
void drawLine (const LineF &l, const ColorRGB< T > &color, unsigned int thickness=1, const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw an anti aliased line from point p1 to point p2 More...
 
template<typename BlendFunc = BlendingFunc::Normal>
void drawLine (const LineF &l, const ColorRGBA< T > &color, unsigned int thickness=1, const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw an anti aliased line from point p1 to point p2 More...
 
template<typename ColorFunc , typename BlendFunc = BlendingFunc::Normal>
void drawLineFunctor (const LineF &l, ColorFunc &colorFunc, unsigned int thickness=1, const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw an anti aliased line from point p1 to point p2 More...
 
template<typename Functor >
void setPixels (Functor &functor, const Rectangle &rectangle)
 Set a functor to each pixels in the rectangle of this image. More...
 
template<typename Functor >
void setPixels (Functor &functor)
 Set a functor to each pixels of this image. More...
 
template<typename BlendFunc = BlendingFunc::Normal>
void drawRectangle (const Rectangle &rectangle, const ColorR< T > &color, const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw a rectangle inside this image. More...
 
template<typename BlendFunc = BlendingFunc::Normal>
void drawRectangle (const Rectangle &rectangle, const ColorRGB< T > &color, const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw a rectangle inside this image. More...
 
template<typename BlendFunc = BlendingFunc::Normal>
void drawRectangle (const Rectangle &rectangle, const ColorRGBA< T > &color, const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw a rectangle inside this image. More...
 
template<typename C , typename InterFunc >
void drawRectangle (const Rectangle &rectangle, const GradientHorizontal< C, InterFunc > &gradient)
 draw a rectangle inside this image. More...
 
template<typename C , typename InterFunc , typename BlendFunc = BlendingFunc::Normal>
void drawRectangle (const Rectangle &rectangle, const GradientLinear< C, InterFunc > &gradient, const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw a rectangle inside this image. More...
 
template<typename C , typename InterFunc , typename BlendFunc = BlendingFunc::Normal>
void drawRectangle (const Rectangle &rectangle, const GradientRadial< C, InterFunc > &gradient, const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw a rectangle inside this image. More...
 
template<typename C , typename InterFunc , typename BlendFunc >
void drawRectangle (const Rectangle &rectangle, const GradientHorizontal< C, InterFunc > &gradient, const BlendFunc &blendFunc)
 draw a rectangle inside this image. More...
 
template<typename C , typename InterFunc , typename BlendFunc = BlendingFunc::Normal>
void drawRectangle (const Rectangle &rectangle, const GradientVertical< C, InterFunc > &gradient, const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw a rectangle inside this image. More...
 
template<typename ColorFunc , typename BlendFunc = BlendingFunc::Normal>
void drawRectangleFunctor (const Rectangle &rectangle, ColorFunc &colorFunc, const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw a rectangle inside this image. More...
 
void fillImage (const T *color)
 fill the complete image with a color. param color pointer to a color with the same number of component of this image More...
 
void fillImage (const T *color, const Rectangle &rectangle)
 fill the complete image with a color. More...
 
void fillImage (const ColorR< T > &color)
 fill the complete image with a color. More...
 
void fillImage (const ColorRGB< T > &color)
 fill the complete image with a color. More...
 
void fillImage (const ColorRGBA< T > &color)
 fill the complete image with a color. More...
 
void fillImage (const ColorR< T > &color, const Rectangle &rectangle)
 fill the complete image with a color. More...
 
void fillImage (const ColorRGB< T > &color, const Rectangle &rectangle)
 fill the complete image with a color. More...
 
void fillImage (const ColorRGBA< T > &color, const Rectangle &rectangle)
 fill the complete image with a color. More...
 
template<typename C , typename InterFunc >
void fillImage (const GradientHorizontal< C, InterFunc > &gradient, const Rectangle &rectangle)
 fill the complete image with a horizontal gradient. More...
 
template<typename C , typename InterFunc >
void fillImage (const GradientVertical< C, InterFunc > &gradient, const Rectangle &rectangle)
 fill the complete image with a vertical gradient. More...
 
template<typename C , typename InterFunc >
void fillImage (const GradientLinear< C, InterFunc > &gradient, const Rectangle &rectangle)
 fill the complete image with a Linear gradient. More...
 
template<typename C , typename InterFunc >
void fillImage (const GradientRadial< C, InterFunc > &gradient, const Rectangle &rectangle)
 fill the complete image with a Radial gradient. More...
 
void fillImage (const Point &point, const _Image< T > &image)
 fill an another image into this one (no blending will be applied) More...
 
void fillImage (const Point &point, const Rectangle &rectangle, const _Image< T > &image)
 fill an another image into this one (no blending will be applied) More...
 
void drawImage (const Point &point, const _Image< T > &image)
 draw an another image into this one More...
 
void drawImage (const Point &point, const Rectangle &rectangle, const _Image< T > &image)
 draw an another image into this one More...
 
template<typename BlendFunc = BlendingFunc::Normal>
void drawImage (const Point &point, const Rectangle &rectangle, const _Image< T > &image, const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw an another image into this one with a custom blending function More...
 
template<typename BlendFunc = BlendingFunc::Normal>
void drawImage (const Point &point, const ColorR< T > &color, const _Image< T > &maskImage, const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw a color to this image using a mask More...
 
template<typename BlendFunc = BlendingFunc::Normal>
void drawImage (const Point &point, const ColorRGB< T > &color, const _Image< T > &maskImage, const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw a color to this image using a mask More...
 
template<typename BlendFunc = BlendingFunc::Normal>
void drawImage (const Point &point, const ColorRGBA< T > &color, const _Image< T > &maskImage, const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw a color to this image using a mask More...
 
template<typename BlendFunc = BlendingFunc::Normal>
void drawImage (const Point &point, const ColorR< T > &color, const Rectangle &rectangle, const _Image< T > &maskImage, const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw a color to this image using a mask and a rectangle to know the part of the mask to use. More...
 
template<typename BlendFunc = BlendingFunc::Normal>
void drawImage (const Point &point, const ColorRGB< T > &color, const Rectangle &rectangle, const _Image< T > &maskImage, const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw a color to this image using a mask and a rectangle to know the part of the mask to use. More...
 
template<typename BlendFunc = BlendingFunc::Normal>
void drawImage (const Point &point, const ColorRGBA< T > &color, const Rectangle &rectangle, const _Image< T > &maskImage, const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw a color to this image using a mask and a rectangle to know the part of the mask to use. More...
 
template<typename ColorFunc , typename BlendFunc = BlendingFunc::Normal>
void drawImageFunctor (const Point &point, ColorFunc &colorFunc, const Rectangle &rectangle, const _Image< T > &maskImage, const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw a color to this image using a mask and a rectangle to know the part of the mask to use. More...
 
void drawImage (const Point &point, const _Image< T > &image, const _Image< T > &maskImage)
 draw an another image into this one with a mask image More...
 
void drawImage (const Point &point, const _Image< T > &image, const Point &maskPoint, const _Image< T > &maskImage)
 draw an another image into this one with a mask image More...
 
template<typename BlendFunc = BlendingFunc::Normal>
void drawImage (const Point &point, const Rectangle &rectangle, const _Image< T > &image, const Point &maskPoint, const _Image< T > &maskImage, const BlendFunc &blendFunc=BlendingFunc::Normal())
 draw an another image into this one with a mask image More...
 
template<typename ColorFunc , typename BlendFunc = BlendingFunc::Normal>
void drawStrokeFunctor (const Point &point, const _Image< T > &image, unsigned int thickness, ColorFunc &colorFunc, StrokeType strokeType=StrokeType::Middle, const BlendFunc &blendFunc=BlendingFunc::Normal())
 Stroke the image with a specified color functor. More...
 
template<typename BlendFunc = BlendingFunc::Normal>
void drawStroke (const Point &point, const _Image< T > &image, unsigned int thickness, const ColorR< T > &color, StrokeType strokeType=StrokeType::Middle, const BlendFunc &blendFunc=BlendingFunc::Normal())
 Stroke the image with a specified color. More...
 
template<typename BlendFunc = BlendingFunc::Normal>
void drawStroke (const Point &point, const _Image< T > &image, unsigned int thickness, const ColorRGB< T > &color, StrokeType strokeType=StrokeType::Middle, const BlendFunc &blendFunc=BlendingFunc::Normal())
 Stroke the image with a specified color. More...
 
template<typename BlendFunc = BlendingFunc::Normal>
void drawStroke (const Point &point, const _Image< T > &image, unsigned int thickness, const ColorRGBA< T > &color, StrokeType strokeType=StrokeType::Middle, const BlendFunc &blendFunc=BlendingFunc::Normal())
 Stroke the image with a specified color. More...
 
template<typename BlendFunc = BlendingFunc::Normal>
void drawBezierCurve (const PointF &p0, const PointF &p1, const PointF p2, const PointF &p3, unsigned int thickness, ColorR< T > &color, const BlendFunc &blendFunc=BlendingFunc::Normal())
 Draw a Cubic Bezier curve. More...
 
template<typename BlendFunc = BlendingFunc::Normal>
void drawBezierCurve (const PointF &p0, const PointF &p1, const PointF p2, const PointF &p3, unsigned int thickness, ColorRGB< T > &color, const BlendFunc &blendFunc=BlendingFunc::Normal())
 
template<typename BlendFunc = BlendingFunc::Normal>
void drawBezierCurve (const PointF &p0, const PointF &p1, const PointF p2, const PointF &p3, unsigned int thickness, ColorRGBA< T > &color, const BlendFunc &blendFunc=BlendingFunc::Normal())
 
template<typename ColorFunc , typename BlendFunc = BlendingFunc::Normal>
void drawGraphValuesFunctor (const Vector< Math::Vec2< float >> &values, const Rectangle &rectangle, ColorFunc &colorFunc, BlendFunc &blendFunc=BlendingFunc::Normal())
 draw points (x,y) as a graph inside a rectangle More...
 
template<typename F , int N>
_Image< T > applyFilter (const F(&filter)[N], ConvolutionMode convolutionMode=ConvolutionMode::ExtendedSize, const ColorRGBA< T > &color=ColorRGBA< T >::null) const
 apply a symmetrical convolution filter (Gaussian blur for example) More...
 
template<typename F >
_Image< T > applyFilter (const F *filter, size_t size, ConvolutionMode convolutionMode=ConvolutionMode::ExtendedSize, const ColorRGBA< T > &color=ColorRGBA< T >::null) const
 apply a symmetrical convolution filter (Gaussian blur for example) More...
 
_Image< T > applyGaussianBlur (size_t radius, ConvolutionMode convolutionMode=ConvolutionMode::ExtendedSize, const ColorRGBA< T > &color=ColorRGBA< T >::null) const
 apply a Gaussian Blur Filter More...
 
Math::Rectangle< SizeclampRectangle (const Rectangle &rectangle) const
 Clamp a rectangle inside the image. More...
 
template<typename BlendFunc = BlendingFunc::Normal>
void drawRectangleRounded (const Rectangle &rectangle, unsigned int radius, const ColorR< T > &color, BlendFunc &blendFunc=BlendingFunc::Normal())
 Draw a rounded rectangle with a color. More...
 
template<typename BlendFunc = BlendingFunc::Normal>
void drawRectangleRounded (const Rectangle &rectangle, unsigned int radius, const ColorRGB< T > &color, BlendFunc &blendFunc=BlendingFunc::Normal())
 Draw a rounded rectangle with a color. More...
 
template<typename BlendFunc = BlendingFunc::Normal>
void drawRectangleRounded (const Rectangle &rectangle, unsigned int radius, const ColorRGBA< T > &color, BlendFunc &blendFunc=BlendingFunc::Normal())
 Draw a rounded rectangle with a color. More...
 
template<typename ColorFunc , typename BlendFunc = BlendingFunc::Normal>
void drawRectangleRoundedFunctor (const Rectangle &rectangle, unsigned int radius, ColorFunc &colorFunc, BlendFunc &blendFunc=BlendingFunc::Normal())
 Draw a rounded rectangle with a color Functor. More...
 
_Image< T > resample (const Math::Vec2< Size > &newSize, ResamplingMode resamplingMode=ResamplingMode::Nearest) const
 Resize the image with re sampling and return the new one. More...
 
template<typename ColorFunc , typename BlendFunc = BlendingFunc::Normal>
void drawPolygonFunctor (const Math::Vec2< float > *vertices, typename Vector< Math::Vec2< float >>::Size nbVertices, const Rectangle &rectangle, ColorFunc &colorFunc, BlendFunc &blendFunc=BlendingFunc::Normal())
 Draw a filed Polygon. More...
 
template<typename ColorFunc , typename BlendFunc >
void drawDiskFunctor (const Point &p, float radius, ColorR< T > &c, BlendFunc &blendFunc=BlendingFunc::Normal())
 Draw a filed Disk. More...
 
template<typename ColorFunc , typename BlendFunc >
void drawDiskFunctor (const Point &p, float radius, ColorRGB< T > &c, BlendFunc &blendFunc=BlendingFunc::Normal())
 Draw a filed Disk. More...
 
template<typename ColorFunc , typename BlendFunc >
void drawDiskFunctor (const Point &p, float radius, ColorRGBA< T > &c, BlendFunc &blendFunc=BlendingFunc::Normal())
 Draw a filed Disk. More...
 
template<typename ColorFunc , typename BlendFunc >
void drawDiskFunctor (const Point &p, float radius, ColorFunc &colorFunc, BlendFunc &blendFunc=BlendingFunc::Normal())
 Draw a filed Disk. More...
 
template<typename K >
computeGaussianKernel (K *kernel, size_t size, const float &sigma)
 compute the Vertical/Horizontal Gaussian Kernel (K : Type of Values in your Kernel ) More...
 
template<>
float getComponentMaxValue ()
 
template<>
double getComponentMaxValue ()
 
- Public Member Functions inherited from BasicSimpleIO
bool read (std::fstream *fileStream)
 read from a file stream More...
 
bool write (std::fstream *fileStream) const
 write this object as binary into a file stream More...
 

Static Public Member Functions

static T getComponentMaxValue ()
 get the maximum value of a color component More...
 
static T getComponentMinValue ()
 get the maximum value of a color component More...
 
template<typename K >
static K getKernelSumNbBits ()
 Get the number of bits of the sum of a kernel depending of the types used. More...
 
template<typename K , size_t N>
static K computeGaussianKernel (K(&kernel)[N], const float &sigma)
 compute the Vertical/Horizontal Gaussian Kernel (K : Type of Values in your Kernel, N : Size of your kernel (has to be odd)) More...
 
template<typename K , size_t N>
static K computeGaussianKernel (K(&kernel)[N])
 compute the Vertical/Horizontal Gaussian Kernel (K : Type of Values in your Kernel, N : Size of your kernel (has to be odd)) More...
 
static float computeGaussianKernel (float *kernel, size_t size, const float &sigma)
 
static double computeGaussianKernel (double *kernel, size_t size, const double &sigma)
 
template<typename K >
static K computeGaussianKernel (K *kernel, size_t size)
 compute the Vertical/Horizontal Gaussian Kernel (K : Type of Values in your Kernel ) More...
 
static float computeGaussianKernel (float *kernel, size_t size)
 
static double computeGaussianKernel (double *kernel, size_t size)
 

Detailed Description

template<typename T = unsigned char>
class Graphic::_Image< T >

Image Class T Type of one pixel F Format of the image.

Member Typedef Documentation

template<typename T = unsigned char>
typedef _ImageSumType<T>::Type Graphic::_Image< T >::SumType

Type used to sum multiple pixels components.

Member Enumeration Documentation

template<typename T = unsigned char>
enum Graphic::_Image::ConversionMode
strong
Enumerator
Luminance 
Trunquate 
Alpha 
template<typename T = unsigned char>
enum Graphic::_Image::ConvolutionMode
strong
Enumerator
NormalSize 
ExtendedSize 
template<typename T = unsigned char>
enum Graphic::_Image::ResamplingMode
strong
Enumerator
Nearest 
Linear 
Lanczos 
template<typename T = unsigned char>
enum Graphic::_Image::StrokeType
strong
Enumerator
Outside 
Inside 
Middle 

Constructor & Destructor Documentation

template<typename T >
template<typename C >
Graphic::_Image< T >::_Image ( const _Image< C > &  image)

copy constructor with an another storage type

Parameters
imageimage to copy
template<typename T >
Graphic::_Image< T >::_Image ( Format  format = Format::RGB)

Empty constructor, create an image unallocated of size (0:0)

Parameters
formatof the image
template<typename T >
Graphic::_Image< T >::_Image ( const Math::Vec2< Size > &  size,
Format  format = Format::RGB 
)

Constructor to create an initialized image of specified size.

Parameters
sizesize of the image to create.
formatof the image
template<typename T >
Graphic::_Image< T >::_Image ( std::fstream *  fileStream)

create a new image data from a file stream.

Parameters
fileStreamStream to read
formatof the image
template<typename T >
Graphic::_Image< T >::_Image ( const T *  data,
const Math::Vec2< Size > &  size,
LoadingFormat  loadingFormat = LoadingFormat::RGB,
bool  invertY = false,
size_t  stride = 0 
)

Constructor to create an image from a data buffer.

Parameters
dataData buffer to copy
sizesize of the new image
formatof the image
invertYif the image has to be flipped vertically or not.
stridewidth of ONE line of the image data in bytes, if stride == 0, the lines are supposed to be contiguous without any padding
template<typename T >
Graphic::_Image< T >::_Image ( const _Image< T > &  image)

copy constructor

template<typename T >
Graphic::_Image< T >::_Image ( _Image< T > &&  image)

move constructor

template<typename T >
Graphic::_Image< T >::~_Image ( )

Member Function Documentation

template<typename T >
template<typename F , int N>
_Image< T > Graphic::_Image< T >::applyFilter ( const F(&)  filter[N],
ConvolutionMode  convolutionMode = ConvolutionMode::ExtendedSize,
const ColorRGBA< T > &  color = ColorRGBA<T>::null 
) const

apply a symmetrical convolution filter (Gaussian blur for example)

Parameters
filterFilter table (the table has to have an odd size) (
See also
_Image<T>::SumType for an automatically generated Type)
Parameters
convolutionModeMode of the convolution (if the convolution will create a bigger image or crop it to keep the original size.)
colorColor of the background
Returns
Image with the filter applied
template<typename T >
template<typename F >
_Image< T > Graphic::_Image< T >::applyFilter ( const F *  filter,
size_t  size,
ConvolutionMode  convolutionMode = ConvolutionMode::ExtendedSize,
const ColorRGBA< T > &  color = ColorRGBA<T>::null 
) const

apply a symmetrical convolution filter (Gaussian blur for example)

Parameters
filterFilter table (the table has to have an odd size) (
See also
_Image<T>::SumType for an automatically generated Type)
Parameters
convolutionModeMode of the convolution (if the convolution will create a bigger image or crop it to keep the original size.)
colorColor of the background
Returns
Image with the filter applied
template<typename T >
_Image< T > Graphic::_Image< T >::applyGaussianBlur ( size_t  radius,
ConvolutionMode  convolutionMode = ConvolutionMode::ExtendedSize,
const ColorRGBA< T > &  color = ColorRGBA<T>::null 
) const

apply a Gaussian Blur Filter

Parameters
radiusRadius of the blur
convolutionModeMode of the convolution (if the convolution will create a bigger image or crop it to keep the original size.)
colorColor of the background
Returns
Image with the filter applied
template<typename T >
Math::Rectangle< Size > Graphic::_Image< T >::clampRectangle ( const Rectangle rectangle) const
inline

Clamp a rectangle inside the image.

Parameters
rectanglerectangle to be clamped
Returns
an unsigned rectangle clamped inside the image
template<typename T >
void Graphic::_Image< T >::clear ( const Math::Vec2< Size > &  size)

reset this image with a new size.

Parameters
sizenew size
template<typename T >
void Graphic::_Image< T >::clear ( const Math::Vec2< Size > &  size,
Format  format 
)

reset this image with a new size and a new format

Parameters
sizenew size
formatnew format of the image
template<typename T >
template<typename K , size_t N>
K Graphic::_Image< T >::computeGaussianKernel ( K(&)  kernel[N],
const float &  sigma 
)
static

compute the Vertical/Horizontal Gaussian Kernel (K : Type of Values in your Kernel, N : Size of your kernel (has to be odd))

Parameters
kerneltable to be filled (has to be already allocated)
sigmaSigma used during the computation
Returns
The weight computed
template<typename T >
template<typename K , size_t N>
K Graphic::_Image< T >::computeGaussianKernel ( K(&)  kernel[N])
static

compute the Vertical/Horizontal Gaussian Kernel (K : Type of Values in your Kernel, N : Size of your kernel (has to be odd))

Parameters
kerneltable to be filled (has to be already allocated)
Returns
The weight computed
template<typename T >
template<typename K >
K Graphic::_Image< T >::computeGaussianKernel ( K *  kernel,
size_t  size,
const float &  sigma 
)

compute the Vertical/Horizontal Gaussian Kernel (K : Type of Values in your Kernel )

Parameters
kerneltable to be filled (has to be already allocated)
size(Radius * 2 + 1) of the kernel (must be odd)
sigmaSigma used during the computation
Returns
The weight computed
template<typename T >
float Graphic::_Image< T >::computeGaussianKernel ( float *  kernel,
size_t  size,
const float &  sigma 
)
static
template<typename T >
double Graphic::_Image< T >::computeGaussianKernel ( double *  kernel,
size_t  size,
const double &  sigma 
)
static
template<typename T >
template<typename K >
K Graphic::_Image< T >::computeGaussianKernel ( K *  kernel,
size_t  size 
)
static

compute the Vertical/Horizontal Gaussian Kernel (K : Type of Values in your Kernel )

Parameters
kerneltable to be filled (has to be already allocated)
size(Radius * 2 + 1) of the kernel (must be odd)
Returns
The weight computed
template<typename T >
float Graphic::_Image< T >::computeGaussianKernel ( float *  kernel,
size_t  size 
)
static
template<typename T >
double Graphic::_Image< T >::computeGaussianKernel ( double *  kernel,
size_t  size 
)
static
template<typename T >
template<typename C , typename InterFunc >
size_t Graphic::_Image< T >::computeInterpolation ( const GradientHorizontal< C, InterFunc > &  gradient,
C **  buffer,
const Rectangle rectangle,
Math::Rectangle< Size > *  clampedRectangle 
) const

Compute the interpolation for horizontal gradient.

Parameters
outbuffer Pointer to a buffer that will be allocated (will be deletable with delete [])
inrectangle used to specify the size of the gradient
outclampedRectangle Rectangle clamped inside this image return size of the freshly allocated buffer
template<typename T >
template<typename C , typename InterFunc >
size_t Graphic::_Image< T >::computeInterpolation ( const GradientVertical< C, InterFunc > &  gradient,
C **  buffer,
const Rectangle rectangle,
Math::Rectangle< Size > *  clampedRectangle 
) const

Compute the interpolation for vertical gradient.

Parameters
outbuffer Pointer to a buffer that will be allocated (will be deletable with delete [])
inrectangle used to specify the size of the gradient
outclampedRectangle Rectangle clamped inside this image return size of the freshly allocated buffer
template<typename T >
template<typename C , typename InterFunc >
size_t Graphic::_Image< T >::computeInterpolation ( const GradientLinear< C, InterFunc > &  gradient,
C **  buffer,
const Rectangle rectangle,
Math::Rectangle< Size > *  clampedRectangle 
) const

Compute the interpolation for Linear gradient.

Parameters
outbuffer Pointer to a buffer that will be allocated (will be deletable with delete [])
inrectangle used to specify the size of the gradient
outclampedRectangle Rectangle clamped inside this image return size of the freshly allocated buffer
template<typename T >
template<typename C , typename InterFunc >
size_t Graphic::_Image< T >::computeInterpolation ( const GradientRadial< C, InterFunc > &  gradient,
C **  buffer,
const Rectangle rectangle,
Math::Rectangle< Size > *  clampedRectangle 
) const

Compute the interpolation for Radial gradient.

Parameters
outbuffer Pointer to a buffer that will be allocated (will be deletable with delete [])
inrectangle used to specify the size of the gradient
outclampedRectangle Rectangle clamped inside this image return size of the freshly allocated buffer
template<typename T >
_Image< T > * Graphic::_Image< T >::createMipmap ( )

create a new image from this one with a size of width / 2 and height / 2

Returns
new image created from this one with an halved size.
template<typename T >
template<typename BlendFunc >
void Graphic::_Image< T >::drawBezierCurve ( const PointF p0,
const PointF p1,
const PointF  p2,
const PointF p3,
unsigned int  thickness,
ColorR< T > &  color,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

Draw a Cubic Bezier curve.

drawBezierCurve

Parameters
p0Point 0
p1Point 1
p2Point 2
p3Point 3
thicknessThickness of the curve
colorColor to be used
blendFuncFunctor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorR<T> & colorSrc, T alpha)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorR<T> & colorSrc, T alpha)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorR<T> & colorSrc, T alpha)const;" "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;"
template<typename T >
template<typename BlendFunc >
void Graphic::_Image< T >::drawBezierCurve ( const PointF p0,
const PointF p1,
const PointF  p2,
const PointF p3,
unsigned int  thickness,
ColorRGB< T > &  color,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)
template<typename T >
template<typename BlendFunc >
void Graphic::_Image< T >::drawBezierCurve ( const PointF p0,
const PointF p1,
const PointF  p2,
const PointF p3,
unsigned int  thickness,
ColorRGBA< T > &  color,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)
template<typename T >
template<typename ColorFunc , typename BlendFunc >
void Graphic::_Image< T >::drawDiskFunctor ( const Point p,
float  radius,
ColorR< T > &  c,
BlendFunc &  blendFunc = BlendingFunc::Normal() 
)

Draw a filed Disk.

Parameters
pCenter point of the disk
radiusRadius of the circle in pixels
cColor used to fill the disk
blendFuncBlending Functor to be used with operator() overloaded with : "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const ColorR<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const ColorR<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const ColorR<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const ColorR<T> & colorSrc)const;"
template<typename T >
template<typename ColorFunc , typename BlendFunc >
void Graphic::_Image< T >::drawDiskFunctor ( const Point p,
float  radius,
ColorRGB< T > &  c,
BlendFunc &  blendFunc = BlendingFunc::Normal() 
)

Draw a filed Disk.

Parameters
pCenter point of the disk
radiusRadius of the circle in pixels
cColor used to fill the disk
blendFuncBlending Functor to be used with operator() overloaded with : "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const ColorRGB<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const ColorRGB<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const ColorRGB<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const ColorRGB<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const ColorRGB<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const ColorRGB<T> & colorSrc)const;"
template<typename T >
template<typename ColorFunc , typename BlendFunc >
void Graphic::_Image< T >::drawDiskFunctor ( const Point p,
float  radius,
ColorRGBA< T > &  c,
BlendFunc &  blendFunc = BlendingFunc::Normal() 
)

Draw a filed Disk.

Parameters
pCenter point of the disk
radiusRadius of the circle in pixels
cColor used to fill the disk
blendFuncBlending Functor to be used with operator() overloaded with : "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const ColorRGBA<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const ColorRGBA<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const ColorRGBA<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const ColorRGBA<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const ColorRGBA<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const ColorRGBA<T> & colorSrc)const;"
template<typename T >
template<typename ColorFunc , typename BlendFunc >
void Graphic::_Image< T >::drawDiskFunctor ( const Point p,
float  radius,
ColorFunc &  colorFunc,
BlendFunc &  blendFunc = BlendingFunc::Normal() 
)

Draw a filed Disk.

Parameters
pCenter point of the disk
radiusRadius of the circle in pixels
colorFuncColor Functor to be used (
See also
Graphic::ColorFunc::SimpleColor for a solid color) (
Graphic::ColorFunc::Template for making your own)
Parameters
blendFuncBlending Functor to be used with operator() overloaded with : "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const C & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const C & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const C & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const C & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const C & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const C & colorSrc)const;"
template<typename T >
template<typename ColorFunc , typename BlendFunc >
void Graphic::_Image< T >::drawGraphValuesFunctor ( const Vector< Math::Vec2< float >> &  values,
const Rectangle rectangle,
ColorFunc &  colorFunc,
BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

draw points (x,y) as a graph inside a rectangle

Parameters
valuesVector of floating points (points has to be between 0.0 and 1.0) (the points has to be ascending ordered using their x coordinate)
rectangleRectangle where to draw the graph
colorFuncColor Functor used to draw
blendFuncBlending Functor used to draw
template<typename T >
void Graphic::_Image< T >::drawImage ( const Point point,
const _Image< T > &  image 
)

draw an another image into this one

Parameters
pointPosition where to draw.
imageAnother image to draw
template<typename T >
void Graphic::_Image< T >::drawImage ( const Point point,
const Rectangle rectangle,
const _Image< T > &  image 
)

draw an another image into this one

Parameters
pointPosition where to draw.
rectanglerectangle of the second image to draw. (The rectangle HAS TO BE smaller or equal of the given image)
imageAnother image to draw
template<typename T >
template<typename BlendFunc >
void Graphic::_Image< T >::drawImage ( const Point point,
const Rectangle rectangle,
const _Image< T > &  image,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

draw an another image into this one with a custom blending function

Parameters
pointPosition where to draw.
rectanglerectangle of the second image to draw. (The rectangle HAS TO BE smaller or equal of the given image)
imageAnother image to draw
blendFuncFunctor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc)const;"

"template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc)const;"

"template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc)const;"

template<typename T >
template<typename BlendFunc >
void Graphic::_Image< T >::drawImage ( const Point point,
const ColorR< T > &  color,
const _Image< T > &  maskImage,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

draw a color to this image using a mask

Parameters
pointPosition where to draw.
colorColor to draw
maskImagemask to use (only the first component will be used to determine the luminance)
blendFuncFunctor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;"
template<typename T >
template<typename BlendFunc >
void Graphic::_Image< T >::drawImage ( const Point point,
const ColorRGB< T > &  color,
const _Image< T > &  maskImage,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

draw a color to this image using a mask

Parameters
pointPosition where to draw.
colorColor to draw
maskImagemask to use (only the first component will be used to determine the luminance)
blendFuncFunctor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;"
template<typename T >
template<typename BlendFunc >
void Graphic::_Image< T >::drawImage ( const Point point,
const ColorRGBA< T > &  color,
const _Image< T > &  maskImage,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

draw a color to this image using a mask

Parameters
pointPosition where to draw.
colorColor to draw
maskImagemask to use (only the first component will be used to determine the luminance)
blendFuncFunctor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;"
template<typename T >
template<typename BlendFunc >
void Graphic::_Image< T >::drawImage ( const Point point,
const ColorR< T > &  color,
const Rectangle rectangle,
const _Image< T > &  maskImage,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

draw a color to this image using a mask and a rectangle to know the part of the mask to use.

Parameters
pointPosition where to draw.
colorColor to draw
rectangleRectangle of the maskImage to draw. (the rectangle has to be positive and smaller than the size of the maskImage)
maskImagemask to use (only the first component will be used to determine the luminance)
blendFuncFunctor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;"
template<typename T >
template<typename BlendFunc >
void Graphic::_Image< T >::drawImage ( const Point point,
const ColorRGB< T > &  color,
const Rectangle rectangle,
const _Image< T > &  maskImage,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

draw a color to this image using a mask and a rectangle to know the part of the mask to use.

Parameters
pointPosition where to draw.
colorColor to draw
rectangleRectangle of the maskImage to draw. (the rectangle has to be positive and smaller than the size of the maskImage)
maskImagemask to use (only the first component will be used to determine the luminance)
blendFuncFunctor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;"
template<typename T >
template<typename BlendFunc >
void Graphic::_Image< T >::drawImage ( const Point point,
const ColorRGBA< T > &  color,
const Rectangle rectangle,
const _Image< T > &  maskImage,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

draw a color to this image using a mask and a rectangle to know the part of the mask to use.

Parameters
pointPosition where to draw.
colorColor to draw
rectangleRectangle of the maskImage to draw. (the rectangle has to be positive and smaller than the size of the maskImage)
maskImagemask to use (only the first component will be used to determine the luminance)
blendFuncFunctor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;"
template<typename T >
void Graphic::_Image< T >::drawImage ( const Point point,
const _Image< T > &  image,
const _Image< T > &  maskImage 
)

draw an another image into this one with a mask image

Parameters
pointPosition where to draw.
imageAnother image to draw.
maskImagemask to use (only the first component will be used to determine the luminance)
template<typename T >
void Graphic::_Image< T >::drawImage ( const Point point,
const _Image< T > &  image,
const Point maskPoint,
const _Image< T > &  maskImage 
)

draw an another image into this one with a mask image

Parameters
pointPosition where to draw.
imageAnother image to draw.
maskPointPoint inside the mask to use.
maskImagemask to use (only the first component will be used to determine the luminance)
template<typename T >
template<typename BlendFunc >
void Graphic::_Image< T >::drawImage ( const Point point,
const Rectangle rectangle,
const _Image< T > &  image,
const Point maskPoint,
const _Image< T > &  maskImage,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

draw an another image into this one with a mask image

Parameters
pointPosition where to draw.
rectanglerectangle of the second image to draw. (The rectangle HAS TO BE smaller or equal of the given image)
imageAnother image to draw.
maskPointPoint inside the mask to use.
maskImagemask to use (only the first component will be used to determine the luminance)
blendFuncFunctor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;"

"template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;"

"template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;"

template<typename T >
template<typename ColorFunc , typename BlendFunc >
void Graphic::_Image< T >::drawImageFunctor ( const Point point,
ColorFunc &  colorFunc,
const Rectangle rectangle,
const _Image< T > &  maskImage,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

draw a color to this image using a mask and a rectangle to know the part of the mask to use.

Parameters
pointPosition where to draw.
colorFuncfunctor that will generate the color for each pixels (see Graphic::ColorFunc::Template), width the methods : "inline void init(const Rectangle & rectangle);" "inline const C & operator()(const Math::Vec2<Size> & p) const;"
rectangleRectangle of the maskImage to draw. (the rectangle has to be positive and smaller than the size of the maskImage)
maskImagemask to use (only the first component will be used to determine the luminance)
blendFuncFunctor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorR<T> & colorSrc, const Graphic::ColorR<T> & colorMask)const;"
template<typename T >
template<typename BlendFunc >
void Graphic::_Image< T >::drawLine ( const LineF l,
const ColorR< T > &  color,
unsigned int  thickness = 1,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

draw an anti aliased line from point p1 to point p2

See also
https://en.wikipedia.org/wiki/Xiaolin_Wu's_line_algorithm
Parameters
lLine
colorColor to draw
blendFuncFunctor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorR<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorR<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorR<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;"
template<typename T >
template<typename BlendFunc >
void Graphic::_Image< T >::drawLine ( const LineF l,
const ColorRGB< T > &  color,
unsigned int  thickness = 1,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

draw an anti aliased line from point p1 to point p2

See also
https://en.wikipedia.org/wiki/Xiaolin_Wu's_line_algorithm
Parameters
lLine
colorColor to draw
blendFuncFunctor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc)const;"
template<typename T >
template<typename BlendFunc >
void Graphic::_Image< T >::drawLine ( const LineF l,
const ColorRGBA< T > &  color,
unsigned int  thickness = 1,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

draw an anti aliased line from point p1 to point p2

See also
https://en.wikipedia.org/wiki/Xiaolin_Wu's_line_algorithm
Parameters
lLine
colorColor to draw
blendFuncFunctor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorR<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorR<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorR<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc)const;"
template<typename T >
template<typename ColorFunc , typename BlendFunc >
void Graphic::_Image< T >::drawLineFunctor ( const LineF l,
ColorFunc &  colorFunc,
unsigned int  thickness = 1,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

draw an anti aliased line from point p1 to point p2

See also
https://en.wikipedia.org/wiki/Xiaolin_Wu's_line_algorithm
Parameters
lLine
colorFuncfunctor that will generate the color for each pixels (see Graphic::ColorFunc::Template), width the methods : "inline void init(const Rectangle & rectangle);" "inline const C & operator()(const Math::Vec2<Size> & p) const;"
blendFuncFunctor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorR<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorR<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorR<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;"
template<typename T >
template<typename ColorFunc , typename BlendFunc >
void Graphic::_Image< T >::drawPolygonFunctor ( const Math::Vec2< float > *  vertices,
typename Vector< Math::Vec2< float >>::Size  nbVertices,
const Rectangle rectangle,
ColorFunc &  colorFunc,
BlendFunc &  blendFunc = BlendingFunc::Normal() 
)

Draw a filed Polygon.

Parameters
verticestable of vertices to be drawn (vertices have to be between 0.0 and 1.0)
nbVerticesNumber of vertices to draw
rectangleRectangle of the image where to draw the polygon
colorFuncColor Functor to be used (
See also
Graphic::ColorFunc::SimpleColor for a solid color) (
Graphic::ColorFunc::Template for making your own)
Parameters
blendFuncBlending Functor to be used with operator() overloaded with : "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const C & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const C & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const C & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const C & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const C & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const C & colorSrc)const;"
template<typename T >
template<typename BlendFunc >
void Graphic::_Image< T >::drawRectangle ( const Rectangle rectangle,
const ColorR< T > &  color,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

draw a rectangle inside this image.

Parameters
rectangleRectangle representing the pixels to draw. (the rectangle is clamped inside the image)
colorColor to draw.
blendFuncFunctor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;"
template<typename T >
template<typename BlendFunc >
void Graphic::_Image< T >::drawRectangle ( const Rectangle rectangle,
const ColorRGB< T > &  color,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

draw a rectangle inside this image.

Parameters
rectangleRectangle representing the pixels to draw. (the rectangle is clamped inside the image)
colorColor to draw.
blendFuncFunctor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;"
template<typename T >
template<typename BlendFunc >
void Graphic::_Image< T >::drawRectangle ( const Rectangle rectangle,
const ColorRGBA< T > &  color,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

draw a rectangle inside this image.

Parameters
rectangleRectangle representing the pixels to draw. (the rectangle is clamped inside the image)
colorColor to draw.
blendFuncBlending functor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;"
template<typename T >
template<typename C , typename InterFunc >
void Graphic::_Image< T >::drawRectangle ( const Rectangle rectangle,
const GradientHorizontal< C, InterFunc > &  gradient 
)

draw a rectangle inside this image.

Parameters
rectangleRectangle representing the pixels to draw. (the rectangle is clamped inside the image)
gradientGradient to draw.
template<typename T >
template<typename C , typename InterFunc , typename BlendFunc >
void Graphic::_Image< T >::drawRectangle ( const Rectangle rectangle,
const GradientLinear< C, InterFunc > &  gradient,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

draw a rectangle inside this image.

Parameters
rectangleRectangle representing the pixels to draw. (the rectangle is clamped inside the image)
gradientGradient to draw.
blendFuncBlending functor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const C & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const C & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const C & colorSrc)const;"
template<typename T >
template<typename C , typename InterFunc , typename BlendFunc >
void Graphic::_Image< T >::drawRectangle ( const Rectangle rectangle,
const GradientRadial< C, InterFunc > &  gradient,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

draw a rectangle inside this image.

Parameters
rectangleRectangle representing the pixels to draw. (the rectangle is clamped inside the image)
gradientGradient to draw.
blendFuncBlending functor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const C & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const C & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const C & colorSrc)const;"
template<typename T >
template<typename C , typename InterFunc , typename BlendFunc >
void Graphic::_Image< T >::drawRectangle ( const Rectangle rectangle,
const GradientHorizontal< C, InterFunc > &  gradient,
const BlendFunc &  blendFunc 
)

draw a rectangle inside this image.

Parameters
rectangleRectangle representing the pixels to draw. (the rectangle is clamped inside the image)
gradientGradient to draw.
blendFuncFunctor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const C & colorSrcc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const C & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const C & colorSrc)const;"
template<typename T >
template<typename C , typename InterFunc , typename BlendFunc >
void Graphic::_Image< T >::drawRectangle ( const Rectangle rectangle,
const GradientVertical< C, InterFunc > &  gradient,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

draw a rectangle inside this image.

Parameters
rectangleRectangle representing the pixels to draw. (the rectangle is clamped inside the image)
gradientGradient to draw.
blendFuncFunctor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const C & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const C & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const C & colorSrc)const;"
template<typename T >
template<typename ColorFunc , typename BlendFunc >
void Graphic::_Image< T >::drawRectangleFunctor ( const Rectangle rectangle,
ColorFunc &  colorFunc,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

draw a rectangle inside this image.

Parameters
rectangleRectangle representing the pixels to draw. (the rectangle is clamped inside the image)
colorFuncfunctor that will generate the color for each pixels (see Graphic::ColorFunc::Template), width the methods : "inline void init(const Rectangle & rectangle);" "inline const C & operator()(const Math::Vec2<Size> & p) const;"
blendFuncFunctor with the methods : "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;"
template<typename T >
template<typename BlendFunc >
void Graphic::_Image< T >::drawRectangleRounded ( const Rectangle rectangle,
unsigned int  radius,
const ColorR< T > &  color,
BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

Draw a rounded rectangle with a color.

Parameters
rectangleRectangle to be drawn
radiusRadius of the rounded angles
colorColor
blendFuncFunctor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorR<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorR<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorR<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorR<T> & colorSrc)const;"
template<typename T >
template<typename BlendFunc >
void Graphic::_Image< T >::drawRectangleRounded ( const Rectangle rectangle,
unsigned int  radius,
const ColorRGB< T > &  color,
BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

Draw a rounded rectangle with a color.

Parameters
rectangleRectangle to be drawn
radiusRadius of the rounded angles
colorColor
blendFuncFunctor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorRGB<T> & colorSrc)const;"
template<typename T >
template<typename BlendFunc >
void Graphic::_Image< T >::drawRectangleRounded ( const Rectangle rectangle,
unsigned int  radius,
const ColorRGBA< T > &  color,
BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

Draw a rounded rectangle with a color.

Parameters
rectangleRectangle to be drawn
radiusRadius of the rounded angles
colorColor
blendFuncFunctor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const Graphic::ColorRGBA<T> & colorSrc)const;"
template<typename T >
template<typename ColorFunc , typename BlendFunc >
void Graphic::_Image< T >::drawRectangleRoundedFunctor ( const Rectangle rectangle,
unsigned int  radius,
ColorFunc &  colorFunc,
BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

Draw a rounded rectangle with a color Functor.

Parameters
rectangleRectangle to be drawn
radiusRadius of the rounded angles
colorFuncColor Functor
blendFuncFunctor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const C & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const C & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const C & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const C & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const C & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const C & colorSrc)const;"
template<typename T >
template<typename BlendFunc >
void Graphic::_Image< T >::drawStroke ( const Point point,
const _Image< T > &  image,
unsigned int  thickness,
const ColorR< T > &  color,
StrokeType  strokeType = StrokeType::Middle,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

Stroke the image with a specified color.

Parameters
pointPoint where to draw the stroking
imageImage used to compute the stroking (R & RGB will use the r channel and RGBA the a channel)
thicknessThickness of the stroking
colorcolor to be used
strokeTypeType of the stroking (Outside, Inside or Middle)
blendFuncFunctor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const ColorR<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const ColorR<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const ColorR<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const ColorR<T> & colorSrc)const;"
template<typename T >
template<typename BlendFunc >
void Graphic::_Image< T >::drawStroke ( const Point point,
const _Image< T > &  image,
unsigned int  thickness,
const ColorRGB< T > &  color,
StrokeType  strokeType = StrokeType::Middle,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

Stroke the image with a specified color.

Parameters
pointPoint where to draw the stroking
imageImage used to compute the stroking (R & RGB will use the r channel and RGBA the a channel)
thicknessThickness of the stroking
colorcolor to be used
strokeTypeType of the stroking (Outside, Inside or Middle)
blendFuncFunctor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const ColorR<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const ColorR<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const ColorR<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const ColorR<T> & colorSrc)const;"
template<typename T >
template<typename BlendFunc >
void Graphic::_Image< T >::drawStroke ( const Point point,
const _Image< T > &  image,
unsigned int  thickness,
const ColorRGBA< T > &  color,
StrokeType  strokeType = StrokeType::Middle,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

Stroke the image with a specified color.

Parameters
pointPoint where to draw the stroking
imageImage used to compute the stroking (R & RGB will use the r channel and RGBA the a channel)
thicknessThickness of the stroking
colorcolor to be used
strokeTypeType of the stroking (Outside, Inside or Middle)
blendFuncFunctor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const ColorR<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const ColorR<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const ColorR<T> & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const ColorR<T> & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const ColorR<T> & colorSrc)const;"
template<typename T >
template<typename ColorFunc , typename BlendFunc >
void Graphic::_Image< T >::drawStrokeFunctor ( const Point point,
const _Image< T > &  image,
unsigned int  thickness,
ColorFunc &  colorFunc,
StrokeType  strokeType = StrokeType::Middle,
const BlendFunc &  blendFunc = BlendingFunc::Normal( ) 
)

Stroke the image with a specified color functor.

Parameters
pointPoint where to draw the stroking
imageImage used to compute the stroking (R & RGB will use the r channel and RGBA the a channel)
thicknessThickness of the stroking
colorFuncfunctor that will generate the color for each pixels, width the methods : "inline void init(const Rectangle & rectangle);" "inline const C & operator()(const Math::Vec2<Size> & p) const;"
strokeTypeType of the stroking (Outside, Inside or Middle)
blendFuncFunctor with operator() overloaded with "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const C & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const C & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const C & colorSrc, float alpha)const;" "template<typename T> void operator()(Graphic::ColorR<T> & colorDest, const C & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGB<T> & colorDest, const C & colorSrc)const;" "template<typename T> void operator()(Graphic::ColorRGBA<T> & colorDest, const C & colorSrc)const;"
template<typename T >
void Graphic::_Image< T >::fillImage ( const T *  color)

fill the complete image with a color. param color pointer to a color with the same number of component of this image

template<typename T >
void Graphic::_Image< T >::fillImage ( const T *  color,
const Rectangle rectangle 
)

fill the complete image with a color.

Parameters
colorpointer to a color with the same number of component of this image
rectangleRectangle where to fill the color
template<typename T >
void Graphic::_Image< T >::fillImage ( const ColorR< T > &  color)

fill the complete image with a color.

Parameters
colorR color
template<typename T >
void Graphic::_Image< T >::fillImage ( const ColorRGB< T > &  color)

fill the complete image with a color.

Parameters
colorRGB color
template<typename T >
void Graphic::_Image< T >::fillImage ( const ColorRGBA< T > &  color)

fill the complete image with a color.

Parameters
colorRGBA color
template<typename T >
void Graphic::_Image< T >::fillImage ( const ColorR< T > &  color,
const Rectangle rectangle 
)

fill the complete image with a color.

Parameters
colorR color
rectangleRectangle where to fill the color
template<typename T >
void Graphic::_Image< T >::fillImage ( const ColorRGB< T > &  color,
const Rectangle rectangle 
)

fill the complete image with a color.

Parameters
colorRGB color
rectangleRectangle where to fill the color
template<typename T >
void Graphic::_Image< T >::fillImage ( const ColorRGBA< T > &  color,
const Rectangle rectangle 
)

fill the complete image with a color.

Parameters
colorRGBA color
rectangleRectangle where to fill the color
template<typename T >
template<typename C , typename InterFunc >
void Graphic::_Image< T >::fillImage ( const GradientHorizontal< C, InterFunc > &  gradient,
const Rectangle rectangle 
)

fill the complete image with a horizontal gradient.

Parameters
gradientGradient
rectangleRectangle where to fill the gradient
template<typename T >
template<typename C , typename InterFunc >
void Graphic::_Image< T >::fillImage ( const GradientVertical< C, InterFunc > &  gradient,
const Rectangle rectangle 
)

fill the complete image with a vertical gradient.

Parameters
gradientGradient
rectangleRectangle where to fill the gradient
template<typename T >
template<typename C , typename InterFunc >
void Graphic::_Image< T >::fillImage ( const GradientLinear< C, InterFunc > &  gradient,
const Rectangle rectangle 
)

fill the complete image with a Linear gradient.

Parameters
gradientGradient
rectangleRectangle where to fill the gradient
template<typename T >
template<typename C , typename InterFunc >
void Graphic::_Image< T >::fillImage ( const GradientRadial< C, InterFunc > &  gradient,
const Rectangle rectangle 
)

fill the complete image with a Radial gradient.

Parameters
gradientGradient
rectangleRectangle where to fill the gradient
template<typename T >
void Graphic::_Image< T >::fillImage ( const Point point,
const _Image< T > &  image 
)

fill an another image into this one (no blending will be applied)

Parameters
pointPosition where to draw.
rectanglerectangle of the second image to draw. (The rectangle HAS TO BE smaller or equal of the given image)
imageAnother image to draw
template<typename T >
void Graphic::_Image< T >::fillImage ( const Point point,
const Rectangle rectangle,
const _Image< T > &  image 
)

fill an another image into this one (no blending will be applied)

Parameters
pointPosition where to draw.
rectanglerectangle of the second image to draw. (The rectangle HAS TO BE smaller or equal of the given image)
imageAnother image to draw
template<typename T >
T Graphic::_Image< T >::getComponentMaxValue ( )
inlinestatic

get the maximum value of a color component

Parameters
maximumvalue of a component depending of the template type T
template<>
float Graphic::_Image< float >::getComponentMaxValue ( )
template<>
double Graphic::_Image< double >::getComponentMaxValue ( )
template<typename T >
T Graphic::_Image< T >::getComponentMinValue ( )
inlinestatic

get the maximum value of a color component

Parameters
maximumvalue of a component depending of the template type T
template<typename T >
size_t Graphic::_Image< T >::getDataOffset ( Size  x,
Size  y 
) const

get the offset of pixel from the beginning of the data

Parameters
xX coordinate
yY coordinate
Returns
offset to be added to go from the begining of the data (getData()) and the selected pixel
template<typename T >
const T * Graphic::_Image< T >::getDatas ( ) const

get the data buffer of this image

Returns
data buffer
template<typename T >
T * Graphic::_Image< T >::getDatas ( )

get the data buffer of this image

Returns
data buffer
template<typename T >
const T * Graphic::_Image< T >::getDatas ( Size  x,
Size  y 
) const

get the data buffer of this image starting with the selected pixel

Returns
data buffer
template<typename T >
T * Graphic::_Image< T >::getDatas ( Size  x,
Size  y 
)

get the data buffer of this image starting with the selected pixel

Returns
data buffer
template<typename T >
Format Graphic::_Image< T >::getFormat ( ) const

get the format of this image

Returns
format of this image
template<typename T >
Size Graphic::_Image< T >::getHeight ( ) const

get the actual height of the image

Returns
actual height of this image
template<typename T >
template<typename K >
K Graphic::_Image< T >::getKernelSumNbBits ( )
inlinestatic

Get the number of bits of the sum of a kernel depending of the types used.

Returns
number of bits of the sum of a integer kernel (floating kernel will every time has a sum of 1.0)
template<typename T >
unsigned int Graphic::_Image< T >::getNbComponents ( ) const
inline

get the number of components per pixels of this image.

Returns
Number of components per pixels.
template<typename T >
size_t Graphic::_Image< T >::getNbPixels ( ) const

get the number of pixels of this image

Returns
number of pixels
template<typename T >
const T * Graphic::_Image< T >::getPixel ( Size  x,
Size  y 
) const

get a pixel from this image

Parameters
xx coordinate of the pixel
yy coordinate of the pixel
Returns
the pixel from the picture at the specified 2D coordinate.
template<typename T >
T * Graphic::_Image< T >::getPixel ( Size  x,
Size  y 
)

get a pixel from this image

Parameters
xx coordinate of the pixel
yy coordinate of the pixel
Returns
the pixel from the picture at the specified 2D coordinate.
template<typename T >
const Math::Vec2< Size > & Graphic::_Image< T >::getSize ( ) const

get the actual size (width:height) of the image

Returns
the actual size of this image
template<typename T >
Size Graphic::_Image< T >::getWidth ( ) const

get the actual width of the image

Returns
actual width of this image
template<typename T >
template<typename C >
_Image< T > & Graphic::_Image< T >::operator= ( const _Image< C > &  image)

copy operator with another type

Parameters
imageImage to copy
template<typename T >
_Image< T > & Graphic::_Image< T >::operator= ( const _Image< T > &  image)

copy operator

Parameters
imageImage to copy
template<typename T >
_Image< T > & Graphic::_Image< T >::operator= ( _Image< T > &&  image)

move operator

Parameters
imageImage to move from
template<typename T >
bool Graphic::_Image< T >::read ( std::fstream *  fileStream)

read from a file stream

Parameters
fileStreamstream used to read load this object
Returns
boolean to know if the operation is a success of not.
template<typename T >
_Image< T > Graphic::_Image< T >::resample ( const Math::Vec2< Size > &  newSize,
ResamplingMode  resamplingMode = ResamplingMode::Nearest 
) const

Resize the image with re sampling and return the new one.

Parameters
newSizesize of the resulting image
resamplingModeMode used to compute the resulting pixels Nearest : Faster algorithm available, use the nearest pixel without any transformation. Linear : Do a linear interpolation to compute the resulting pixels. Lanczos : Use the Lanczos algorithm (
See also
https://en.wikipedia.org/wiki/Lanczos_resampling) with a constant of 3 (Note : only available for strict reduction, linear will be used instead)
template<typename T >
void Graphic::_Image< T >::setDatas ( const T *  data,
const Math::Vec2< Size > &  size,
LoadingFormat  loadingFormat = LoadingFormat::RGB,
bool  invertY = false,
size_t  stride = 0 
)

set the data from an another data buffer.

Parameters
dataData buffer to copy
sizesize of the new image
invertYif the image has to be flipped vertically or not.
stridewidth of ONE line of the image data in bytes, if stride == 0, the lines are supposed to be contiguous without any padding
template<typename T >
void Graphic::_Image< T >::setPixel ( Size  x,
Size  y,
const T *  p 
)

set a pixel inside this image

Parameters
xx coordinate of the pixel
yy coordinate of the pixel
pThe pixel to set.
template<typename T >
template<typename Functor >
void Graphic::_Image< T >::setPixels ( Functor &  functor,
const Rectangle rectangle 
)

Set a functor to each pixels in the rectangle of this image.

Parameters
functorFunctor with the methods : "inline void operator()(const Math::Vec2<Size> & p, Graphic::ColorR<T> & c);" "inline void operator()(const Math::Vec2<Size> & p, Graphic::ColorRGB<T> & c);" "inline void operator()(const Math::Vec2<Size> & p, Graphic::ColorRGBA<T> & c);"
rectangleRectangle where to apply the functor.
template<typename T >
template<typename Functor >
void Graphic::_Image< T >::setPixels ( Functor &  functor)

Set a functor to each pixels of this image.

Parameters
functorFunctor with operator() overloaded with "template<typename T> void operator()(const Math::Vec2<Size> & p, Graphic::ColorR<T> & c);" "template<typename T> void operator()(const Math::Vec2<Size> & p, Graphic::ColorRGB<T> & c);" "template<typename T> void operator()(const Math::Vec2<Size> & p, Graphic::ColorRGBA<T> & c);"
template<typename T >
template<typename ThreshFunc >
void Graphic::_Image< T >::threshold ( const ColorRGBA< T > &  colorTrue,
const ColorRGBA< T > &  colorFalse,
const ThreshFunc &  threshFunc 
)

Threshold the image with a specified functor.

Parameters
colorTruecolor applied in case of True (color is not blended, only copied)
colorFalsecolor applied in case of False (color is not blended, only copied)
functorFunctor with operator() overloaded with "template<typename T> inline bool operator()(Graphic::ColorR<T> & color)const;" "template<typename T> inline bool operator()(Graphic::ColorRGB<T> & color)const;" "template<typename T> inline bool operator()(Graphic::ColorRGBA<T> & color)const;"
template<typename T >
void Graphic::_Image< T >::threshold ( const ColorRGBA< T > &  colorOver,
const ColorRGBA< T > &  colorUnder,
const ColorRGBA< T > &  limit 
)

Threshold the image with a specified threshold.

Parameters
colorOvercolor applied in case if every component is OVER the limit (color is not blended, only copied)
colorFalsecolor applied in case if at least one component is UNDER the limit (color is not blended, only copied)
limitcolor used to be the threshold, component to component will be compared.
template<typename T >
_Image< T > Graphic::_Image< T >::toFormat ( Format  newFormat,
ConversionMode  conversionMode = ConversionMode::Luminance 
) const

Create a new Image from this one with a new format.

Parameters
newFormatFormat of the new image
conversionModeOnly used when converted to Format::R (Luminance : Use the average of the RGB channels, Trunquate : Use the R channel, Alpha : Use the Alpha Channel)
Returns
Image based of this one with a new format
template<typename T >
bool Graphic::_Image< T >::write ( std::fstream *  fileStream) const

write this object as binary into a file stream

Parameters
fileStreamstream used to write this object
Returns
boolean to know if the operation is a success of not.

The documentation for this class was generated from the following files: