Namespace: DadGFX::cLayer Files: cDisplay.h / cDisplay.cpp Directory: DAD_FORGE/STM_GFX2 Inheritance:cLayerBase, cGFX Description: Class managing an active graphical layer. It allows drawing primitives (pixels, rectangles) and bitmaps on its own framebuffer.
📋 Class Description
The cLayer class is the main drawing element used by the user to modify the display. It acts as an intermediate buffer that receives drawing commands (lines, circles, rectangles, etc.).
It has two operating modes for color rendering:
Blend Mode: Calculates the blending between the source color and the existing framebuffer color using the Alpha component.
Overwrite Mode: Directly overwrites the framebuffer data with the new color.
📚 Public Methods
eraseLayer
Element
Details
Â
Method
virtual DAD_GFX_ERROR eraseLayer(const sColor& Color = sColor(0,0,0,0))
Â
Description
Erases the entire layer by replacing each pixel with the specified color.
Â
Parameter(s)
Â
Â
Color
const sColor&: The fill color (default is transparent black).
Â
Return
DAD_GFX_ERROR
OK if the operation succeeds, otherwise an error code.
setMode
Element
Details
Method
inline void setMode(DRAW_MODE Mode)
Description
Sets the rendering mode for subsequent drawing operations (Blend or Overwrite).
Parameter(s)
Â
Mode
DRAW_MODE: Blend for transparency, Overwrite for overwriting.