Emitting#
Panel Core to SVG, and to the exports for image models (#72). No emitter makes a layout decision: everything it draws or says was already decided.
scenet.emit.svg#
.. py:module:: scenet.emit.svg
Panel Core into SVG.
Purely mechanical: every position here was decided by the solver. The emitter makes no layout decisions, which is what keeps rendering swappable and golden tests meaningful.
Numbers are formatted through one helper at fixed precision so that output is byte-identical across platforms, whose float repr differs in the last digit.
.. py:data:: XLINK
- module:
scenet.emit.svg
- value:
href
is in. SVG 2 deprecates it for plainhref, and every renderer still reads it; Inkscape does not yet load a resource named by plainhref` (inkscape/inbox#4411), and editing the output there is a likely next step.- type:
The namespace `xlink
.. py:data:: GLYPH_SCALE_PLACES
- module:
scenet.emit.svg
- value:
6
Decimal places for a glyph’s scale. The scale is size/unitsPerEm, and a font’s units are a thousand or more to the em, so two places – right for a coordinate – wrote 0.035 as 0.04 and drew every letter 14% larger than it was measured. Six keep the drawn size within a millionth of an em of the measured one.
.. py:data:: FACE_ATTRIBUTES
- module:
scenet.emit.svg
- type:
dict[~scenet.ir.Face, str]
- value:
{Face.BOLD_ITALIC: ‘ font-weight=”bold” font-style=”italic”’, Face.ITALIC: ‘ font-style=”italic”’, Face.REGULAR: ‘ font-style=”normal”’}
How a run in another face than its line’s is marked in live text. A
<tspan>only where the face changes, so a line without emphasis is exactly the<text>it was.
.. py:function:: fmt(value, places=2)
- module:
scenet.emit.svg
Format a number for SVG output.
Trailing zeros are stripped so
100.00prints as100, which keeps files small and diffs readable without making them any less exact.Two places is a hundredth of a panel unit, which is exact for a coordinate. It is not for a factor: a glyph’s scale multiplies a thousand font units, so it takes
places=6.- sphinx_autodoc_typehints_rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
.. py:function:: render(core, *, metrics=None, fonts=None, live_text=False, id_prefix=’’, aria=True, embed=None)
- module:
scenet.emit.svg
Render a compiled panel as a standalone SVG document.
- type core:
- sphinx_autodoc_typehints_type:
\:sphinx\_autodoc\_typehints\_alias\:\18adf12eba886099``
- param core:
The compiled panel.
- type metrics:
- sphinx_autodoc_typehints_type:
\:py\:class\:\~scenet.solve.text.FontMetrics` | :sphinx_autodoc_typehints_constant:`None``
- param metrics:
The regular face the lettering was measured in, in place of the shipped one, for a Core compiled with the same
metrics.- type fonts:
- sphinx_autodoc_typehints_type:
\:py\:class\:\~collections.abc.Mapping`\ \[:py:class:`str`, :py:class:`~scenet.solve.text.FontMetrics`] | :sphinx_autodoc_typehints_constant:`None``
- param fonts:
The declared fonts the lettering was measured in, by digest – what
- attr:
CompileResult.fonts <scenet.pipeline.CompileResult.fonts>holds. Each face :attr:PanelCore.fonts <scenet.core.PanelCore.fonts>names must be here.
- type live_text:
- sphinx_autodoc_typehints_type:
\:py\:class\:\bool``
- param live_text:
Emit lettering as
<text>rather than glyph outlines.- type id_prefix:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
- param id_prefix:
Put in front of every
idthe panel writes, and every reference to one. Nothing a single panel needs; it is what lets a strip hold several panels in one document, where ids must be unique. Empty by default, so a panel on its own is byte-identical to what it always was.- type aria:
- sphinx_autodoc_typehints_type:
\:py\:class\:\bool``
- param aria:
Make the panel one image a screen reader can read, named with what it shows and then everything said in it, in reading order – see
- func:
accessible_name.Falsewrites none of it, for anyone who post-processes the SVG: exactly what was written before it existed.
- type embed:
- sphinx_autodoc_typehints_type:
\:py\:class\:\~collections.abc.Mapping`\ \[:py:class:`str`, :py:class:`bytes`] | :sphinx_autodoc_typehints_constant:`None``
- param embed:
The supplied pictures’ bytes, by digest – what
- attr:
CompileResult.images <scenet.pipeline.CompileResult.images>holds. Given, each picture is written into the SVG as adata:URI, and must be here; left out, it is linked by the path the document wrote, which a viewer reads from beside the SVG.
- raises ValueError:
The Core names a font that was not handed over. Drawing its lettering in another face would draw text that does not fit the balloons around it. Or a picture is to be embedded and was not handed over.
- sphinx_autodoc_typehints_rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
.. py:function:: accessible_name(core)
- module:
scenet.emit.svg
What makes a panel one image a screen reader can read: its attributes and children.
The panel is
role="img", named by one<title>, its first child: the description, then every balloon, caption and sound effect’s label, inorder. The words go in the name, which is announced, rather than a description, which often is not (NVDA, JAWS) – and in nothing else. Named througharia-labelledbyby a<title>and a<desc>, the panel was read by NVDA 2026.2 with Edge 155 a second time, the<desc>as its description, whenever a reader moved to it by graphic. One title is read once.It needs no id either, so a page holding several inlined SVGs – the VS Code preview, a web comic – where
getElementByIdfinds the first match, cannot name one panel with another’s words. An image’s children are presentational, so nothing inside it is named, and the order is this one sequence whatever order things are painted in. With no words at all, nothing is written: an image with no name is worse than none. Every word was resolved in the pipeline; this only copies.- type core:
- sphinx_autodoc_typehints_type:
\:sphinx\_autodoc\_typehints\_alias\:\18adf12eba886099``
- param core:
The compiled panel.
- rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\tuple`\ \[:py:class:`str`, :py:class:`list`\ \[:py:class:`str`]]`
- returns:
The attributes for the panel’s root or group, with a leading space, and the lines to write as its first children.
.. py:function:: panel_body(core, family, *, live_text=False, id_prefix=’’, embed=None)
- module:
scenet.emit.svg
A panel’s contents, without the document around them: what a strip or page places.
- type core:
- sphinx_autodoc_typehints_type:
\:sphinx\_autodoc\_typehints\_alias\:\18adf12eba886099``
- param core:
The compiled panel.
- type family:
- sphinx_autodoc_typehints_type:
\:sphinx\_autodoc\_typehints\_alias\:\e86937bd14fbd972``
- param family:
The faces its lettering was measured in, from :func:
typeface_of.- type live_text:
- sphinx_autodoc_typehints_type:
\:py\:class\:\bool``
- param live_text:
Emit lettering as
<text>rather than glyph outlines.- type id_prefix:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
- param id_prefix:
Put in front of every
idthe panel writes, and every reference to one.- type embed:
- sphinx_autodoc_typehints_type:
\:py\:class\:\~collections.abc.Mapping`\ \[:py:class:`str`, :py:class:`bytes`] | :sphinx_autodoc_typehints_constant:`None``
- param embed:
The supplied pictures’ bytes, by digest – what
- attr:
CompileResult.images <scenet.pipeline.CompileResult.images>holds. Given, each picture is written into the SVG as adata:URI, and must be here; left out, it is linked by the path the document wrote, which a viewer reads from beside the SVG.
- rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\list`\ \[:py:class:`str`]`
- returns:
The lines between the root’s opening tag and its closing one, none of them empty.
.. py:function:: in_painters_order(core)
- module:
scenet.emit.svg
The actors and masses of a panel, in the order they are drawn: back to front.
Masses and actors share one painter’s order, which is the whole point of
planemapping ontodepth: a far mass, the cast, and a foreground mass fall into place in a single sort with no layering code of their own. Within one depth, masses keep the order Panel Core lists them in, which is back to front – their ids are numbered that way, butm10sorted as text would come beforem2– and actors break ties on id. No mass shares a depth with an actor: the backdrop is behind every actor, and the foreground in front of all of them.- type core:
- sphinx_autodoc_typehints_type:
\:sphinx\_autodoc\_typehints\_alias\:\18adf12eba886099``
- param core:
The compiled panel.
- rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\list`\ \[:py:class:`~scenet.core.CoreActor` | :py:class:`~scenet.core.CoreMass`]`
- returns:
Every actor and mass, farthest first.
.. py:function:: image_href(image, embed=None)
- module:
scenet.emit.svg
Where an
<image>finds its picture: the path as written, or the bytes themselves.A path is percent-encoded and nothing more,
/kept: a name with a space,#or:in it then stays a path rather than becoming a fragment, a query or a scheme. Format conversion, not a decision – which file it names was the document’s.- type image:
- sphinx_autodoc_typehints_type:
\:sphinx\_autodoc\_typehints\_alias\:\6d8c60f99594c1d2``
- param image:
The picture, as Panel Core records it.
- type embed:
- sphinx_autodoc_typehints_type:
\:py\:class\:\~collections.abc.Mapping`\ \[:py:class:`str`, :py:class:`bytes`] | :sphinx_autodoc_typehints_constant:`None``
- param embed:
The supplied pictures’ bytes, by digest, to write as a
data:URI; or None, to link.- rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
- returns:
The value of
xlink -- href.- raises ValueError:
There is something to embed from, and not these bytes.
.. admonition:: Example
from scenet.core import Box, CoreImage from scenet.emit.svg import image_href image = CoreImage( … href=”art/p 1.png”, … media_type=”image/png”, … sha256=”00”, … pixels=(1, 1), … fit=”cover”, … preserve_aspect_ratio=”xMidYMid slice”, … box=Box(x=0, y=0, width=1, height=1), … ) image_href(image) ‘art/p%201.png’ image_href(image, {“00”: b”PNG”}) ‘data:image/png;base64,UE5H’
.. py:function:: attr(value)
- module:
scenet.emit.svg
Quote a string for use as an XML attribute value, delimiters included.
Returns the value with its surrounding quotes, because choosing the quote character is part of escaping correctly –
quoteattrpicks whichever one avoids the most escaping.This exists because
xml.sax.saxutils.escapedoes not escape quotation marks. That is fine for element content and wrong for an attribute: identifiers here come from user documents – a cast key, a panel name – and one containing a double quote would close the attribute early and let the rest of it be read as markup. The output is injected withinnerHTMLby the browser playground, so that is a scripting vector, not merely malformed XML.- type value:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
- param value:
Any string, trusted or not.
- rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
- returns:
The value, escaped and wrapped in quotes.
.. admonition:: Example
from scenet.emit.svg import attr attr(“alice”) ‘“alice”’ attr(‘a” onload=x’) ‘’a” onload=x’’
.. py:function:: typeface_of(core, *, metrics=None, fonts=None)
- module:
scenet.emit.svg
The family a Core’s lettering was measured in, from the fonts handed over.
- type core:
- sphinx_autodoc_typehints_type:
\:sphinx\_autodoc\_typehints\_alias\:\18adf12eba886099``
- param core:
The compiled panel.
- type metrics:
- sphinx_autodoc_typehints_type:
\:py\:class\:\~scenet.solve.text.FontMetrics` | :sphinx_autodoc_typehints_constant:`None``
- param metrics:
A regular face given by hand, as it was given to the compile.
- type fonts:
- sphinx_autodoc_typehints_type:
\:py\:class\:\~collections.abc.Mapping`\ \[:py:class:`str`, :py:class:`~scenet.solve.text.FontMetrics`] | :sphinx_autodoc_typehints_constant:`None``
- param fonts:
Declared fonts by digest.
- rtype:
- sphinx_autodoc_typehints_type:
\:sphinx\_autodoc\_typehints\_alias\:\e86937bd14fbd972``
- returns:
The shipped family, with each face the Core names in its declared font.
- raises ValueError:
A face the Core names is in none of the fonts given.
scenet.emit.debug_svg#
.. py:module:: scenet.emit.debug_svg
Diagnostic overlay: what the solver was actually looking at.
Building a geometric solver without this is guesswork. When a balloon lands somewhere surprising, the question is always “what did the solver think was there?” – and the answer is invisible in the finished panel. This draws the hidden geometry: silhouette hulls, face exclusion circles, anchors, gaze vectors, tail routes, and what an inset covers.
.. py:function:: render_debug(core, *, id_prefix=’’)
- module:
scenet.emit.debug_svg
Render the solver’s working geometry over a faint copy of the panel.
- type core:
- sphinx_autodoc_typehints_type:
\:sphinx\_autodoc\_typehints\_alias\:\c6bfb622b83019b8``
- param core:
The compiled panel.
- type id_prefix:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
- param id_prefix:
Put in front of every
idthe overlay writes, so a strip can hold several overlays in one document. Empty by default, as in- func:
render <scenet.emit.svg.render>.
- sphinx_autodoc_typehints_rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
.. py:function:: debug_body(core, *, id_prefix=’’)
- module:
scenet.emit.debug_svg
The overlay’s contents, without the document around them: what a strip places.
Every part is kept, an empty one included – a panel with no setting draws no backdrop, and leaves a blank line where it would be – so the overlay reads the same placed as alone.
- type core:
- sphinx_autodoc_typehints_type:
\:sphinx\_autodoc\_typehints\_alias\:\c6bfb622b83019b8``
- param core:
The compiled panel.
- type id_prefix:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
- param id_prefix:
Put in front of every
idthe overlay writes.- rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\list`\ \[:py:class:`str`]`
- returns:
The lines between the root’s opening tag and its closing one.
scenet.emit.strip#
.. py:module:: scenet.emit.strip
Several panels laid out as a strip.
Deliberately minimal. Real page composition – tiers, panels of varying size, the page-level reading path, bleeds – is a substantial design problem in its own right and is explicitly out of scope. This is the smallest thing that lets a sequence be read as a sequence: panels in a row, separated by a gutter, in declaration order.
The gutter is not decoration. It is where the reader performs what Scott McCloud calls closure – inferring what happened between two panels – and it is the one formal element that distinguishes comics from a series of illustrations.
A panel in a strip looks exactly as it does alone. Two things make that true, and both used to be missing:
Each panel is clipped to its frame. A shot crops the body at the frame, so most of a figure usually lies outside it. A panel on its own hides that behind its
viewBox; here the same rectangle is aclipPath, or the rest of the figure would draw into the gutter – and, once panels stack, into the tier below. The clip sits on an inner group with no transform of its own, becauseuserSpaceOnUseis defined against the referencing element’s user space, which is ambiguous on an element that also carries atransform. The overlay is clipped too: alone, itsviewBoxclips it just the same.Every id is unique. Each panel’s ids, and the references to them, are prefixed by the panel’s position –
p1-,p2-– rather than its name. A name is whatever the document said, and while attribute escaping keeps one inside its quotes, nothing would keep it insideurl(#...). Position is unique, safe and the same on every run. The panel’s group keeps its name, aspanel-<name>.
.. py:data:: GROUP
- module:
scenet.emit.strip
- value:
‘ role=”group”’
a group, each panel in it an image.
groupis the role every engine computes and screen readers announce;graphics-documentis the specification’s, but Firefox reduces it to a plain document and no screen-reader test of it is published (ACT rule 7d6734 calls its support inconsistent).- type:
A document of panels, for a screen reader
.. py:data:: HIDDEN
- module:
scenet.emit.strip
- value:
‘ aria-hidden=”true”’
On a shape of the document’s own – a background, a page, an inset’s ring – so that WebKit, which exposes an unnamed shape under a named ancestor as an unnamed image, does not announce it.
.. py:function:: reading_direction(directions, what)
- module:
scenet.emit.strip
The one way a set of panels or pages is read, which laying them out side by side needs.
- raises ValueError:
They are not all read the same way. Every panel and page of one document is, so this is panels gathered from documents read differently.
- sphinx_autodoc_typehints_rtype:
- sphinx_autodoc_typehints_type:
\:sphinx\_autodoc\_typehints\_alias\:\c28dd00f473cde09``
.. py:function:: counted(number, noun)
- module:
scenet.emit.strip
1 panel,2 panels: a count as it is said... admonition:: Example
counted(1, “panel”), counted(3, “page”) (‘1 panel’, ‘3 pages’)
- sphinx_autodoc_typehints_rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
.. py:function:: render_strip(panels, *, live_text=False, debug=False, fonts=None, aria=True, embed=None)
- module:
scenet.emit.strip
Lay panels side by side in reading order: left to right, or right to left.
Each panel is rendered independently and then placed, rather than being re-solved: a panel’s composition must not depend on what sits beside it, or the same source would compile differently in isolation. Panels read right to left (#68) are laid from the right; they are still written in reading order, which is the order a screen reader follows.
- type panels:
- sphinx_autodoc_typehints_type:
\:py\:class\:\list`\ \[:py:class:`tuple`\ \[:py:class:`str`, :py:class:`~scenet.core.PanelCore`]]`
- param panels:
Panel name and compiled core, in reading order.
- type live_text:
- sphinx_autodoc_typehints_type:
\:py\:class\:\bool``
- param live_text:
Emit lettering as
<text>rather than glyph outlines.- type debug:
- sphinx_autodoc_typehints_type:
\:py\:class\:\bool``
- param debug:
Place each panel’s diagnostic overlay instead of the panel itself, in exactly the same positions, so a sequence can be debugged as a sequence.
live_textdoes not apply: the overlay labels in plain text already.- type fonts:
- sphinx_autodoc_typehints_type:
\:py\:class\:\~collections.abc.Mapping`\ \[:py:class:`str`, :py:class:`~scenet.solve.text.FontMetrics`] | :sphinx_autodoc_typehints_constant:`None``
- param fonts:
The declared fonts the panels were lettered in, by digest – what
- attr:
Book.fonts <scenet.pipeline.Book.fonts>holds.
- type aria:
- sphinx_autodoc_typehints_type:
\:py\:class\:\bool``
- param aria:
Make the strip a named group of panels, each one image a screen reader reads whole, in reading order; its background hidden.
Falsewrites none of it. An overlay is a diagnostic, and never has it.- type embed:
- sphinx_autodoc_typehints_type:
\:py\:class\:\~collections.abc.Mapping`\ \[:py:class:`str`, :py:class:`bytes`] | :sphinx_autodoc_typehints_constant:`None``
- param embed:
The supplied pictures’ bytes, by digest – what
- attr:
Book.images <scenet.pipeline.Book.images>holds – to write into the SVG. Left out, each picture is linked by the path its document wrote.
- rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
- returns:
One SVG document holding every panel.
- raises ValueError:
There are no panels, or they are not all read the same way.
.. py:function:: placed_panel(name, core, position, x, y, *, live_text=False, debug=False, fonts=None, holes=(), aria=True, embed=None)
- module:
scenet.emit.strip
One panel, rendered on its own and put at
(x, y)in a larger document.Shared by the strip and the page, so both place a panel the same way: clipped to its frame, and with every id prefixed by the panel’s position in the document – see the module docstring for why position and not name.
- type name:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
- param name:
The panel’s name, kept as the group’s id.
- type core:
- sphinx_autodoc_typehints_type:
\:sphinx\_autodoc\_typehints\_alias\:\a592aeeae3b787d7``
- param core:
The compiled panel.
- type position:
- sphinx_autodoc_typehints_type:
\:py\:class\:\int``
- param position:
Its one-based position in the document, unique within it.
- type x:
- sphinx_autodoc_typehints_type:
\:py\:class\:\float``
- param x:
Where its left edge goes.
- type y:
- sphinx_autodoc_typehints_type:
\:py\:class\:\float``
- param y:
Where its top edge goes.
- type live_text:
- sphinx_autodoc_typehints_type:
\:py\:class\:\bool``
- param live_text:
Emit lettering as
<text>rather than glyph outlines.- type debug:
- sphinx_autodoc_typehints_type:
\:py\:class\:\bool``
- param debug:
Place the panel’s diagnostic overlay instead of the panel.
- type fonts:
- sphinx_autodoc_typehints_type:
\:py\:class\:\~collections.abc.Mapping`\ \[:py:class:`str`, :py:class:`~scenet.solve.text.FontMetrics`] | :sphinx_autodoc_typehints_constant:`None``
- param fonts:
The declared fonts the panel was lettered in, by digest.
- type holes:
- sphinx_autodoc_typehints_type:
\:py\:class\:\~collections.abc.Sequence`\ \[:py:class:`~scenet.core.Box`]`
- param holes:
Areas cut out of it, in its own units: on a page, the rings of the insets set into it, which are drawn over it. Each is a clip of its own, nested inside the frame’s, so the clips intersect and two rings that touch need no geometry.
- type aria:
- sphinx_autodoc_typehints_type:
\:py\:class\:\bool``
- param aria:
Make the panel’s group the image a screen reader reads, named as
- func:
accessible_name <scenet.emit.svg.accessible_name>names a panel. Never on an overlay.
- type embed:
- sphinx_autodoc_typehints_type:
\:py\:class\:\~collections.abc.Mapping`\ \[:py:class:`str`, :py:class:`bytes`] | :sphinx_autodoc_typehints_constant:`None``
- param embed:
The supplied pictures’ bytes, by digest, to write into the SVG.
- rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\list`\ \[:py:class:`str`]`
- returns:
The lines of SVG, indented for the document’s top level.
scenet.emit.page#
.. py:module:: scenet.emit.page
Pages into SVG: every panel at its frame.
Mechanical, like every emitter: the frames were resolved into Page Core and each panel into
its own Panel Core, so this only places one inside the other. Each panel is placed exactly
as the strip places one (:func:placed_panel <scenet.emit.strip.placed_panel>): rendered on
its own, clipped to its frame, its ids prefixed by its position so they stay unique in the
page.
For a screen reader, a page is a named group and each panel in it one image, in reading order; the page’s own shapes – its sheet, an inset’s ring – are hidden.
.. py:function:: render_page(page, panels, *, live_text=False, debug=False, fonts=None, aria=True, embed=None)
- module:
scenet.emit.page
Render one page as a standalone SVG document.
- type page:
- sphinx_autodoc_typehints_type:
\:sphinx\_autodoc\_typehints\_alias\:\6bf6aaa17b5c12f7``
- param page:
The page: its size and where each panel’s frame is.
- type panels:
- sphinx_autodoc_typehints_type:
\:py\:class\:\~collections.abc.Mapping`\ \[:py:class:`str`, :py:class:`~scenet.core.PanelCore`]`
- param panels:
Every panel’s compiled Core, by name. Each one named by a frame must be here, compiled at that frame’s size.
- type live_text:
- sphinx_autodoc_typehints_type:
\:py\:class\:\bool``
- param live_text:
Emit lettering as
<text>rather than glyph outlines.- type debug:
- sphinx_autodoc_typehints_type:
\:py\:class\:\bool``
- param debug:
Place each panel’s diagnostic overlay instead of the panel.
- type fonts:
- sphinx_autodoc_typehints_type:
\:py\:class\:\~collections.abc.Mapping`\ \[:py:class:`str`, :py:class:`~scenet.solve.text.FontMetrics`] | :sphinx_autodoc_typehints_constant:`None``
- param fonts:
The declared fonts the panels were lettered in, by digest – what
- attr:
Book.fonts <scenet.pipeline.Book.fonts>holds.
- type aria:
- sphinx_autodoc_typehints_type:
\:py\:class\:\bool``
- param aria:
Make the page a named group of panels a screen reader reads in order.
Falsewrites none of it. An overlay never has it.- type embed:
- sphinx_autodoc_typehints_type:
\:py\:class\:\~collections.abc.Mapping`\ \[:py:class:`str`, :py:class:`bytes`] | :sphinx_autodoc_typehints_constant:`None``
- param embed:
The supplied pictures’ bytes, by digest – what
- attr:
Book.images <scenet.pipeline.Book.images>holds – to write into the SVG. Left out, each picture is linked by the path its document wrote.
- rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
- returns:
The page, as SVG.
- raises ValueError:
A frame names a panel that
panelsdoes not hold.
.. admonition:: Example
from scenet import compile_book, render_page book = compile_book( … “cast: {a: {reference: alice}}\n” … “pages: [{tiers: [{panels: [one]}]}]\npanels: {one: {}}” … ) cores = {name: result.core for name, result in book.panels.items()} ‘viewBox=”0 0 2000 3000”’ in render_page(book.pages[0], cores) True
.. py:function:: render_pages(pages, panels, *, live_text=False, debug=False, fonts=None, aria=True, embed=None)
- module:
scenet.emit.page
Render every page side by side, as one SVG document.
What a single view shows – the playground’s, for one. Each page sits in a group
page-<n>, and panel positions count on across pages, so every id in the document stays unique.- type pages:
- sphinx_autodoc_typehints_type:
\:py\:class\:\~collections.abc.Sequence`\ \[:py:class:`~scenet.core.PageCore`]`
- param pages:
The pages, in order.
- type panels:
- sphinx_autodoc_typehints_type:
\:py\:class\:\~collections.abc.Mapping`\ \[:py:class:`str`, :py:class:`~scenet.core.PanelCore`]`
- param panels:
Every panel’s compiled Core, by name.
- type live_text:
- sphinx_autodoc_typehints_type:
\:py\:class\:\bool``
- param live_text:
Emit lettering as
<text>rather than glyph outlines.- type debug:
- sphinx_autodoc_typehints_type:
\:py\:class\:\bool``
- param debug:
Place each panel’s diagnostic overlay instead of the panel.
- type fonts:
- sphinx_autodoc_typehints_type:
\:py\:class\:\~collections.abc.Mapping`\ \[:py:class:`str`, :py:class:`~scenet.solve.text.FontMetrics`] | :sphinx_autodoc_typehints_constant:`None``
- param fonts:
The declared fonts the panels were lettered in, by digest – what
- attr:
Book.fonts <scenet.pipeline.Book.fonts>holds.
- type aria:
- sphinx_autodoc_typehints_type:
\:py\:class\:\bool``
- param aria:
Make the document a named group of pages, each a named group of panels a screen reader reads in order.
Falsewrites none of it.- type embed:
- sphinx_autodoc_typehints_type:
\:py\:class\:\~collections.abc.Mapping`\ \[:py:class:`str`, :py:class:`bytes`] | :sphinx_autodoc_typehints_constant:`None``
- param embed:
The supplied pictures’ bytes, by digest – what
- attr:
Book.images <scenet.pipeline.Book.images>holds – to write into the SVG. Left out, each picture is linked by the path its document wrote.
- rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
- returns:
Every page, side by side, as SVG – left to right, or for pages read right to left (#68), from the right, as a manga’s spread opens. They are written in reading order.
- raises ValueError:
There are no pages, a frame names a panel
panelsdoes not hold, or the pages are not all read the same way.
scenet.emit.conditioning#
.. py:module:: scenet.emit.conditioning
What the exports for image models share: the canvas, fractions of it, and the JSON (#72).
The exports hand a panel’s staging to whatever a reader feeds it to – ControlNet, GLIGEN, a tool of their own. No model runs in Scenet: each export is another emitter, reading Panel Core and nothing else, as deterministic and as explicable as the SVG.
Everything is said on the panel’s own canvas: one pixel per panel unit, rounded up to whole pixels. A box is said as fractions of the panel, which is what box-conditioned models take.
.. py:data:: FRACTION_PLACES
- module:
scenet.emit.conditioning
- value:
4
a tenth of a unit on a panel 1000 wide.
- type:
Decimal places of a fraction of the panel
.. py:class:: Region
- module:
scenet.emit.conditioning
Bases: :py:class:
objectOne region a map export fills: what the panel’s geometric contract names.
An actor’s hull – where staging put it, not the mannequin Scenet draws it as, so a model is told where a character is and the pose how it stands – a mass’s polygon, or a figure’s body and face as its picture’s contract declares them.
.. attribute:: id
The id the panel’s SVG gives it:
actor-alice,mass-m0,figure-ana.- type:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
.. attribute:: polygon
The outline. Empty for a figure whose contract declares no body.
- type:
- sphinx_autodoc_typehints_type:
\:py\:class\:\tuple`\ \[:py:class:`tuple`\ \[:py:class:`float`, :py:class:`float`], :py:data:`…<Ellipsis>`]`
.. attribute:: disc
A figure’s face, which joins its body. None for anything else.
- type:
- sphinx_autodoc_typehints_type:
\:py\:class\:\~scenet.core.Disc` | :sphinx_autodoc_typehints_constant:`None``
.. attribute:: depth
Painter’s order, as Panel Core records it. None for a figure, which has none of its own.
- type:
- sphinx_autodoc_typehints_type:
\:py\:class\:\int` | :sphinx_autodoc_typehints_constant:`None``
.. attribute:: sky
Whether it is sky, which is at infinity whatever plane it was filed under.
- type:
- sphinx_autodoc_typehints_type:
\:py\:class\:\bool``
.. attribute:: who
The character it is, for an actor or a figure: the actor’s id, or the part a figure plays – or, uncast, its own name. None for a mass.
- type:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str` | :sphinx_autodoc_typehints_constant:`None``
.. py:attribute:: Region.id
- module:
scenet.emit.conditioning
- type:
str
.. py:attribute:: Region.polygon
- module:
scenet.emit.conditioning
- type:
tuple[tuple[float, float], …]
.. py:attribute:: Region.disc
- module:
scenet.emit.conditioning
- type:
~scenet.core.Disc | None
.. py:attribute:: Region.depth
- module:
scenet.emit.conditioning
- type:
int | None
.. py:attribute:: Region.sky
- module:
scenet.emit.conditioning
- type:
bool
.. py:attribute:: Region.who
- module:
scenet.emit.conditioning
- type:
str | None
.. py:method:: Region.init(id, polygon, disc=None, depth=None, sky=False, who=None)
- module:
scenet.emit.conditioning
.. py:function:: canvas(core)
- module:
scenet.emit.conditioning
The panel as an image: one pixel per panel unit, rounded up to whole pixels.
.. admonition:: Example
from scenet import compile_source canvas( … compile_source(“{panel: {size: [600.5, 400]}, cast: {a: {reference: alice}}}”).core … ) (601, 400)
- sphinx_autodoc_typehints_rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\tuple`\ \[:py:class:`int`, :py:class:`int`]`
.. py:function:: drawn_at(core, point)
- module:
scenet.emit.conditioning
Whether a point is inside what the panel draws: the frame, edge included.
A panel in a slanted tier is drawn clipped to its
outline, so outside the outline is outside the panel. An inset over it is not: the panel’s art is drawn under it as usual.- sphinx_autodoc_typehints_rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\bool``
.. py:function:: figure_extent(figure)
- module:
scenet.emit.conditioning
What a figure a picture draws covers: its body, and its face.
A contract may declare a body without the head, or no body at all, and the face is always there: its bounding square joins whatever body there is.
- sphinx_autodoc_typehints_rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\tuple`\ \[:py:class:`tuple`\ \[:py:class:`float`, :py:class:`float`], :py:data:`…<Ellipsis>`]`
.. py:function:: flat_map(core, fills)
- module:
scenet.emit.conditioning
An SVG of flat fills on black, on the panel’s canvas, clipped as the panel is.
Black is nothing: the paper, the sky, a supplied picture whose content the compiler never saw. A panel in a slanted tier is clipped to its outline; an inset over it is not there, since the panel’s art is drawn under it as usual.
Edges are crisp,
shape-rendering="crispEdges": an antialiased edge would blend two regions into a colour, or a grey, that belongs to neither. The map is the pose’s and the boxes’ canvas – the panel rounded up to whole pixels, one unit to a pixel – so every export is on one pixel grid. Nothing is stretched: what lies past the panel’s own edge, under a pixel wide, is black, which is nothing.- type core:
- sphinx_autodoc_typehints_type:
\:sphinx\_autodoc\_typehints\_alias\:\1d07ba785947ef61``
- param core:
The panel.
- type fills:
- sphinx_autodoc_typehints_type:
\:py\:class\:\~collections.abc.Sequence`\ \[:py:class:`tuple`\ \[:py:class:`~scenet.emit.conditioning.Region`, :py:class:`str`]]`
- param fills:
Each region and what it is filled with, in drawing order.
- rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
- returns:
The document.
.. py:function:: fraction_box(core, points)
- module:
scenet.emit.conditioning
The bounds of what the panel draws of a shape, as
[xmin, ymin, xmax, ymax]fractions.The shape is the convex hull of the points – a hull, a body, a box – cut to what the panel draws: its frame, or a slanted tier’s outline. What lies outside is not in the picture, so a body wider below the frame is bounded where the frame cuts it.
- type core:
- sphinx_autodoc_typehints_type:
\:sphinx\_autodoc\_typehints\_alias\:\1d07ba785947ef61``
- param core:
The panel the fractions are of.
- type points:
- sphinx_autodoc_typehints_type:
\:py\:class\:\~collections.abc.Iterable`\ \[:py:class:`tuple`\ \[:py:class:`float`, :py:class:`float`]]`
- param points:
What to bound.
- rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\list`\ \[:py:class:`float`] | :sphinx_autodoc_typehints_constant:`None``
- returns:
The box, or None when nothing of it with any area is inside the panel.
.. py:function:: regions(core)
- module:
scenet.emit.conditioning
Every region of the panel, in the order the panel draws them: back to front.
Masses and actors in the panel’s own painter’s order, then the figures a picture draws, which are over the picture and under nothing, in the order their contract declares them. Marks and sound effects are none of them: they are drawn around a figure, not part of it.
- sphinx_autodoc_typehints_rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\list`\ \[:py:class:`~scenet.emit.conditioning.Region`]`
.. py:function:: to_json(payload)
- module:
scenet.emit.conditioning
Write a document exactly as Panel Core is written: sorted keys, two spaces, LF.
- sphinx_autodoc_typehints_rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
scenet.emit.pose#
.. py:module:: scenet.emit.pose
Each actor’s skeleton as OpenPose JSON, for pose-conditioned image models (#72).
The OpenPose output format
as ControlNet’s tooling reads it: people[].pose_keypoints_2d, flat x, y, confidence
triplets in the COCO-18 body order, in pixels of a canvas canvas_width by canvas_height.
Left and right. Scenet names a joint by the side of the screen it is on in the puppet’s
rest pose, and mirrors a figure facing left; OpenPose names a point by the subject’s own side.
Every Scenet body faces the reader, turned one way or the other, and a body facing the reader
has its right on the reader’s left. So the subject’s right is _l on a figure facing right and
_r on one facing left – on the reader’s left either way.
A point is missing – 0, 0, 0, as OpenPose writes a part it did not detect – when the puppet
has no joint or feature by that name, when it is outside what the panel draws, and always for
the ears, which no puppet draws. root, spine and head have no COCO-18 counterpart.
Figures a picture draws were never posed and have no skeleton, so they are not in people.
.. py:data:: COCO_18
- module:
scenet.emit.pose
- type:
tuple[str, …]
- value:
(‘nose’, ‘neck’, ‘right_shoulder’, ‘right_elbow’, ‘right_wrist’, ‘left_shoulder’, ‘left_elbow’, ‘left_wrist’, ‘right_hip’, ‘right_knee’, ‘right_ankle’, ‘left_hip’, ‘left_knee’, ‘left_ankle’, ‘right_eye’, ‘left_eye’, ‘right_ear’, ‘left_ear’)
The COCO-18 body points, in OpenPose’s order.
.. py:data:: SOURCES
- module:
scenet.emit.pose
- type:
tuple[tuple[str, str] | None, …]
- value:
((‘features’, ‘nose’), (‘joints’, ‘neck’), (‘joints’, ‘shoulder_{R}’), (‘joints’, ‘elbow_{R}’), (‘joints’, ‘wrist_{R}’), (‘joints’, ‘shoulder_{L}’), (‘joints’, ‘elbow_{L}’), (‘joints’, ‘wrist_{L}’), (‘joints’, ‘hip_{R}’), (‘joints’, ‘knee_{R}’), (‘joints’, ‘ankle_{R}’), (‘joints’, ‘hip_{L}’), (‘joints’, ‘knee_{L}’), (‘joints’, ‘ankle_{L}’), (‘features’, ‘eye_{R}’), (‘features’, ‘eye_{L}’), None, None)
a joint or a face feature,
{R}the suffix of the subject’s right and{L}of their left. None for a point no puppet has.- type:
Where each point comes from
.. py:function:: keypoints(core, actor)
- module:
scenet.emit.pose
One actor as COCO-18: fifty-four numbers,
x, y, confidenceper point.- type core:
- sphinx_autodoc_typehints_type:
\:sphinx\_autodoc\_typehints\_alias\:\bd6d3cc4def5b00b``
- param core:
The panel, whose frame and outline decide what is drawn.
- type actor:
- sphinx_autodoc_typehints_type:
\:sphinx\_autodoc\_typehints\_alias\:\6c5bfc2d9d79bcb0``
- param actor:
The actor.
- rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\list`\ \[:py:class:`float`]`
- returns:
The flat triplets, a missing point as
0, 0, 0and any other at confidence 1.
.. py:function:: render_pose(core)
- module:
scenet.emit.pose
Every actor’s pose as OpenPose JSON.
One person per actor, in Panel Core’s order – the order the semantics export lists the actors in – so
people[i]is the i-th actor. Coordinates are pixels of the panel’s canvas, as OpenPose writes them; a tool that wants fractions divides by the canvas size.- type core:
- sphinx_autodoc_typehints_type:
\:sphinx\_autodoc\_typehints\_alias\:\bd6d3cc4def5b00b``
- param core:
The compiled panel.
- rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
- returns:
The document, written as Panel Core is.
scenet.emit.boxes#
.. py:module:: scenet.emit.boxes
Each figure’s extent with a phrase, for box-conditioned image models (#72).
“This entity, here”, as GLIGEN takes it: a phrase and a box per actor and per figure a picture
draws, the box as [xmin, ymin, xmax, ymax] fractions of the panel – what diffusers’ GLIGEN
pipeline reads as gligen_boxes, beside the phrases as gligen_phrases.
An actor’s box is its hull’s bounds: the silhouette staging spaced the cast by, which leaves emanata out so that a figure who starts sweating does not move. A figure’s is its body and face as the picture’s contract declares them. Each is clipped to the panel, and one wholly outside it has no box.
The phrase is the description’s own words for a figure (:func:traits <scenet.solve.describe.traits>): its name, how it stands, its face, its marks. Where it is on
the panel is the box’s to say.
.. py:function:: render_boxes(core)
- module:
scenet.emit.boxes
Every actor’s and figure’s box and phrase, as JSON.
Actors first, in Panel Core’s order, then figures a picture draws, cast or not.
- type core:
- sphinx_autodoc_typehints_type:
\:sphinx\_autodoc\_typehints\_alias\:\1fc13e98f05151a7``
- param core:
The compiled panel.
- rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
- returns:
The document, written as Panel Core is.
scenet.emit.semantics#
.. py:module:: scenet.emit.semantics
What a panel holds, as structure, for whatever writes a prompt from it (#72).
Not a prompt. Prompt dialects differ per model and change every few months, and turning structure into prose is the language step that prior art leaves to whatever is in the loop, not to a compiler. So this hands over the structure: the camera, the setting, every actor – reference, pose, expression, marks, facing, whom they look at, depth – every figure a picture draws, and every balloon, caption and sound effect in reading order with its box.
Where Panel Core already has words, they are copied, never phrased again: the panel’s
description and each entry’s label, which accessible output reads (#76).
Each actor and figure also carries its mask colour: the mask export’s own, taken from its code
rather than worked out again, so a tool can map a colour of the mask to a character without
parsing the SVG. The two cannot disagree – and so a change to how the mask is coloured changes
this export too.
.. py:function:: render_semantics(core)
- module:
scenet.emit.semantics
What the panel holds, as JSON.
Actors are listed in Panel Core’s order, the order the pose export lists people in. Facing is read from the mirror: a mirrored puppet faces left. Each actor and figure has its mask colour.
- type core:
- sphinx_autodoc_typehints_type:
\:sphinx\_autodoc\_typehints\_alias\:\6ef875278284bb7c``
- param core:
The compiled panel.
- rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
- returns:
The document, written as Panel Core is.
scenet.emit.depth#
.. py:module:: scenet.emit.depth
A panel’s planes as a depth map, for depth-conditioned image models (#72).
Scenet is orthographic and has no metric depth. What it has is a painter’s order – an integer
depth actors and masses share – so the map is flat grey planes in that order, and claims
nothing more: the steps are ranks, not distances.
ControlNet’s depth maps run white near, black far. That is the reverse of the backdrop’s own value ladder, where aerial perspective makes far planes paler, so none of those tones is reused: a model handed them would read the panel inside out.
Black is nothing nearer than infinity: the paper, the sky (whatever plane it was filed under, as its tone already treats it), and a supplied picture, whose content the compiler never saw.
Every other depth present, ranked far to near, is one even step paler, so the frontmost is white.
Figures a picture draws have no painter’s order of their own. They share one plane, in front of the picture they are drawn against.
.. py:function:: grey(value)
- module:
scenet.emit.depth
A grey of one value,
#rrggbb... admonition:: Example
grey(255), grey(0) (‘#ffffff’, ‘#000000’)
- sphinx_autodoc_typehints_rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
.. py:function:: render_depth(core)
- module:
scenet.emit.depth
The panel’s planes as grey on black, white nearest.
- type core:
- sphinx_autodoc_typehints_type:
\:sphinx\_autodoc\_typehints\_alias\:\400a884c8812a004``
- param core:
The compiled panel.
- rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
- returns:
An SVG the panel’s size, its regions in the panel’s own painter’s order.
scenet.emit.mask#
.. py:module:: scenet.emit.mask
A panel’s regions as an instance mask, for region-conditioned image models (#72).
One flat fill per actor, figure and mass, under the id the panel’s SVG gives it – actor-alice,
mass-m0, figure-ana – so a segmentation keeps the labels the panel has. The colour of an id
is read from the SVG itself. Regions are drawn in the panel’s own painter’s order, so what covers
what is what the panel draws, and black is nothing.
A character keeps its colour across panels, unless another character in the same panel has the same hue, in which case the later id (in sorted order) takes the next free one. The hue comes from the id’s digest, one of 64, so a regional prompt or an identity follows a character down the page; a figure a picture draws takes the colour of the part it plays. With 64 hues, two of four characters share one about one panel in ten. Masses take theirs in drawing order from a band of their own – paler, less saturated – so a wall is never mistaken for a character.
This is an instance map, not a class map: two actors are two colours. What each region is – an actor’s puppet, a mass’s kind and plane – is in the semantics export, by the same id.
.. py:data:: CHARACTER_SLOTS
- module:
scenet.emit.mask
- value:
64
hues evenly round the wheel, saturated and bright.
- type:
How many colours a character may take
.. py:data:: GOLDEN
- module:
scenet.emit.mask
- value:
0.6180339887498949
hues stepped by it never repeat and stay far apart.
- type:
The golden ratio’s fractional part
.. py:function:: character_colour(slot)
- module:
scenet.emit.mask
A character’s colour: one of
CHARACTER_SLOTShues, saturated and bright... admonition:: Example
character_colour(0) ‘#ff2626’
- sphinx_autodoc_typehints_rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
.. py:function:: colours(drawn)
- module:
scenet.emit.mask
Each region’s mask colour, in the order given.
Characters are settled in the order of their names, whatever order they are drawn in: each takes its own slot, or the next one no earlier name took.
- sphinx_autodoc_typehints_rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\list`\ \[:py:class:`str`]`
.. py:function:: mass_colour(index)
- module:
scenet.emit.mask
The colour of the mass drawn
index-th: less saturated than any character’s, never dark.Hues step round the wheel by the golden ratio, and every other one is a little darker, so neighbours in drawing order are easy to tell apart.
.. admonition:: Example
mass_colour(0) ‘#d97777’
- sphinx_autodoc_typehints_rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
.. py:function:: render_mask(core)
- module:
scenet.emit.mask
Every region of the panel in its own colour, on black.
- type core:
- sphinx_autodoc_typehints_type:
\:sphinx\_autodoc\_typehints\_alias\:\332f9a40e772c982``
- param core:
The compiled panel.
- rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
- returns:
An SVG on the panel’s canvas, its regions in the panel’s own painter’s order.
.. py:function:: slot_of(name)
- module:
scenet.emit.mask
Where a character’s colour starts: from its name’s digest, the same in every panel.
.. admonition:: Example
slot_of(“alice”) == slot_of(“alice”) True
- sphinx_autodoc_typehints_rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\int``
scenet.emit.export#
.. py:module:: scenet.emit.export
Every export of a panel’s staging for image models, at once (#72).
Five files, each another emitter reading Panel Core alone: the pose as OpenPose JSON, boxes with phrases, a stepped depth map, an instance mask, and the semantics as structure. No model runs in Scenet – what a reader feeds these to is outside the pipeline, as a tracing over the SVG would be – and nothing is rasterised: text, JSON and SVG only, each byte-identical across runs and platforms.
.. py:data:: EXPORTS
- module:
scenet.emit.export
- type:
tuple[tuple[str, ~collections.abc.Callable[[~scenet.core.PanelCore], str]], …]
- value:
((‘.pose.json’,
), (‘.boxes.json’, ), (‘.depth.svg’, ), (‘.mask.svg’, ), (‘.semantics.json’, ))
Each export, by the suffix its file takes after the panel’s own name, in the order
scenet build --conditioningwrites them – which is also the order of the fields of- class:
Conditioning <scenet.emit.export.Conditioning>, the one place it is written.
.. py:class:: Conditioning
- module:
scenet.emit.export
Bases: :py:class:
objectA panel’s staging, exported for image models.
.. attribute:: pose
Each actor’s skeleton, OpenPose COCO-18 JSON.
- type:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
.. attribute:: boxes
Each actor’s and figure’s box and phrase, GLIGEN style.
- type:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
.. attribute:: depth
The panel’s planes as grey on black, white nearest, as SVG.
- type:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
.. attribute:: mask
Each actor, figure and mass in its own colour, as SVG.
- type:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
.. attribute:: semantics
What the panel holds, as JSON – structure, not a prompt.
- type:
- sphinx_autodoc_typehints_type:
\:py\:class\:\str``
.. py:attribute:: Conditioning.pose
- module:
scenet.emit.export
- type:
str
.. py:attribute:: Conditioning.boxes
- module:
scenet.emit.export
- type:
str
.. py:attribute:: Conditioning.depth
- module:
scenet.emit.export
- type:
str
.. py:attribute:: Conditioning.mask
- module:
scenet.emit.export
- type:
str
.. py:attribute:: Conditioning.semantics
- module:
scenet.emit.export
- type:
str
.. py:method:: Conditioning.files()
- module:
scenet.emit.export
Each export by the suffix its file takes, in the order
buildwrites them... admonition:: Example
from scenet import compile_source, render_conditioning exports = render_conditioning( … compile_source(“{cast: {a: {reference: alice}}}”).core … ) [suffix for suffix, _ in exports.files()] [‘.pose.json’, ‘.boxes.json’, ‘.depth.svg’, ‘.mask.svg’, ‘.semantics.json’]
- sphinx_autodoc_typehints_rtype:
- sphinx_autodoc_typehints_type:
\:py\:class\:\tuple`\ \[:py:class:`tuple`\ \[:py:class:`str`, :py:class:`str`], :py:data:`…<Ellipsis>`]`
.. py:method:: Conditioning.init(pose, boxes, depth, mask, semantics)
- module:
scenet.emit.export
.. py:function:: render_conditioning(core)
- module:
scenet.emit.export
Export a panel’s staging for image models: pose, boxes, depth, mask and semantics.
- type core:
- sphinx_autodoc_typehints_type:
\:sphinx\_autodoc\_typehints\_alias\:\da496361c42ec32b``
- param core:
The compiled panel.
- rtype:
- sphinx_autodoc_typehints_type:
\:sphinx\_autodoc\_typehints\_alias\:\6498e4fd8eb1216a``
- returns:
The five exports, as text.
.. admonition:: Example
from scenet import compile_source, render_conditioning exports = render_conditioning(compile_source(“{cast: {a: {reference: alice}}}”).core) ‘id=”actor-a”’ in exports.mask, exports.depth.count(‘fill=”#ffffff”’) (True, 1)