Gorgon Game Engine
Gorgon::CGI Namespace Reference

Classes

class  SolidFill
 Fills a drawing with a solid color. More...
 
struct  StrokeSettings
 

Functions

template<int S_ = 8, class P_ = Geometry::Pointf, class F_ = SolidFill<>>
void Circle (Containers::Image &target, P_ location, Float radius, F_ fill=SolidFill<>(Graphics::Color::Black))
 Draws a filled circle with the specified radius to the given target. More...
 
template<int S_ = 8, class P_ = Geometry::Pointf, class F_ = SolidFill<>>
void Circle (Containers::Image &target, P_ location, Float radius, Float border, F_ fill=SolidFill<>(Graphics::Color::Black))
 Draws a circle outline with the specified radius to the given target. More...
 
template<int S_ = 8, class P_ = Geometry::Pointf, class F_ = SolidFill<>>
void Circle (Graphics::Bitmap &target, P_ location, Float radius, F_ fill=SolidFill<>(Graphics::Color::Black))
 
template<int S_ = 8, class P_ = Geometry::Pointf, class F_ = SolidFill<>>
void Circle (Graphics::Bitmap &target, P_ location, Float radius, Float border, F_ fill=SolidFill<>(Graphics::Color::Black))
 
template<int S_ = 8, class P_ = Geometry::Pointf, class F_ = SolidFill<>>
void DrawLines (Containers::Image &target, const Geometry::PointList< P_ > &p, StrokeSettings settings=1.0, F_ stroke=SolidFill<>{Graphics::Color::Black})
 Draw a point list as a list of lines. More...
 
template<int S_ = 8, class P_ = Geometry::Pointf, class F_ = SolidFill<>>
void DrawLines (Containers::Image &target, const std::vector< Geometry::PointList< P_ >> &pnts, StrokeSettings settings=1.0, F_ stroke=SolidFill<>{Graphics::Color::Black})
 Draw a point list as a list of lines. More...
 
template<int S_ = 8, class P_ = Geometry::Pointf, class F_ = SolidFill<>>
void DrawLines (Graphics::Bitmap &target, const Geometry::PointList< P_ > &p, StrokeSettings settings=1.0, F_ stroke=SolidFill<>{Graphics::Color::Black})
 Draw a point list as a list of lines. More...
 
template<int S_ = 8, class P_ = Geometry::Pointf, class F_ = SolidFill<>>
void DrawLines (Graphics::Bitmap &target, const std::vector< Geometry::PointList< P_ >> &pnts, StrokeSettings settings=1.0, F_ stroke=SolidFill<>{Graphics::Color::Black})
 Draw a point list as a list of lines. More...
 
template<int S_ = 8, class P_ = Geometry::Pointf>
std::vector< Geometry::PointList< P_ > > LinesToPolygons (const Geometry::PointList< P_ > &p, StrokeSettings settings=1.0)
 Returns the polygon to draw a list of lines. More...
 
template<int S_ = 8, int W_ = 1, class P_ = Geometry::Pointf, class F_ = SolidFill<>>
void Polyfill (Containers::Image &target, const Geometry::PointList< P_ > &p, F_ fill=SolidFill<>{Graphics::Color::Black})
 This function fills the given point list as a polygon. More...
 
template<int S_ = 8, int W_ = 1, class P_ = Geometry::Pointf, class F_ = SolidFill<>>
void Polyfill (Containers::Image &target, const std::vector< Geometry::PointList< P_ >> &p, F_ fill=SolidFill<>{Graphics::Color::Black})
 This function fills the given point list as a polygon. More...
 
template<int S_ = 8, class P_ , class F_ = SolidFill<>>
void Polyfill (Graphics::Bitmap &target, const Geometry::PointList< P_ > &points, F_ fill=SolidFill<>{Graphics::Color::Black})
 This function fills the given point list as a polygon. More...
 
template<int S_ = 8, int W_ = 1, class P_ , class F_ = SolidFill<>>
void Polyfill (Graphics::Bitmap &target, const std::vector< Geometry::PointList< P_ >> &points, F_ fill=SolidFill<>{Graphics::Color::Black})
 This function fills the given point list as a polygon. More...
 

Function Documentation

◆ Circle() [1/4]

void Gorgon::CGI::Circle ( Containers::Image target,
P_  location,
Float  radius,
F_  fill = SolidFill<>(Graphics::Color::Black) 
)

Draws a filled circle with the specified radius to the given target.

This function is very fast but is not very accurate. Any S_ value > 1 will enable AA.

References basic_Image< T_ >::GetHeight(), basic_Image< T_ >::GetRGBAAt(), basic_Image< T_ >::GetWidth(), and basic_Image< T_ >::SetRGBAAt().

◆ Circle() [2/4]

void Gorgon::CGI::Circle ( Containers::Image target,
P_  location,
Float  radius,
Float  border,
F_  fill = SolidFill<>(Graphics::Color::Black) 
)

Draws a circle outline with the specified radius to the given target.

This function is very fast but is not very accurate. Radius is the inner radius of the circle. Any S_ value > 1 will enable AA.

References basic_Image< T_ >::GetHeight(), basic_Image< T_ >::GetRGBAAt(), basic_Image< T_ >::GetWidth(), and basic_Image< T_ >::SetRGBAAt().

◆ Circle() [3/4]

void Gorgon::CGI::Circle ( Graphics::Bitmap target,
P_  location,
Float  radius,
F_  fill = SolidFill<>(Graphics::Color::Black) 
)

◆ Circle() [4/4]

void Gorgon::CGI::Circle ( Graphics::Bitmap target,
P_  location,
Float  radius,
Float  border,
F_  fill = SolidFill<>(Graphics::Color::Black) 
)

◆ DrawLines() [1/4]

void Gorgon::CGI::DrawLines ( Containers::Image target,
const Geometry::PointList< P_ > &  p,
StrokeSettings  settings = 1.0,
F_  stroke = SolidFill<>{Graphics::Color::Black} 
)

Draw a point list as a list of lines.

References Gorgon::Graphics::Color::Black.

◆ DrawLines() [2/4]

void Gorgon::CGI::DrawLines ( Containers::Image target,
const std::vector< Geometry::PointList< P_ >> &  pnts,
StrokeSettings  settings = 1.0,
F_  stroke = SolidFill<>{Graphics::Color::Black} 
)

Draw a point list as a list of lines.

References Gorgon::Graphics::Color::Black.

◆ DrawLines() [3/4]

void Gorgon::CGI::DrawLines ( Graphics::Bitmap target,
const Geometry::PointList< P_ > &  p,
StrokeSettings  settings = 1.0,
F_  stroke = SolidFill<>{Graphics::Color::Black} 
)

Draw a point list as a list of lines.

References Gorgon::Graphics::Color::Black.

◆ DrawLines() [4/4]

void Gorgon::CGI::DrawLines ( Graphics::Bitmap target,
const std::vector< Geometry::PointList< P_ >> &  pnts,
StrokeSettings  settings = 1.0,
F_  stroke = SolidFill<>{Graphics::Color::Black} 
)

Draw a point list as a list of lines.

References Gorgon::Graphics::Color::Black.

◆ LinesToPolygons()

std::vector<Geometry::PointList<P_> > Gorgon::CGI::LinesToPolygons ( const Geometry::PointList< P_ > &  p,
StrokeSettings  settings = 1.0 
)

◆ Polyfill() [1/4]

void Gorgon::CGI::Polyfill ( Containers::Image target,
const Geometry::PointList< P_ > &  p,
F_  fill = SolidFill<>{Graphics::Color::Black} 
)

This function fills the given point list as a polygon.

List is treated as closed where last pixel connects to the first. S_ is the number of subdivision for subpixel accuracy.

References Gorgon::Graphics::Color::Black.

◆ Polyfill() [2/4]

void Gorgon::CGI::Polyfill ( Containers::Image target,
const std::vector< Geometry::PointList< P_ >> &  p,
F_  fill = SolidFill<>{Graphics::Color::Black} 
)

This function fills the given point list as a polygon.

List is treated as closed where last pixel connects to the first. S_ is the number of subdivision for subpixel accuracy. If subpixelonly is true, the segment where fully set pixels are determined is skipped. When drawing very thin polygon such as lines, setting this parameters can improve speed. S_ should be a power of two for this algorithm to work properly. W_ is winding, 1 is odd, 0 is non-zero.

References Gorgon::Graphics::Color::Black.

◆ Polyfill() [3/4]

void Gorgon::CGI::Polyfill ( Graphics::Bitmap target,
const Geometry::PointList< P_ > &  points,
F_  fill = SolidFill<>{Graphics::Color::Black} 
)

This function fills the given point list as a polygon.

List is treated as closed where last pixel connects to the first.

References Gorgon::Graphics::Color::Black.

◆ Polyfill() [4/4]

void Gorgon::CGI::Polyfill ( Graphics::Bitmap target,
const std::vector< Geometry::PointList< P_ >> &  points,
F_  fill = SolidFill<>{Graphics::Color::Black} 
)

This function fills the given point list as a polygon.

List is treated as closed where last pixel connects to the first.

References Gorgon::Graphics::Color::Black.