주요 내용으로 건너뛰기

PainterBW

touchgfx/widgets/canvas/PainterBW.hpp

PainterBW is used for drawing one 1bpp displays. The color is either on or off. No transparency is supported.

See: AbstractPainter

Inherits from: AbstractPainterBW, AbstractPainterColor, AbstractPainter

Public Functions

virtual voidpaint(uint8_t * destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const
Paints a streak of pixels (all with the same alpha) in the framebuffer.
PainterBW(colortype color =0)
Constructor.
virtual voidsetColor(colortype color)
Sets color to use when drawing the CanvasWidget.

Protected Attributes

uint8_tpainterBW
The color to use when painting.

Additional inherited members

Public Functions inherited from AbstractPainterBW

Public Functions inherited from AbstractPainterColor

AbstractPainterColor(colortype color =0)
Constructor.
colortypegetColor() const
Gets the current color.
virtual ~AbstractPainterColor()
Destructor.

Protected Attributes inherited from AbstractPainterColor

Public Functions inherited from AbstractPainter

AbstractPainter()
Initializes a new instance of the AbstractPainter class.
voidframebufferToDisplay(int16_t & widgetX, int16_t & widgetY) const
Convert Framebuffer widget coordinates to display widget coordinates.
virtual HAL::RenderingMethodgetRenderingMethod() const
Return the applicable rendering method of the painter.
virtual boolsetup(const Rect & widgetRect) const
This function is called before any actual paint operation is started.
virtual voidtearDown() const
This function is called after all paint operation have finished.
virtual ~AbstractPainter()
Finalizes an instance of the AbstractPainter class.

Protected Functions inherited from AbstractPainter

FORCE_INLINE_FUNCTION boolcompatibleFramebuffer(Bitmap::BitmapFormat format)
Helper function to check if the provided bitmap format matches the current framebuffer format.

Protected Attributes inherited from AbstractPainter

int16_twidgetWidth
The width of the widget on screen, used by framebufferToDisplay()

Public Functions Documentation

paint

virtual void paint(uint8_t *destination ,const
int16_toffset ,const
int16_twidgetX ,const
int16_twidgetY ,const
int16_tcount ,const
uint8_talphaconst
)const

Paints a streak of pixels (all with the same alpha) in the framebuffer.

The first pixel to paint is at 'offset' relative to 'destination' (to be able to support 1bpp, 2bpp and 4bpp). The first pixel to paint is at the given 'widgetX', 'widgetY' coordinate. The number of pixels to paint is 'count' and the alpha to apply is 'alpha'.

Note that the widgetX, widgetY is relative to the widget in the framebuffer, not the display. To convert the coordinate to display widget coordinates, use framebufferToDisplay().

Parameters:
destinationIf non-null, the pointer.
offsetThe offset to add to the destination.
widgetXThe widget x coordinate.
widgetYThe widget y coordinate.
countNumber of pixels.
alphaThe alpha of the pixels.
See also:

Reimplements: touchgfx::AbstractPainter::paint

PainterBW

Constructor.

Parameters:
color(Optional) The color.

setColor

virtual void setColor(colortypecolor)

Sets color to use when drawing the CanvasWidget.

Parameters:
colorThe color.

Reimplements: touchgfx::AbstractPainterColor::setColor

Protected Attributes Documentation

painterBW

uint8_t painterBW

The color to use when painting.