Ngo Kien / Graphics

Dependents:   SignalProcessLab DigitalSignalAlgorithm_Lab DigitalSignal_Lab

Embed: (wiki syntax)

« Back to documentation index

Canvas Class Reference

Canvas Class Reference

Canvas is a frame buffer where everything is drawn, uses its own graphics commands to create graphics. More...

#include <Canvas.h>

Inherits Display.

Public Member Functions

 Canvas ()
 Initializes a new instance of the Canvas class.
 Canvas (uint16_t width, uint16_t height)
 Initializes a new instance of the Canvas class.
 ~Canvas ()
 Finalizes an instance of the Canvas class.
void Clear ()
 Clears the canvas.
uint8_t * GetBitmap ()
 Gets the bitmap.
virtual uint16_t DisplayWidth ()
 Returns screen width.
virtual uint16_t DisplayHeight ()
 Redurns screen height.
virtual void DrawPoint (int posX, int posY, uint32_t colorMask)
 Draws the point.
bool SetSize (uint16_t width, uint16_t height)
 Sets the size.
bool IsSet ()
 Determines whether this instance is set.
virtual void SetDrawColor (uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha)=0
 Sets the color of the draw.
virtual void DrawLine (int startX, int startY, int endX, int endY)
 Draws the line.
virtual void DrawCircle (int posX, int posY, uint16_t radius)
 Draws the circle.
virtual void DrawRectangle (int startX, int startY, int endX, int endY)
 Draws the rectangle.
virtual void DrawTriangle (int x1, int y1, int x2, int y2, int x3, int y3)
 Draws the triangle.

Detailed Description

Canvas is a frame buffer where everything is drawn, uses its own graphics commands to create graphics.

Cavas bitmap must be copied to the display to make image visible.

Definition at line 30 of file Canvas.h.


Constructor & Destructor Documentation

Canvas ( void   )

Initializes a new instance of the Canvas class.

Class constructor

Definition at line 8 of file Canvas.cpp.

Canvas ( uint16_t  width,
uint16_t  height 
)

Initializes a new instance of the Canvas class.

Parameters:
widthThe width.
heightThe height.

Definition at line 14 of file Canvas.cpp.

~Canvas (  )

Finalizes an instance of the Canvas class.

Definition at line 20 of file Canvas.cpp.


Member Function Documentation

void Clear ( void   )

Clears the canvas.

Definition at line 95 of file Canvas.cpp.

uint16_t DisplayHeight (  ) [virtual]

Redurns screen height.

Returns:

Implements DisplayBase.

Definition at line 42 of file Canvas.cpp.

uint16_t DisplayWidth (  ) [virtual]

Returns screen width.

Returns:

Implements DisplayBase.

Definition at line 36 of file Canvas.cpp.

void DrawCircle ( int  posX,
int  posY,
uint16_t  radius 
) [virtual, inherited]

Draws the circle.

Parameters:
posXThe position x.
posYThe position y.
radiusThe radius.

Definition at line 59 of file GeometricPrim.cpp.

void DrawLine ( int  startX,
int  startY,
int  endX,
int  endY 
) [virtual, inherited]

Draws the line.

Parameters:
startXThe start x.
startYThe start y.
endXThe end x.
endYThe end y.

Definition at line 20 of file GeometricPrim.cpp.

void DrawPoint ( int  posX,
int  posY,
uint32_t  colorMask 
) [virtual]

Draws the point.

Parameters:
posXThe position x.
posYThe position y.
colorMaskThe color mask.

Definition at line 47 of file Canvas.cpp.

void DrawRectangle ( int  startX,
int  startY,
int  endX,
int  endY 
) [virtual, inherited]

Draws the rectangle.

Parameters:
startXThe start x.
startYThe start y.
endXThe end x.
endYThe end y.

Definition at line 103 of file GeometricPrim.cpp.

void DrawTriangle ( int  x1,
int  y1,
int  x2,
int  y2,
int  x3,
int  y3 
) [virtual, inherited]

Draws the triangle.

Parameters:
x1The x1.
y1The y1.
x2The x2.
y2The y2.
x3The x3.
y3The y3.

Definition at line 112 of file GeometricPrim.cpp.

uint8_t * GetBitmap ( void   )

Gets the bitmap.

Returns:

Definition at line 101 of file Canvas.cpp.

bool IsSet (  )

Determines whether this instance is set.

Returns:
true if this instance is set; otherwise, false.

Definition at line 107 of file Canvas.cpp.

virtual void SetDrawColor ( uint8_t  red,
uint8_t  green,
uint8_t  blue,
uint8_t  alpha 
) [pure virtual, inherited]

Sets the color of the draw.

Parameters:
redThe red.
greenThe green.
blueThe blue.
alphaThe alpha.

Implemented in RK043FN48H.

bool SetSize ( uint16_t  width,
uint16_t  height 
)

Sets the size.

Parameters:
widthThe width.
heightThe height.
Returns:

Definition at line 70 of file Canvas.cpp.