9.3
125 3D: Frame requests and results
struct
(struct render3d-request ( compiled-view frame-spec attachments cancellation-token color-context) #:transparent) compiled-view : compiled-view3d? frame-spec : frame3d-spec? attachments : (listof symbol?) cancellation-token : any/c color-context : any/c
One backend-local request. The cancellation field is either #f or the
preview’s cooperative cancellation token; it is not serialised into scene
state.
struct
(struct renderer3d-render-result (artifact) #:transparent) artifact : renderer3d-frame-artifact?
A completed backend-independent frame. The artifact is its only frame payload
and may outlive the backend that produced it.
struct
(struct renderer3d-frame-artifact ( width height straight-argb linear-depth-snapshot object-id-snapshot normal-snapshot camera diagnostics) #:transparent) width : exact-positive-integer? height : exact-positive-integer? straight-argb : (or/c #f bytes?) linear-depth-snapshot : (or/c #f vector?) object-id-snapshot : (or/c #f vector?) normal-snapshot : (or/c #f vector?) camera : camera3d? diagnostics : any/c
The immutable attachment owner for a completed frame. Pixel snapshots are
top-left-origin. Linear depth is positive camera-space depth; an uncovered
pixel is +inf.0.
procedure
(renderer3d-frame-artifact-attachments artifact)
→ (listof symbol?) artifact : renderer3d-frame-artifact?
Returns the canonical set of attachments actually
present in artifact.
procedure
(renderer3d-frame-linear-depth-at artifact x y) → (or/c #f real?) artifact : renderer3d-frame-artifact? x : exact-nonnegative-integer? y : exact-nonnegative-integer?
Returns the positive linear depth at a top-left
pixel, or #f when the artifact has no depth attachment or the pixel is
outside the viewport.
procedure
(renderer3d-render-result->bitmap result) → bitmap?
result : renderer3d-render-result?
Converts the copied ARGB frame to a Racket bitmap for the
ordinary view3d Pict boundary.