Skip to documentation
SLOP

tiny.zen.AsciiRenderPlan

Reference tiny.zen AsciiRenderPlan

Defined in tiny.zen.

Exact, clamped storage demand for one document and option set.

API (9)

Actions

Public operations.

Fields and members

Public fields and members.

No direct callersNo direct callstiny.zenAsciiRenderPlan
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/zen/src/diagram/ascii/plan.zig:19

zig
/// Exact, clamped storage demand for one document and option set.pub const Plan = struct {    /// Admitted width after clamping.    width: usize,    /// Admitted height after clamping.    height: usize,    /// Categorical bound slots required by the document.    categories: usize,    /// Stacked-series total slots required by the document.    stack_totals: usize,    /// Exact canvas bytes required.    canvas_bytes: usize,    /// Maximum output bytes required before row compaction.    output_bytes: usize,    /// Measures document scratch and clamps dimensions without allocating.    pub fn inspect(        document: *const diagram.Document,        options: model.Options,    ) error{CapacityOverflow}!Plan {        const width = clamp(options.width, 24, 200);        const height = clamp(options.height, 8, 80);        const scratch = diagram.bounds.ScratchPlan.inspect(document);        return .{            .width = width,            .height = height,            .categories = scratch.categories,            .stack_totals = scratch.stack_totals,            .canvas_bytes = try multiplied(width, height),            .output_bytes = try multiplied(try added(width, 1), height),        };    }    /// Returns the smallest limits that admit this render.    pub fn exactLimits(self: Plan) Limits {        return .{            .max_categories = self.categories,            .max_stack_totals = self.stack_totals,            .max_canvas_bytes = self.canvas_bytes,            .max_output_bytes = self.output_bytes,        };    }    /// Rejects when any measured region exceeds supplied limits.    pub fn require(self: Plan, limits: Limits) model.Exhaustion!void {        if (self.categories > limits.max_categories) {            return error.AsciiCategoryCapacityExceeded;        }        if (self.stack_totals > limits.max_stack_totals) {            return error.AsciiStackTotalCapacityExceeded;        }        if (self.canvas_bytes > limits.max_canvas_bytes) {            return error.AsciiCanvasByteCapacityExceeded;        }        if (self.output_bytes > limits.max_output_bytes) {            return error.AsciiOutputByteCapacityExceeded;        }    }};

Source: lib/zen/src/root.zig:67

zig
/// Exact, clamped ASCII demand for one document and option set.pub const AsciiRenderPlan = diagram.AsciiRenderPlan;
Called byCallstest sourcelib.zen.src.diagram.ascii.plantest: ASCII render plan exposes exact...private sourcelib.zen.src.diagram.ascii.planaddedprivate sourcelib.zen.src.diagram.ascii.planclampprivate sourcelib.zen.src.diagram.ascii.planmultiplieddiagram.bounds.ScratchPlaninspectAsciiRenderPlaninspect
Static calls · unresolved targets: 0 · external targets: 0.

Also reachable as

diagram.AsciiRenderPlan, diagram.ascii.RenderPlan.

Audit

Definitions4
Public names12
Members6
Version26.7.0
Revisiondaab053ee433