RenderResult
Result of a render_png() call: the PNG image bytes plus
the world↔pixel transform metadata needed to map between design (micron) and
image (pixel) coordinates.
Experimental
The rendering API (render_png / RenderResult) is evolving. Property shapes
(notably the view metadata) and method signatures may change without notice.
from rosette import render_png
result = render_png(library, width=1024)
png_bytes = result.png
x, y = result.px_to_world(512, 256)Attributes
attributepngbytesPNG-encoded image bytes.
attributeviewdict[str, object]World↔pixel transform metadata (scale, offsets, canvas size, and the visible
world bbox in microns). See the binding stubs in python/rosette/_core.pyi for
the current key set, which may change.
attributelayers_renderedlist[tuple[int, int]](layer, datatype) pairs that contributed pixels, in draw order.
Methods
funcpx_to_world(px, py) -> tuple[float, float]Convert a pixel coordinate in the rendered image back to design (micron) coordinates.
Returns
tuple[float, float]funcworld_to_px(x, y) -> tuple[float, float]Convert design (micron) coordinates to a pixel position in the rendered image.
Returns
tuple[float, float]