AbstractPainterABGR2222
The AbstractPainterABGR2222 class is an abstract class for creating a painter to draw on a ABGR2222 display using CanvasWidgetRenderer.
See: AbstractPainter
Inherits from: AbstractPainter
Inherited by: PainterABGR2222, PainterABGR2222Bitmap
Public Functions
AbstractPainterABGR2222() | |
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. | |
Additional inherited members
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 void | paint(uint8_t * destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const =0 |
Paints a streak of pixels (all with the same alpha) in the framebuffer. | |
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
AbstractPainterABGR2222
alphaBlend
FORCE_INLINE_FUNCTION uint8_t alphaBlend | ( | uint8_t | newpix , | const | |
uint8_t | bufpix , | const | |||
uint8_t | alpha | const | |||
) | 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.
Parameters:
newpix | The new pixel value. |
bufpix | The buffer pixel value. |
alpha | The alpha to apply to the new pixel. |
Returns:
The result of blending the two colors into a new color.
alphaBlend
FORCE_INLINE_FUNCTION uint8_t alphaBlend | ( | uint8_t | R , | const | |
uint8_t | G , | const | |||
uint8_t | B , | const | |||
uint8_t | bufpix , | const | |||
uint8_t | alpha | const | |||
) | 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.
Parameters:
R | The red color. |
G | The green color. |
B | The blue color. |
bufpix | The buffer pixel value. |
alpha | The alpha of the R,G,B. |
Returns:
The result of blending the two colors into a new color.