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.

Note
Does not use GPU / hardware acceleration.
See also
CYICanvas::DrawPath

#include <graphics/YiPolygonFill.h>

Public Member Functions

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

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 ( )
virtual CYIPolygonFill::~CYIPolygonFill ( )
virtual

Member Function Documentation

bool CYIPolygonFill::Create ( int32_t  nWidth,
int32_t  nHeight 
)

Allocates resources for a nWidth by nHeight pixels bitmap.

void CYIPolygonFill::Destroy ( )

Frees all the resources allocated in Create().

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

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

Note
pGradient is optional. The polygon will be filled with pGradient only if bNonZeroFill is true and pGradient is not nullptr. If bNonZeroFill is false or pGradient is nullptr, the polygon will be filled with Color.
See also
CYIBitmap
CYIColor
CYIPolygonData
CYIGradient.
static void CYIPolygonFill::PolygonDataBounds ( const CYIPolygonData polygonDataIn,
glm::vec4 &  polygonBounds 
)
static

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

See also
CYIPolygonData

Member Data Documentation

const uint32_t CYIPolygonFill::MAX_EDGES = 1000
static

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