Talos docs

POST /capture

Since 0.6
Plain text

Request

Request body: CaptureRequest

POST /capture request. The kind field picks the variant.

ValueMeaning
frameOne frame from the scene's active camera. argus_capture::frame.
clipA run of frames. argus_capture::clip.
atOne frame from an arbitrary eye point. argus_capture::at.
viewsThe four canonical views of one entity: front, side, top, iso. argus_capture::views.
materialOne material on a preview shape under the scene's sky, sun and look, without placing it.

Response

Response: CaptureResponse

POST /capture JSON response: one or more frames.

FieldTypePresentDescription
kindstringalwaysWhich request kind produced this: frame, clip, at, or views.
framesCapturedFrame[]alwaysThe captured frames, in capture order.
elapsed_msnumberalwaysWall-clock milliseconds the whole capture took, measured on the sim thread.

Response: CapturedFrame

One captured frame.

FieldTypePresentDescription
frame_indexintegeralwaysThe frame this image was rendered at.
viewstringsometimesWhich of the four canonical views this is, for a views capture: front, side, top, iso. Absent for every other kind.
widthintegeralwaysImage width in pixels.
heightintegeralwaysImage height in pixels.
pngstringalwaysThe colour buffer, PNG, base64 (standard alphabet, padded).
depthstringsometimesLinear depth, 0 at the near plane and 1 at the far plane: base64 of width * height little-endian f32s, row-major. Present only when buffers.depth was set.
idsstringsometimesThe entity id buffer: base64 of width * height little-endian u32s, row-major. Present only when buffers.ids was set.
cameraCameraViewalwaysThe camera this frame was taken through.
perfCapturePerfalwaysWhat this capture cost.

Response: CameraView

The camera a frame was taken through.

FieldTypePresentDescription
eyenumber[3]alwaysEye position in world space.
targetnumber[3]alwaysThe point the camera looks at.
upnumber[3]alwaysThe camera's up vector.
fovYnumberalwaysVertical field of view in radians.
nearnumberalwaysNear clip distance in metres.
farnumberalwaysFar clip distance in metres.
orthonumbersometimesSet when the frame was orthographic: half the view's height in world units. Every ray is then parallel to the view direction and fovY does not apply; absent for a perspective frame.
armCameraArmViewsometimesA third-person or orbit rig's boom when the frame was taken through one: its length, whether a wall collapsed it and the character fade. On a frame capture of the live camera only — absent from at, views and clip frames, and whenever no arm rig is active.

Response: CapturePerf

What one capture cost. Mirrors argus_capture::FramePerf.

FieldTypePresentDescription
render_msnumberalwaysTime submitting the render passes.
readback_msnumberalwaysTime reading the buffers back off the GPU.
encode_msnumberalwaysTime encoding the PNG.
total_msnumberalwaysTotal for this frame: render plus readback plus encode.
draw_callsintegeralwaysDraw calls submitted for this capture, overlay passes included.
instancesintegeralwaysInstances submitted in the opaque pass.
trianglesintegeralwaysTriangles submitted in the opaque pass.
overlay_verticesintegeralwaysVertices submitted by the overlay passes.

Example

curl -X POST "http://127.0.0.1:7700/capture" --json @body.json

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.