Screenshot-export concern extracted from recording-panel.ts.
Three pure-ish helpers that the recording panel composes:
renderFrameToCanvas — read the post-processed framebuffer
into a 2D canvas and (optionally) composite overlays. Used by
both the screenshot path and the offline-capture loops in
video / turntable modes.
encodeScreenshotBlob — pick the right MIME type, fall back
from JPEG to PNG when transparency is required, and produce
the encoded Blob via canvas.toBlob.
downloadBlob — trigger the standard "download a blob" flow
by creating an invisible <a> element with an object URL.
The state-machine parts of captureScreenshot (panel hide/show,
DPR override, save/restore recording state) stay in the panel
because they're tightly coupled to its mode tracking.
Screenshot-export concern extracted from
recording-panel.ts.Three pure-ish helpers that the recording panel composes:
renderFrameToCanvas— read the post-processed framebuffer into a 2D canvas and (optionally) composite overlays. Used by both the screenshot path and the offline-capture loops in video / turntable modes.encodeScreenshotBlob— pick the right MIME type, fall back from JPEG to PNG when transparency is required, and produce the encoded Blob viacanvas.toBlob.downloadBlob— trigger the standard "download a blob" flow by creating an invisible<a>element with an object URL.The state-machine parts of captureScreenshot (panel hide/show, DPR override, save/restore recording state) stay in the panel because they're tightly coupled to its mode tracking.