Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::canvas::SceneText Class Reference

#include <scene_text.hpp>

Public Member Functions

 SceneText ()
void set_position (float x, float y)
float x () const
float y () const
void set_text (std::string text)
const std::string & text () const
void set_font (std::string family, float size)
const std::string & font_family () const
float font_size () const
void set_measured_width (float w)
 Approximate text width used by local_bounds().
float measured_width () const
Color fill_color () const
void set_fill_color (Color c)
bool stroke_enabled () const
void set_stroke_enabled (bool v)
Color stroke_color () const
void set_stroke_color (Color c)
SceneRect local_bounds () const override
 Local-coordinate bounding box (pre-transform, pre-opacity).
void paint_geometry (Canvas &canvas) const override
 Paint this node (and its sub-tree) into canvas.
SceneNodeKind kind () const
const std::string & id () const
void set_id (std::string v)
bool visible () const
void set_visible (bool v)
float opacity () const
void set_opacity (float a)
const SceneTransform & transform () const
void set_transform (const SceneTransform &t)
SceneGroup * parent () const
SceneRect transformed_local_bounds () const
 Bounds after the node's own transform — used for parent group unions.
bool dirty () const
void mark_dirty ()
 Mark this node and (recursively) every ancestor dirty.
void mark_clean (const SceneRect &painted_scene_bounds)
 Called by the scene walker after a full paint.
const SceneRect & last_painted_bounds () const
 The scene-space rect this node occupied at the last paint.

Constructor & Destructor Documentation

◆ SceneText()

pulp::canvas::SceneText::SceneText ( )
inline

Member Function Documentation

◆ dirty()

bool pulp::canvas::SceneNode::dirty ( ) const
inlineinherited

◆ fill_color()

Color pulp::canvas::SceneText::fill_color ( ) const
inline

◆ font_family()

const std::string & pulp::canvas::SceneText::font_family ( ) const
inline

◆ font_size()

float pulp::canvas::SceneText::font_size ( ) const
inline

◆ id()

const std::string & pulp::canvas::SceneNode::id ( ) const
inlineinherited

◆ kind()

SceneNodeKind pulp::canvas::SceneNode::kind ( ) const
inlineinherited

◆ last_painted_bounds()

const SceneRect & pulp::canvas::SceneNode::last_painted_bounds ( ) const
inlineinherited

The scene-space rect this node occupied at the last paint.

Always united with the post-mutation bounds to derive the "what needs repainting" rect — this is the whole point of the retained scene graph: small mutations → small repaint rects.

◆ local_bounds()

SceneRect pulp::canvas::SceneText::local_bounds ( ) const
overridevirtual

Local-coordinate bounding box (pre-transform, pre-opacity).

Subclasses MUST compute this from current geometry.

Implements pulp::canvas::SceneNode.

◆ mark_clean()

void pulp::canvas::SceneNode::mark_clean ( const SceneRect & painted_scene_bounds)
inlineinherited

Called by the scene walker after a full paint.

Captures the bounding box that was painted (in scene coordinates) so the next mutation knows what to invalidate.

◆ mark_dirty()

void pulp::canvas::SceneNode::mark_dirty ( )
inherited

Mark this node and (recursively) every ancestor dirty.

Returning the current node's last_painted_bounds() union with the new transformed_local_bounds() lets VectorScene::take_dirty_rect() report the exact rect that needs to be re-painted.

◆ measured_width()

float pulp::canvas::SceneText::measured_width ( ) const
inline

◆ opacity()

float pulp::canvas::SceneNode::opacity ( ) const
inlineinherited

◆ paint_geometry()

void pulp::canvas::SceneText::paint_geometry ( Canvas & canvas) const
overridevirtual

Paint this node (and its sub-tree) into canvas.

The walker calls save() / restore() around this call, applies the composed CTM, and pushes opacity if opacity_ < 1.0. Implementations therefore emit geometry/state only — they MUST NOT touch save/restore.

Implements pulp::canvas::SceneNode.

◆ parent()

SceneGroup * pulp::canvas::SceneNode::parent ( ) const
inlineinherited

◆ set_fill_color()

void pulp::canvas::SceneText::set_fill_color ( Color c)
inline

◆ set_font()

void pulp::canvas::SceneText::set_font ( std::string family,
float size )
inline

◆ set_id()

void pulp::canvas::SceneNode::set_id ( std::string v)
inlineinherited

◆ set_measured_width()

void pulp::canvas::SceneText::set_measured_width ( float w)
inline

Approximate text width used by local_bounds().

Callers that need pixel-accurate bounds should set this from a TextShaper measurement; the default is a cheap monospace estimate so the dirty-rect math has some extent to union.

◆ set_opacity()

void pulp::canvas::SceneNode::set_opacity ( float a)
inlineinherited

◆ set_position()

void pulp::canvas::SceneText::set_position ( float x,
float y )
inline

◆ set_stroke_color()

void pulp::canvas::SceneText::set_stroke_color ( Color c)
inline

◆ set_stroke_enabled()

void pulp::canvas::SceneText::set_stroke_enabled ( bool v)
inline

◆ set_text()

void pulp::canvas::SceneText::set_text ( std::string text)
inline

◆ set_transform()

void pulp::canvas::SceneNode::set_transform ( const SceneTransform & t)
inlineinherited

◆ set_visible()

void pulp::canvas::SceneNode::set_visible ( bool v)
inlineinherited

◆ stroke_color()

Color pulp::canvas::SceneText::stroke_color ( ) const
inline

◆ stroke_enabled()

bool pulp::canvas::SceneText::stroke_enabled ( ) const
inline

◆ text()

const std::string & pulp::canvas::SceneText::text ( ) const
inline

◆ transform()

const SceneTransform & pulp::canvas::SceneNode::transform ( ) const
inlineinherited

◆ transformed_local_bounds()

SceneRect pulp::canvas::SceneNode::transformed_local_bounds ( ) const
inlineinherited

Bounds after the node's own transform — used for parent group unions.

◆ visible()

bool pulp::canvas::SceneNode::visible ( ) const
inlineinherited

◆ x()

float pulp::canvas::SceneText::x ( ) const
inline

◆ y()

float pulp::canvas::SceneText::y ( ) const
inline

The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/canvas/include/pulp/canvas/scene/scene_text.hpp