Skip to main content

AbstractPainterColor

touchgfx/widgets/canvas/AbstractPainterColor.hpp

An abstract class for creating painter classes for drawing canvas widgets. All canvas widgets need a painter to fill the shape drawn with a CanvasWidgetRenderer. The painter must provide the color of a pixel on a given coordinate, which will the be blended into the framebuffer depending on the position of the canvas widget and the transparency of the given pixel.

The AbstractPainter also implements a function which will blend each pixel in a scanline snippet into the framebuffer, but for better performance, the function should be reimplemented in each painter.

Inherited by: PainterABGR2222, PainterARGB2222, PainterARGB8888, PainterBGRA2222, PainterBW, PainterGRAY2, PainterGRAY4, PainterRGB565, PainterRGB888, PainterRGBA2222, PainterXRGB8888

Public Functions

AbstractPainterColor(colortype color =0)
Constructor.
colortypegetColor() const
Gets the current color.
virtual voidsetColor(colortype color)
Sets color to use when drawing the CanvasWidget.
virtual ~AbstractPainterColor()
Destructor.

Protected Attributes

Public Functions Documentation

AbstractPainterColor

Constructor.

Parameters:
color(Optional) The color to use in the painter.

getColor

colortype getColor()const

Gets the current color.

Returns:

The color.

setColor

~AbstractPainterColor

Destructor.

Protected Attributes Documentation

painterColor

colortype painterColor

The color.