⌂ Modules tecs tecs.gfx tecs.gfx.screenshot tecs.gfx.screenshot
Capture the next presented frame, including UI and post-processing.
request() queues one readback. Check capture.ready in a later update before calling pixels, encode, or save. Only requested frames allocate readback storage or wait for the GPU. RGBA pixels run top to bottom; captures are opaque, matching the displayed image rather than the composite target's internal alpha.
Module contents Types Type Kind Description Capturerecord A requested frame.
Functions Function Kind Description cancelPendingfunction Releases outstanding requests when the host session closes. completefunction Completes a host readback and releases the registry's reference. encodefunction Returns PNG bytes, or nil and a pending/readback failure reason. nextRequestfunction Consumes a queued request for the rendering host. pixelsfunction Returns top-to-bottom RGBA8 bytes, width, height and an optional failure. requestfunction Requests the next rendered frame; poll ready from subsequent updates. savefunction Writes the completed frame as PNG; returns false and a reason on failure.
Types
Capturerecord
record Capture
ready : boolean
end
A requested frame. The host completes it after rendering.
Fields
ready
Read-only to callers. True after completion, including failure.
Functions
cancelPendingfunction
function cancelPending ( ) : nil
Releases outstanding requests when the host session closes.
Returns
completefunction
function complete ( id : integer , width : integer , height : integer , rgba : string , png : string , reason : string ? ) : nil
Completes a host readback and releases the registry's reference.
Arguments Name Type Description idinteger widthinteger heightinteger rgbastring pngstring reasonstring ?
Returns
encodefunction
function encode ( capture : Capture ) : string ? , string ?
Returns PNG bytes, or nil and a pending/readback failure reason.
Arguments
Returns Type Description string ? string ?
nextRequestfunction
function nextRequest ( ) : integer ?
Consumes a queued request for the rendering host.
Returns
pixelsfunction
function pixels ( capture : Capture ) : string ? , integer , integer , string ?
Returns top-to-bottom RGBA8 bytes, width, height and an optional failure.
Arguments
Returns Type Description string ? integer integer string ?
requestfunction
Requests the next rendered frame; poll ready from subsequent updates.
Returns
savefunction
function save ( capture : Capture , path : string ) : boolean , string ?
Writes the completed frame as PNG; returns false and a reason on failure.
Arguments Name Type Description captureCapture pathstring
Returns Type Description boolean string ?
← Previous tecs.gfx.particles Next → tecs.gfx.sheet