PainterRGBA2222
The PainterRGBA2222 class allows a shape to be filled with a given color value. This allows anti-aliased elements to be drawn.
See: AbstractPainter
Inherits from: AbstractPainterRGBA2222, AbstractPainterColor, AbstractPainter
Public Functions
virtual void | paint(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. | |
PainterRGBA2222(colortype color =0) | |
Initializes a new instance of the PainterRGBA2222 class. | |
virtual void | setColor(colortype color) |
Sets color to use when drawing the CanvasWidget. | |
Protected Attributes
uint8_t | color8 |
Pre-calculated native color. | |
uint8_t | painterBlue |
The blue part of the color, used when alpha blending. | |
uint8_t | painterGreen |
The green part of the color, used when alpha blending. | |
uint8_t | painterRed |
The red part of the color, used when alpha blending. | |
Additional inherited members
Public Functions inherited from AbstractPainterRGBA2222
AbstractPainterRGBA2222() | |
FORCE_INLINE_FUNCTION uint8_t | alphaBlend(uint8_t newpix, uint8_t bufpix, uint8_t alpha) const |
Mix colors from a new pixel and a buffer pixel with the given alpha applied to the new pixel, and the inverse alpha applied to the buffer pixel. | |
FORCE_INLINE_FUNCTION uint8_t | alphaBlend(uint8_t R, uint8_t G, uint8_t B, uint8_t bufpix, uint8_t alpha) const |
Mix colors from a new pixel and a buffer pixel with the given alpha applied to the new pixel, and the inverse alpha applied to the buffer pixel. | |
Public Functions inherited from AbstractPainterColor
AbstractPainterColor(colortype color =0) | |
Constructor. | |
colortype | getColor() const |
Gets the current color. | |
virtual | ~AbstractPainterColor() |
Destructor. | |
Protected Attributes inherited from AbstractPainterColor
colortype | painterColor |
The color. | |
Public Functions inherited from AbstractPainter
AbstractPainter() | |
Initializes a new instance of the AbstractPainter class. | |
void | framebufferToDisplay(int16_t & widgetX, int16_t & widgetY) const |
Convert Framebuffer widget coordinates to display widget coordinates. | |
virtual HAL::RenderingMethod | getRenderingMethod() const |
Return the applicable rendering method of the painter. | |
virtual bool | setup(const Rect & widgetRect) const |
This function is called before any actual paint operation is started. | |
virtual void | tearDown() 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 bool | compatibleFramebuffer(Bitmap::BitmapFormat format) |
Helper function to check if the provided bitmap format matches the current framebuffer format. | |
Protected Attributes inherited from AbstractPainter
int16_t | widgetWidth |
The width of the widget on screen, used by framebufferToDisplay() | |
Public Functions Documentation
paint
virtual void paint | ( | uint8_t * | destination , | const | |
int16_t | offset , | const | |||
int16_t | widgetX , | const | |||
int16_t | widgetY , | const | |||
int16_t | count , | const | |||
uint8_t | alpha | const | |||
) | 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().
destination | If non-null, the pointer. |
offset | The offset to add to the destination. |
widgetX | The widget x coordinate. |
widgetY | The widget y coordinate. |
count | Number of pixels. |
alpha | The alpha of the pixels. |
Reimplements: touchgfx::AbstractPainter::paint
PainterRGBA2222
PainterRGBA2222 | ( | colortype | color =0 | ) | |
Initializes a new instance of the PainterRGBA2222 class.
color | (Optional) the color, default is black. |
setColor
Sets color to use when drawing the CanvasWidget.
color | The color. |
Reimplements: touchgfx::AbstractPainterColor::setColor
Protected Attributes Documentation
color8
uint8_t color8
Pre-calculated native color.
painterBlue
uint8_t painterBlue
The blue part of the color, used when alpha blending.
painterGreen
uint8_t painterGreen
The green part of the color, used when alpha blending.
painterRed
uint8_t painterRed
The red part of the color, used when alpha blending.