You.i Engine
CYICanvas Class Reference

Detailed Description

Draws vector graphics to a bitmap.

#include <graphics/YiCanvas.h>

Public Member Functions

 CYICanvas ()
 
virtual ~CYICanvas ()
 
void SetBitmap (CYIBitmap *pBitmap)
 
void DrawPath (const CYIPath *pPath, const CYIPaint &paint)
 
void DrawColor (const CYIColor &clr)
 
void SetMatrix (const glm::mat3x3 &matrix)
 
const glm::mat3x3 & GetMatrix () const
 
void Translate (const glm::vec2 &translate)
 
void Scale (const glm::vec2 &scale)
 
void Rotate (float rotation)
 

Protected Member Functions

void TransformPolygonData (const CYIPolygonData &polygonDataIn, CYIPolygonData *pPolygonDataOut)
 

Protected Attributes

glm::mat3x3 m_Matrix
 
CYIBitmapm_pBitmap
 
std::unique_ptr< CYIPolygonFillm_pPolygonFill
 

Constructor & Destructor Documentation

◆ CYICanvas()

CYICanvas::CYICanvas ( )

◆ ~CYICanvas()

virtual CYICanvas::~CYICanvas ( )
virtual

Member Function Documentation

◆ DrawColor()

void CYICanvas::DrawColor ( const CYIColor clr)

Draws the entire buffer with a given color.

◆ DrawPath()

void CYICanvas::DrawPath ( const CYIPath pPath,
const CYIPaint paint 
)

Draws a path with the given paint.

◆ GetMatrix()

const glm::mat3x3& CYICanvas::GetMatrix ( ) const

Get current transform matrix.

◆ Rotate()

void CYICanvas::Rotate ( float  rotation)

Apply rotation (degrees) to matrix.

◆ Scale()

void CYICanvas::Scale ( const glm::vec2 &  scale)

Apply scale to matrix.

◆ SetBitmap()

void CYICanvas::SetBitmap ( CYIBitmap pBitmap)

Sets the current destination buffer.

Note
This object does not take ownership of the provided pointer.

◆ SetMatrix()

void CYICanvas::SetMatrix ( const glm::mat3x3 &  matrix)

Set entirely new matrix.

◆ TransformPolygonData()

void CYICanvas::TransformPolygonData ( const CYIPolygonData polygonDataIn,
CYIPolygonData pPolygonDataOut 
)
protected

◆ Translate()

void CYICanvas::Translate ( const glm::vec2 &  translate)

Apply translate to matrix.

Member Data Documentation

◆ m_Matrix

glm::mat3x3 CYICanvas::m_Matrix
protected

◆ m_pBitmap

CYIBitmap* CYICanvas::m_pBitmap
protected

◆ m_pPolygonFill

std::unique_ptr<CYIPolygonFill> CYICanvas::m_pPolygonFill
protected

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