Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
design_fidelity.hpp File Reference
#include <pulp/view/design_ir.hpp>
#include <cstddef>
#include <functional>
#include <optional>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

struct  pulp::view::FidelityIssue
 A single import-fidelity self-check finding. More...
struct  pulp::view::FidelityContext
 Everything a check needs: the node, its sanitized bridge id, the dimensions codegen emitted for it, and which branch produced them. More...

Namespaces

namespace  pulp
namespace  pulp::view
 Hover-cursor tracking for platform window hosts.

Enumerations

enum class  pulp::view::FidelityElement { pulp::view::image , pulp::view::container , pulp::view::widget , pulp::view::text }
 What codegen branch produced the emitted geometry — lets a check apply only where it is meaningful without re-deriving the element kind. More...

Functions

bool pulp::view::is_vector_kind (const std::string &type)
 True for every normalized IR type that represents a vector / path-like shape (svg path/rect/line, ellipse/circle, polygon/polyline/star, …), matched on the IR type string only so the classification is identical across figma/pencil/stitch/v0.
std::optional< FidelityIssue > pulp::view::check_image_sizing_fidelity (const FidelityContext &)
 No-skew: a BLEED sprite (render_bounds or asset_bleed) must be emitted at an aspect matching its source PNG; missing PNG dims → aspect-unverified.
std::optional< FidelityIssue > pulp::view::check_gross_size_divergence (const FidelityContext &)
 Gross-size: a node the user pinned on BOTH axes (SizingMode::fixed) must not be emitted >3x its source box; hug/fill/absolute/display:none self-skip.
std::optional< FidelityIssue > pulp::view::check_widget_intrinsic_size (const FidelityContext &)
 Widget-intrinsic-size: a recognized audio widget whose emitted box diverges >1.5x from its source intrinsic size (shape_width/height attrs, else style box).
std::optional< FidelityIssue > pulp::view::check_text_vertical_centering (const FidelityContext &)
 Text-vertical-centering: a SINGLE-LINE text given a reserved vertical slot (emitted box taller than one line, below the multi-line threshold) must be emitted vertically centered.
void pulp::view::run_fidelity_checks (const FidelityContext &ctx, std::vector< FidelityIssue > &sink)
 Run every registered fidelity check against ctx, appending findings to sink.
void pulp::view::check_vector_renderability (const IRNode &root, const std::vector< ImportDiagnostic > &diagnostics, const std::function< std::string(const IRNode &)> &node_id_of, std::vector< FidelityIssue > &sink)
 Vector-renderability: every visible vector/path-like node (svg path/rect/ line, ellipse, polygon, …) above an area threshold must map to a real renderable primitive — a rasterized asset, a native widget, child paint, or a visible fill — OR already carry an explicit unsupported diagnostic.
std::size_t pulp::view::count_strict_fidelity_failures (const std::vector< FidelityIssue > &issues)
 Number of findings that should fail --strict-fidelity.