You.i Engine
CYIPolygonFill Class Reference

Detailed Description

A class that contains information on how to fill a polygon.

The polygon fill defined here will be drawn in software using CYICanvas.

Does not use GPU / hardware acceleration.
See also

#include <graphics/YiPolygonFill.h>

Public Member Functions

 CYIPolygonFill ()
virtual ~CYIPolygonFill ()
bool Create (int32_t width, int32_t height)
void Destroy ()
void Fill (CYIBitmap *pBitmap, const CYIPolygonData *pPolygonData, const glm::vec4 &bounds, const CYIColor &Color, CYIGradient *pGradient, bool nonZeroFill)

Static Public Member Functions

static void PolygonDataBounds (const CYIPolygonData &polygonDataIn, glm::vec4 &polygonBounds)

Static Public Attributes

static const uint32_t MAX_EDGES = 1000

Constructor & Destructor Documentation

◆ CYIPolygonFill()

CYIPolygonFill::CYIPolygonFill ( )

◆ ~CYIPolygonFill()

virtual CYIPolygonFill::~CYIPolygonFill ( )

Member Function Documentation

◆ Create()

bool CYIPolygonFill::Create ( int32_t  width,
int32_t  height 

Allocates resources for a width by height pixels bitmap.

◆ Destroy()

void CYIPolygonFill::Destroy ( )

Frees all the resources allocated in Create().

◆ Fill()

void CYIPolygonFill::Fill ( CYIBitmap pBitmap,
const CYIPolygonData pPolygonData,
const glm::vec4 &  bounds,
const CYIColor Color,
CYIGradient pGradient,
bool  nonZeroFill 

Fills a polygon defined by pPolygonData inside pBitmap using the Color or pGradient.

pGradient is optional. The polygon will be filled with pGradient only if nonZeroFill is true and pGradient is not nullptr. If nonZeroFill is false or pGradient is nullptr, the polygon will be filled with Color.
See also

◆ PolygonDataBounds()

static void CYIPolygonFill::PolygonDataBounds ( const CYIPolygonData polygonDataIn,
glm::vec4 &  polygonBounds 

Calculates the polygon bounds based on polygonDataIn. The result is stored inside polygonBounds.

See also

Member Data Documentation


const uint32_t CYIPolygonFill::MAX_EDGES = 1000

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