lmvideo reference
Every context object, host function, host type and method of the lmvideo v0.1.124 host, generated from the published schema file schema/lmvideo.dsl.json, plus the command line, the result envelope, exit codes and the standard library the release ships.
The schema records parameter types and return types only. Parameter meanings are given where the repository documentation states them; everything else is listed as a typed signature. The same list is printed by lmvideo --lmcode-signatures.
Surface at a glance
| Item | Count in v0.1.124 |
| Schema format (dsl.schema) | 2 |
| Context objects | 3 (canvas, video, out) |
| Host function names | 74 |
| Host function signatures | 81 |
| Host types | 55 |
| Host method signatures | 524 |
| Standard library signatures (lmcode_std_v3) | 206 (83 functions, 123 methods on 16 types) |
| Total lines of --lmcode-signatures | 814 (3 context, 164 fn, 647 method) |
| Block result type | Json, nullable |
Command line
The host prints this usage line for an unknown option. It is the complete list of top level modes in v0.1.124.
lmvideo --bogus
LMCODE_RETURN_BEGIN
{"ok":false,"phase":"cli","code":"CLI_USAGE","message":"usage: lmvideo --lmcode FILE [--output PATH] [--offline] | --lmcode-schema [--json] | --lmcode-signatures | --version | demo OUT.png | render IN.svg OUT.png\n"}
LMCODE_RETURN_END
| Invocation | What it does |
| lmvideo --version | Prints the version line, for example lmvideo 0.1.124. |
| lmvideo --lmcode-schema | Prints the host schema JSON. The bytes are identical to schema/lmvideo.dsl.json in the repository (SHA-256 97d1643ca2d15ed98ae76acb5a5a4828b8a3509df770b0f395569a2c96c980a2). |
| lmvideo --lmcode-schema --json | Same bytes as above in v0.1.124. This is the form the lmscript compiler calls. |
| lmvideo --lmcode-signatures | Prints one line per context object, function and method, host and standard library together: 814 lines. |
| lmvideo --lmcode FILE | Runs compiled block bytecode and prints the result envelope between LMCODE_RETURN_BEGIN and LMCODE_RETURN_END. run_lmcode does this for you. |
| --output PATH, --offline | Options of the --lmcode mode named in the usage line. The public repository does not describe them further, so they are listed here without semantics. |
| lmvideo demo OUT.png | Writes a built in demonstration picture (500 by 350 pixels in v0.1.124). |
| lmvideo render IN.svg OUT.png [--width W] [--height H] [--background COLOR] | Rasterizes one SVG file to a PNG without any LMScript program. |
| lmvideo render-job DIR [--renderer raster|cycles] [--pass color] [--output OUT.png] | Renders a scene job directory written by Scene3D.save_job. |
| lmvideo render-job-batch DIR [--renderer raster|cycles] [--pass color] [--output DIR] | Renders a directory of frame jobs. Output is written atomically and completed frames survive cancellation. |
| lmvideo render-job --capabilities | Prints accepted job options and bounds as JSON. It does not load or smoke test the renderer. |
lmvideo render-job --capabilities
{"schema":"render-job-capabilities/v1","status":"ok","renderers":["raster","cycles"],"passes":["color"],"max_frames":32,"max_pixels":4194304,"atomic_outputs":true,"cancellation":"renderer callback; completed frames and manifest are retained"}
Outer block attributes
| Attribute | Value used by the repository examples | Meaning |
| cli | lmvideo | Host executable that supplies the schema and runs the block. |
| install | github:lmctl-ai/lmvideo@v0.1.124 | Release that lmscript downloads into its tool cache when the host is not already there. The examples pin the tag for reproducible runs. |
Exit codes and error codes
These were observed by running the v0.1.124 Linux binary and lmscript 0.2.482. The public repository contains no exit code table, so only observed values are listed.
| Command | Situation | Exit code |
| lmvideo --version, --lmcode-schema, --lmcode-signatures | Success | 0 |
| lmvideo demo, lmvideo render, lmvideo render-job --capabilities | Success | 0 |
| lmvideo with an unknown option | Envelope with code CLI_USAGE | 2 |
| lmvideo --lmcode FILE | Bytecode file cannot be read, envelope with code LOAD_BAD_BYTECODE | 3 |
| lmvideo render | Input SVG cannot be opened | 3 |
| lmvideo render-job or render-job-batch without a directory | Usage text | 1 |
| lmscript --check FILE.lms | Block does not compile against the host schema | 2 |
| lmscript FILE.lms | An assert on r.ok fails after a host error | 1 |
| lmscript FILE.lms | Host error that the script inspects without asserting | 0 |
Envelope codes seen from the host
| phase | code | Cause |
| cli | CLI_USAGE | Unknown command line option. |
| load | LOAD_BAD_BYTECODE | The file given to --lmcode cannot be read. |
| load | LOAD_UNBOUND | The program imports a function the host does not provide, for example a rest_ function. |
| run | RUN_HOST | A host call failed, for example video.frame outside begin and end. The envelope carries line and column of the block. |
| app | APP_FAIL | The block called out.fail. The message is the text passed to fail, prefixed with the block line and column. |
Result envelope
run_lmcode returns a value with ok and, on success, result; on failure it carries phase, code, message and, when known, line and column. The result of a successful lmvideo block in v0.1.124 has these fields.
{"ok":true,"result":{"output":["drew 160x100"],"file":"build/dot.png","width":160,"height":100,"frames":1,"fps":30,"bytecode_bytes":1253,"instructions":47,"wall_ms":294,"render_calls":0,"phase_ms":{"compose":41.90718,"post":0.000943,"setup":252.409468},"max_frame_ms":0,"max_render_ms":0}}
| Field | Content |
| output | List of the strings passed to out.print, in order. |
| file, width, height, frames, fps | The output the host reports for the run, with its pixel size, frame count and frame rate. |
| bytecode_bytes, instructions | Size of the compiled block and the number of executed instructions. |
| wall_ms, phase_ms, max_frame_ms, max_render_ms, render_calls | Timing and render counters. They vary from run to run. |
Under --dry-run the envelope is {"ok":true,"result":null,"dry":true} and no host code runs.
Context objects
Three objects exist in every block without being constructed.
| Name | Type | Role |
| canvas | Canvas | The drawing surface of the active video frame, or of the Surface chosen with canvas.target. |
| video | Video | Size, frame rate, frame count, output path and the begin, frame, end lifecycle. |
| out | Output | Text output: print adds a line to result.output, fail stops the block with code APP_FAIL. |
Host functions
74 function names with 81 signatures. Functions are called by bare name inside the block. Several are overloaded; each overload is one row.
2D drawing, text and documents
| Function | Parameters | Returns |
| paint | (none) | Paint |
| path | (none) | Path |
| font | float | Font |
| font_load | string | Typeface |
| font_load | string, string | Typeface |
| font_catalog | (none) | string |
| fonts_used | (none) | string |
| svg | string | Svg |
| svg_file | string | Svg |
| svg_file | string, string | Svg |
| template_svg | string | TemplateSvg |
| surface | int, int | Surface |
| document | int, int | Document |
| pdf_document | float, float | PdfDocument |
| picture_file | string | Picture |
| keyframes | (none) | Keyframes |
| mix | string, string, float | string |
Images, layouts and timelines
| Function | Parameters | Returns |
| image_create | int, int | Image |
| image_create | int, int, string | Image |
| image_create | int, int, float, float, float, float | Image |
| image_file | string | Image |
| image_file | string, string | Image |
| image_bytes | string | Image |
| image_rgba | int, int, string | Image |
| image_pattern | int, int, string, string, string, string | Image |
| image_hald | int | Image |
| image_curve | (none) | Curve |
| image_panel | Image, Image, int | Image |
| image_text_width | string, float | float |
| image_assert_close | float, float, float | void |
| image_assert_true | bool | void |
| layout_create | int, int | Layout |
| layout_sheet | (none) | Layout |
| timeline_create | (none) | Timeline |
| timeline_create | int, int | Timeline |
| frame_cache | string, int | FrameCache |
3D scenes, cameras and meshes
| Function | Parameters | Returns |
| scene3d | (none) | Scene3D |
| scene_job | string | Scene3D |
| camera3d | (none) | Camera3D |
| render_available | string | bool |
| mesh_box | float, float, float | Mesh3D |
| mesh_beveled_box | float, float, float, float | Mesh3D |
| mesh_plane | float, float | Mesh3D |
| mesh_sphere | float, int, int | Mesh3D |
| mesh_cylinder | float, float, int | Mesh3D |
| mesh_cone | float, float, int | Mesh3D |
| mesh_torus | float, float, int, int | Mesh3D |
| mesh_lathe | string, int | Mesh3D |
| mesh_lathe_closed | string, int | Mesh3D |
| mesh_tube_spline | string, float, int, bool | Mesh3D |
| mesh_extrude | string, float | Mesh3D |
| mesh_heightfield | Image, float, float, float | Mesh3D |
| mesh_triangles | string, string | Mesh3D |
| mesh_load | string | Mesh3D |
| mesh_text | Typeface, string, float, float, float | Mesh3D |
| mesh_text_bevel | Typeface, string, float, float, float, float | Mesh3D |
| point_cloud | (none) | PointCloud |
| hair_curves | string, string, string | HairCurves |
Materials, textures and environments
| Function | Parameters | Returns |
| material | (none) | Material |
| material | string, float, float | Material |
| material_source | string | Material |
| material_file | string | Material |
| material_load | string | Material |
| material_compile | string, string, int, int | Material |
| texture_from_image | Image, string | Texture |
| texture_file | string, string | Texture |
| texture_constant | string | TextureGraph |
| texture_noise | string, int, int | TextureGraph |
| texture_graph_image | Texture | TextureGraph |
| texture_checker | string, string, int | TextureGraph |
| texture_gradient | string, string, int | TextureGraph |
| texture_bricks | string, string, int | TextureGraph |
| texture_stripes | string, string, int | TextureGraph |
| texture_ramp | string, string, int | TextureGraph |
| texture_radial | string, string, int | TextureGraph |
| environment_image | Image | Environment |
| environment_file | string, string | Environment |
| environment_linear | int, int, string | Environment |
Physics
| Function | Parameters | Returns |
| physics_world | float, int | PhysicsWorld |
| physics_material | float, float | PhysicsMaterial |
| physics_presentation | int, int, int | PhysicsPresentation |
Host types and methods
55 opaque types with 524 method signatures. Values are created by the functions above or returned by other methods; the line under each heading lists where a value of that type comes from according to the schema. Most configuration methods return the receiver so calls can be chained.
| Group | Types |
| Output and video | Video, Output |
| Canvas drawing | Canvas, Paint, Path, Font, Typeface, Gradient, DrawNode, Shape, Group, Grid, Text, ImageView, Keyframes, Keyframe |
| Plots | Plot, Series, Heatmap, VectorField, Legend, Axes |
| Panels and layout managers | Panel, LayoutItem |
| Images | Image, Curve, Layout, Timeline, FrameCache |
| SVG and vector documents | Svg, SvgNode, TemplateSvg, Surface, Document, Picture, PdfDocument |
| 3D scene | Scene3D, Camera3D, Node3D, InstancedNode3D, Mesh3D, HairCurves, PointCloud, Projection, Anchor3D |
| Materials and textures | Material, Texture, TextureGraph, Environment |
| Physics | PhysicsWorld, PhysicsMaterial, PhysicsBody, PhysicsPose, PhysicsTake, PhysicsPresentation |
Video
15 method signatures. Comes from: context object video.
| Method | Parameters | Returns |
| size | int, int | void |
| fps | int | void |
| frames | int | void |
| output | string | void |
| crf | int | void |
| begin | (none) | void |
| frame | (none) | void |
| end | (none) | void |
| index | (none) | int |
| count | (none) | int |
| t | (none) | float |
| time | (none) | float |
| width | (none) | int |
| height | (none) | int |
| save_frame | string | void |
Output
2 method signatures. Comes from: context object out.
| Method | Parameters | Returns |
| print | string | void |
| fail | string | void |
Canvas
69 method signatures. Comes from: context object canvas, Document.canvas, Surface.canvas.
| Method | Parameters | Returns |
| scene3d | Scene3D, float, float, int, int | void |
| scene3d_camera | Scene3D, Camera3D, float, float, int, int | void |
| panel | float, float, float, float | Panel |
| plot | float, float, float, float | Plot |
| box | float, float, float, float, string, string, string, float, float | Shape |
| box | Shape, string, float, float, string, string, string, float, float | Shape |
| diamond | float, float, float, float, string, string, string, float | Shape |
| cylinder | float, float, float, float, string, string, string, float | Shape |
| note | float, float, float, float, string, string, string, float | Shape |
| cluster | float, float, float, float, string, string, string, float, float | Shape |
| connector | float, float, float, float, string, string, string, string, string, float, string, float, float, float | Group |
| connector | Shape, string, Shape, string, string, string, string, string, string, float, string, float, float, float | Group |
| connector | float, float, Shape, string, string, string, string, string, string, float, string, float, float, float | Group |
| connector | Shape, string, float, float, string, string, string, string, string, float, string, float, float, float | Group |
| grid | float, float, float, float, int, int, float, float | Grid |
| lifeline | float, float, float, string | Group |
| message | float, float, float, float, string, bool, string | Group |
| activation | float, float, float, string, string | Group |
| self_message | float, float, string, string | Group |
| group | (none) | Group |
| draw_diagram | (none) | void |
| clear | string | void |
| rect | float, float, float, float, Paint | void |
| rect | float, float, float, float, string | DrawNode |
| round_rect | float, float, float, float, float, float, Paint | void |
| oval | float, float, float, float, Paint | void |
| circle | float, float, float, Paint | void |
| circle | float, float, float, string | DrawNode |
| line | float, float, float, float, Paint | void |
| line | float, float, float, float, string, float | DrawNode |
| log_axes | float, float, float, float, float, float, float, float, bool, bool, int, Font, Paint | Axes |
| log_axes | float, float, float, float, float, float, float, float, int, string | Group |
| log_axes | float, float, float, float, float, float, float, float, bool, bool, int, string | Group |
| legend | float, float, StrList, StrList, Font, Paint, Paint | Legend |
| legend | float, float, string, string, string | Group |
| legend | float, float, string, string, string, string | Group |
| axes | float, float, float, float, float, float, float, float, int, Font, Paint | Axes |
| axes | float, float, float, float, float, float, float, float, int, string | Group |
| arrow | float, float, float, float, float, Paint | void |
| arrow | float, float, float, float, string, float | DrawNode |
| polyline | FloatList, Paint | void |
| polyline | string, string, float | DrawNode |
| path | Path, Paint | void |
| path | string, string, string, float | DrawNode |
| text | string, float, float, Font, Paint | void |
| text | float, float, float, string, string | DrawNode |
| text | float, float, float, string, string, float | DrawNode |
| image | Image, float, float | void |
| image | string, float, float, float, float | DrawNode |
| image_rect | Image, float, float, float, float | void |
| svg | Svg, float, float, float, float | void |
| picture | Picture, float, float, float, float | void |
| save | (none) | void |
| restore | (none) | void |
| translate | float, float | void |
| scale | float, float | void |
| rotate | float | void |
| clip_rect | float, float, float, float | void |
| target | Surface | Canvas |
| typeface | Typeface | Canvas |
| redraw | (none) | void |
| snapshot | (none) | Image |
| snapshot | Image | Image |
| png | string, int, int, int | void |
| ellipse | float, float, float, float, string | DrawNode |
| measure_text | string, float, bool | float |
| linear_gradient | string, float, float, float, float | Gradient |
| load_svg | string, string | SvgNode |
| load_svg | string, string, string | SvgNode |
Paint
11 method signatures. Comes from: paint.
| Method | Parameters | Returns |
| color | string | self |
| alpha | float | self |
| antialias | bool | self |
| fill | (none) | self |
| stroke | (none) | self |
| stroke_width | float | self |
| stroke_cap | string | self |
| stroke_join | string | self |
| gradient | float, float, float, float, string, string | self |
| dash | float, float | self |
| blur | float | self |
Path
9 method signatures. Comes from: path.
| Method | Parameters | Returns |
| move_to | float, float | self |
| line_to | float, float | self |
| quad_to | float, float, float, float | self |
| cubic_to | float, float, float, float, float, float | self |
| close | (none) | self |
| rect | float, float, float, float | self |
| oval | float, float, float, float | self |
| circle | float, float, float | self |
| round_rect | float, float, float, float, float, float | self |
Font
2 method signatures. Comes from: font, Typeface.font.
| Method | Parameters | Returns |
| bold | bool | Font |
| measure | string | float |
Typeface
7 method signatures. Comes from: font_load.
| Method | Parameters | Returns |
| font | float | Font |
| family | (none) | string |
| sha256 | (none) | string |
| source | (none) | string |
| has_glyphs | string | bool |
| license | (none) | string |
| version | (none) | string |
Gradient
1 method signatures. Comes from: Canvas.linear_gradient.
| Method | Parameters | Returns |
| stop | float, string | Gradient |
DrawNode
3 method signatures. Comes from: Canvas.rect, Canvas.circle, Canvas.line, Canvas.arrow, Canvas.polyline, Canvas.path, Canvas.text, Canvas.image, Canvas.ellipse.
| Method | Parameters | Returns |
| set_attr | string, string | DrawNode |
| set_attrs | StrMap | DrawNode |
| get_attrs | StrList | StrMap |
Shape
9 method signatures. Comes from: Canvas.box, Canvas.diamond, Canvas.cylinder, Canvas.note, Canvas.cluster, LayoutItem.shape, Grid.cell.
| Method | Parameters | Returns |
| fill | string | Shape |
| stroke | string | Shape |
| stroke_width | float | Shape |
| radius | float | Shape |
| label | string | Shape |
| set_attr | string, string | Shape |
| set_attrs | StrMap | Shape |
| cx | (none) | float |
| cy | (none) | float |
Group
4 method signatures. Comes from: Canvas.connector, Canvas.lifeline, Canvas.message, Canvas.activation, Canvas.self_message, Canvas.group, Canvas.log_axes, Canvas.legend, Canvas.axes.
| Method | Parameters | Returns |
| add | Group | Group |
| add | DrawNode | Group |
| set_attr | string, string | Group |
| set_attrs | StrMap | Group |
Grid
1 method signatures. Comes from: Canvas.grid.
| Method | Parameters | Returns |
| cell | int, int | Shape |
Text
4 method signatures. Comes from: LayoutItem.text.
| Method | Parameters | Returns |
| color | string | Text |
| size | float | Text |
| bold | bool | Text |
| align | string | Text |
ImageView
1 method signatures. Comes from: LayoutItem.image.
| Method | Parameters | Returns |
| fit | string | ImageView |
Keyframes
3 method signatures. Comes from: keyframes.
| Method | Parameters | Returns |
| len | (none) | int |
| at | int | Keyframe |
| add | float, float, string | Keyframes |
Keyframe
3 method signatures. Comes from: Keyframes.at.
| Method | Parameters | Returns |
| x | (none) | float |
| y | (none) | float |
| color | (none) | string |
Plot
23 method signatures. Comes from: Canvas.plot, LayoutItem.plot.
| Method | Parameters | Returns |
| title | string | Plot |
| xlabel | string | Plot |
| ylabel | string | Plot |
| y2label | string | Plot |
| x_range | float, float | Plot |
| y_range | float, float | Plot |
| y2_range | float, float | Plot |
| x_scale | string | Plot |
| y_scale | string | Plot |
| legend | string | Plot |
| grid | bool | Plot |
| background | string | Plot |
| heatmap | string, int, int | Heatmap |
| quiver | string | VectorField |
| x_symlog | float | Plot |
| y_symlog | float | Plot |
| x_date | string | Plot |
| inset | float, float, float, float | Plot |
| series | string, string, string | Series |
| annotate | float, float, string, string | Plot |
| vline | float, string, float | Plot |
| hline | float, string, float | Plot |
| draw | (none) | Plot |
Series
14 method signatures. Comes from: Plot.series.
| Method | Parameters | Returns |
| add | float, float | Series |
| add_error | float, float, float, float | Series |
| clear | (none) | Series |
| axis | string | Series |
| color | string | Series |
| width | float | Series |
| dash | string | Series |
| marker | string | Series |
| add_band | float, float, float | Series |
| histogram | int | Series |
| box | float, float, float, float, float | Series |
| stack | string | Series |
| group | string | Series |
| donut | float | Series |
Heatmap
8 method signatures. Comes from: Plot.heatmap.
| Method | Parameters | Returns |
| cell | int, int, float | Heatmap |
| palette | string | Heatmap |
| range | float, float | Heatmap |
| colorbar | bool | Heatmap |
| labels | bool | Heatmap |
| contours | int, string, float | Heatmap |
| clear | (none) | Heatmap |
| draw | (none) | Heatmap |
VectorField
6 method signatures. Comes from: Plot.quiver.
| Method | Parameters | Returns |
| add | float, float, float, float | VectorField |
| color | string | VectorField |
| scale | float | VectorField |
| streamlines | bool | VectorField |
| clear | (none) | VectorField |
| draw | (none) | VectorField |
Legend
3 method signatures. Comes from: Canvas.legend.
| Method | Parameters | Returns |
| width | (none) | float |
| height | (none) | float |
| draw | (none) | Legend |
Axes
3 method signatures. Comes from: Canvas.log_axes, Canvas.axes.
| Method | Parameters | Returns |
| x | float | float |
| y | float | float |
| draw | (none) | Axes |
Panel
18 method signatures. Comes from: Canvas.panel, LayoutItem.panel.
| Method | Parameters | Returns |
| manager | string | Panel |
| padding | float, float, float, float | Panel |
| gap | float | Panel |
| background | string | Panel |
| edge | string, float | Panel |
| align | string, string | Panel |
| min_size | float, float | Panel |
| max_size | float, float | Panel |
| columns | int | Panel |
| row_weight | int, float | Panel |
| column_weight | int, float | Panel |
| add_panel | (none) | LayoutItem |
| add_plot | (none) | LayoutItem |
| add_text | string | LayoutItem |
| add_shape | string | LayoutItem |
| add_image | Image | LayoutItem |
| add_glue | (none) | LayoutItem |
| draw | (none) | Panel |
LayoutItem
16 method signatures. Comes from: Panel.add_panel, Panel.add_plot, Panel.add_text, Panel.add_shape, Panel.add_image, Panel.add_glue.
| Method | Parameters | Returns |
| panel | (none) | Panel |
| plot | (none) | Plot |
| text | (none) | Text |
| shape | (none) | Shape |
| image | (none) | ImageView |
| pack | string, string, bool | LayoutItem |
| fill | string | LayoutItem |
| grid | int, int, int, int | LayoutItem |
| border | string | LayoutItem |
| place | float, float, float, float | LayoutItem |
| preferred_size | float, float | LayoutItem |
| min_size | float, float | LayoutItem |
| max_size | float, float | LayoutItem |
| weight | float | LayoutItem |
| sticky | string | LayoutItem |
| align | string, string | LayoutItem |
Image
55 method signatures. Comes from: image_panel, image_hald, image_pattern, image_bytes, image_rgba, image_create, image_file, PhysicsPresentation.render, Texture.image, Scene3D.render_camera, Scene3D.render_image, Scene3D.render_depth_image, Scene3D.render_normal_image, Layout.render, and 4 more.
| Method | Parameters | Returns |
| width | (none) | int |
| height | (none) | int |
| rgba | (none) | string |
| encode_png | (none) | string |
| copy | (none) | Image |
| pixel | int, int, int | float |
| set_pixel | int, int, float, float, float, float | Image |
| save | string | void |
| resize | int, int | Image |
| resize | int, int, string | Image |
| crop | int, int, int, int | Image |
| flip | bool | Image |
| rotate | float | Image |
| rotate | float, float, float, float, float | Image |
| levels | float, float, float | Image |
| curves | Curve | Image |
| curves_rgb | Curve, Curve, Curve | Image |
| hsl | float, float, float | Image |
| channelmix | float, float, float, float, float, float, float, float, float | Image |
| grayscale | (none) | Image |
| sepia | float | Image |
| rect | float, float, float, float, float, float, float, float | Image |
| circle | float, float, float, float, float, float, float | Image |
| line | float, float, float, float, float, float, float, float, float | Image |
| text | float, float, string, float, float, float, float, float | Image |
| text | float, float, string, Font, Paint | Image |
| blur | float, float | Image |
| sharpen | float, float | Image |
| edges | float | Image |
| unsharp | float, float, float, float | Image |
| vignette | float, float | Image |
| tilt_shift | float, float, float | Image |
| blend | Image, string, float, int, int | Image |
| mask | Image | Image |
| selection | int, int, int, int | Image |
| mean | int | float |
| stddev | int | float |
| min | int | float |
| max | int | float |
| psnr | Image | float |
| ssim | Image | float |
| histogram_csv | (none) | string |
| histogram | string | void |
| clut | Image | Image |
| colormap | string | Image |
| threshold | float | Image |
| invert | (none) | Image |
| normalize | (none) | Image |
| equalize | (none) | Image |
| morphology | string, int | Image |
| perspective | float, float, float, float, float, float, float, float | Image |
| lens | float | Image |
| heal | int, int, int, int, int | Image |
| encode | string | string |
| fonts | (none) | string |
Curve
1 method signatures. Comes from: image_curve.
| Method | Parameters | Returns |
| point | float, float | Curve |
Layout
7 method signatures. Comes from: layout_sheet, layout_create.
| Method | Parameters | Returns |
| add | Image, string, float, int, int | Layout |
| add | Image | Layout |
| masked | Image, Image, string, float, int, int | Layout |
| clear | (none) | Layout |
| render | (none) | Image |
| render | Image | Image |
| render | int, int, float, float, float, float | Image |
Timeline
7 method signatures. Comes from: timeline_create.
| Method | Parameters | Returns |
| add | Image, int | Timeline |
| size | (none) | int |
| delay | int | int |
| frame | int | Image |
| duration | (none) | float |
| encode_gif | (none) | string |
| save | string | void |
FrameCache
5 method signatures. Comes from: frame_cache.
| Method | Parameters | Returns |
| render | Scene3D, int, int, int | Image |
| render | Scene3D, int, int, int, Image | Image |
| hits | (none) | int |
| misses | (none) | int |
| last_hit | (none) | bool |
Svg
4 method signatures. Comes from: svg, svg_file, TemplateSvg.render.
| Method | Parameters | Returns |
| root | (none) | SvgNode |
| node | string | SvgNode |
| width | (none) | float |
| height | (none) | float |
SvgNode
2 method signatures. Comes from: Svg.root, Svg.node, Canvas.load_svg.
| Method | Parameters | Returns |
| set_attr | string, string | SvgNode |
| set_attrs | StrMap | SvgNode |
TemplateSvg
1 method signatures. Comes from: template_svg.
| Method | Parameters | Returns |
| render | float, float, string | Svg |
Surface
5 method signatures. Comes from: surface.
| Method | Parameters | Returns |
| canvas | (none) | Canvas |
| image | (none) | Image |
| png | string | void |
| svg | string | void |
| pdf | string | void |
Document
2 method signatures. Comes from: document.
| Method | Parameters | Returns |
| canvas | (none) | Canvas |
| finish | (none) | Picture |
Picture
7 method signatures. Comes from: picture_file, Document.finish.
| Method | Parameters | Returns |
| width | (none) | int |
| height | (none) | int |
| draw | Canvas, float, float, float, float | void |
| png | string, int | void |
| svg | string | void |
| pdf | string | void |
| skp | string | void |
PdfDocument
3 method signatures. Comes from: pdf_document.
| Method | Parameters | Returns |
| add_page | Picture | PdfDocument |
| pages | (none) | int |
| write | string | void |
Scene3D
44 method signatures. Comes from: scene3d, scene_job.
| Method | Parameters | Returns |
| environment | Environment, float, float, bool | Scene3D |
| tonemap | string, float | Scene3D |
| shadows | int, float, float, int | Scene3D |
| shadow_light | int | Scene3D |
| shadows_off | (none) | Scene3D |
| add | Mesh3D, string | Node3D |
| add | Mesh3D, Material | Node3D |
| add_hair | HairCurves, Material | Node3D |
| group | (none) | Node3D |
| camera | Camera3D | Scene3D |
| background | string | Scene3D |
| ambient | float | Scene3D |
| time | float | Scene3D |
| clear | (none) | Scene3D |
| clip_plane | float, float, float, float | Scene3D |
| clear_clip | (none) | Scene3D |
| render_camera | Camera3D, int, int | Image |
| directional_light | float, float, float, string, float | Scene3D |
| point_light | float, float, float, string, float, float | Scene3D |
| spot_light | float, float, float, float, float, float, string, float, float, float | Scene3D |
| add_instances | Mesh3D, string | InstancedNode3D |
| add_instances | Mesh3D, Material | InstancedNode3D |
| render_image | int, int | Image |
| render_image | int, int, int | Image |
| render_image | int, int, Image | Image |
| render_image | int, int, string | Image |
| render_image | int, int, string, int, int, int, bool | Image |
| render_depth_image | int, int | Image |
| render_normal_image | int, int | Image |
| points | PointCloud | Scene3D |
| clear_points | (none) | Scene3D |
| projection | int, int | Projection |
| projection | Camera3D, int, int | Projection |
| projection | int, int, Projection | Projection |
| export_gltf | string, bool | void |
| sky_hosek | float, float, float, float, float, bool | Scene3D |
| clear_environment | (none) | Scene3D |
| import_obj | string, float | Node3D |
| import_gltf | string, float | Node3D |
| save_job | string, int, int, int | void |
| save_job | string, int, int, string, int, int, int, bool | void |
| area_light | float, float, float, float, float, float, float, float, string, float, float | Scene3D |
| light_caustics | int, bool | Scene3D |
| threads | int | Scene3D |
Camera3D
6 method signatures. Comes from: camera3d.
| Method | Parameters | Returns |
| look_at | float, float, float, float, float, float | Camera3D |
| up | float, float, float | Camera3D |
| perspective | float, float, float | Camera3D |
| ortho | float, float, float | Camera3D |
| lens | float, float | Camera3D |
| dof | float, float, int | Camera3D |
Node3D
15 method signatures. Comes from: PhysicsBody.sync, PhysicsPose.sync, Scene3D.add, Scene3D.add_hair, Scene3D.group, Scene3D.import_obj, Scene3D.import_gltf.
| Method | Parameters | Returns |
| material | Material | Node3D |
| cast_shadow | bool | Node3D |
| receive_shadow | bool | Node3D |
| cast_caustics | bool | Node3D |
| receive_caustics | bool | Node3D |
| parent | Node3D | Node3D |
| visible | bool | Node3D |
| unlit | bool | Node3D |
| cull | bool | Node3D |
| color | string | Node3D |
| keyframe | float, float, float, float, float, float, float, float, float, float | Node3D |
| position | float, float, float | Node3D |
| rotation | float, float, float | Node3D |
| scale | float, float, float | Node3D |
| id | (none) | string |
InstancedNode3D
4 method signatures. Comes from: Scene3D.add_instances.
| Method | Parameters | Returns |
| scatter_on_mesh | Mesh3D, int, int, bool, float | InstancedNode3D |
| add_instance | float, float, float, float, float, float, float, float, float, string | InstancedNode3D |
| size | (none) | int |
| set_instance | int, float, float, float, float, float, float, float, float, float | InstancedNode3D |
Mesh3D
13 method signatures. Comes from: mesh_text, mesh_text_bevel, mesh_triangles, mesh_load, mesh_box, mesh_plane, mesh_sphere, mesh_cylinder, mesh_cone, mesh_torus, mesh_lathe, mesh_lathe_closed, mesh_tube_spline, mesh_extrude, and 2 more.
| Method | Parameters | Returns |
| copy | (none) | Mesh3D |
| geometry_hash | (none) | string |
| replace | Mesh3D | Mesh3D |
| revision | (none) | int |
| bound | int | float |
| save | string | void |
| vertices | (none) | int |
| triangles | (none) | int |
| positions | string | Mesh3D |
| uvs | string | Mesh3D |
| colors | string | Mesh3D |
| set_vertex_scalars | string, string, float, float | Mesh3D |
| fonts | (none) | string |
HairCurves
Opaque handle with no methods. Comes from: hair_curves.
PointCloud
4 method signatures. Comes from: point_cloud.
| Method | Parameters | Returns |
| add | float, float, float, float, string, float, bool | PointCloud |
| set | int, float, float, float, float, string, float, bool | PointCloud |
| size | (none) | int |
| clear | (none) | PointCloud |
Projection
1 method signatures. Comes from: Scene3D.projection.
| Method | Parameters | Returns |
| at | float, float, float | Anchor3D |
Anchor3D
5 method signatures. Comes from: Projection.at.
| Method | Parameters | Returns |
| x | (none) | float |
| y | (none) | float |
| depth | (none) | float |
| visible | (none) | bool |
| occluded | (none) | bool |
Material
28 method signatures. Comes from: material, material_source, material_file, material_load, material_compile.
| Method | Parameters | Returns |
| copy | (none) | Material |
| base_color | string | Material |
| emissive | string, float | Material |
| alpha | string, float | Material |
| double_sided | bool | Material |
| thin_walled | bool | Material |
| volume_absorption | string, float | Material |
| density_grid | int, int, int, string | Material |
| volume_scattering | float, float, string | Material |
| subsurface | float, float, float, float | Material |
| clearcoat | float, float | Material |
| anisotropy | float, float | Material |
| hair | float, float, float, string | Material |
| height | Image, float, bool | Material |
| save | string | void |
| metallic | float | Material |
| roughness | float | Material |
| occlusion | float | Material |
| opacity | float | Material |
| normal_scale | float | Material |
| transmission | float | Material |
| ior | float | Material |
| albedo | Texture | Material |
| orm | Texture | Material |
| normal | Texture | Material |
| emission | Texture | Material |
| wireframe | string, float | Material |
| wireframe_off | (none) | Material |
Texture
9 method signatures. Comes from: texture_from_image, texture_file, TextureGraph.bake.
| Method | Parameters | Returns |
| levels | (none) | int |
| image | int | Image |
| sample | float, float, float, int | float |
| wrap | string, string | Texture |
| filter | string | Texture |
| rotate | float | Texture |
| repeat | float, float | Texture |
| offset | float, float | Texture |
| fonts | (none) | string |
TextureGraph
6 method signatures. Comes from: texture_constant, texture_noise, texture_graph_image, texture_checker, texture_gradient, texture_bricks, texture_stripes, texture_ramp, texture_radial.
| Method | Parameters | Returns |
| invert | (none) | TextureGraph |
| bake | int, int, string | Texture |
| amount | float | TextureGraph |
| add | TextureGraph, float | TextureGraph |
| multiply | TextureGraph, float | TextureGraph |
| mix | TextureGraph, float | TextureGraph |
Environment
Opaque handle with no methods. Comes from: environment_image, environment_file, environment_linear.
PhysicsWorld
11 method signatures. Comes from: physics_world.
| Method | Parameters | Returns |
| gravity | float, float, float | PhysicsWorld |
| planar | bool | PhysicsWorld |
| box | float, float, float, float, float, float, float, PhysicsMaterial | PhysicsBody |
| sphere | float, float, float, float, float, PhysicsMaterial | PhysicsBody |
| step | int | PhysicsWorld |
| time | (none) | float |
| timestep | (none) | float |
| body_count | (none) | int |
| body | int | PhysicsBody |
| random | float, float | float |
| bake | int, int | PhysicsTake |
PhysicsMaterial
2 method signatures. Comes from: physics_material.
| Method | Parameters | Returns |
| friction | (none) | float |
| restitution | (none) | float |
PhysicsBody
19 method signatures. Comes from: PhysicsWorld.box, PhysicsWorld.sphere, PhysicsWorld.body.
| Method | Parameters | Returns |
| x | (none) | float |
| y | (none) | float |
| z | (none) | float |
| qx | (none) | float |
| qy | (none) | float |
| qz | (none) | float |
| qw | (none) | float |
| vx | (none) | float |
| vy | (none) | float |
| vz | (none) | float |
| id | (none) | int |
| sleeping | (none) | bool |
| pose | (none) | PhysicsPose |
| sync | Node3D | Node3D |
| position | float, float, float | PhysicsBody |
| rotation | float, float, float | PhysicsBody |
| velocity | float, float, float | PhysicsBody |
| angular_velocity | float, float, float | PhysicsBody |
| impulse | float, float, float | PhysicsBody |
PhysicsPose
11 method signatures. Comes from: PhysicsBody.pose, PhysicsTake.pose.
| Method | Parameters | Returns |
| x | (none) | float |
| y | (none) | float |
| z | (none) | float |
| qx | (none) | float |
| qy | (none) | float |
| qz | (none) | float |
| qw | (none) | float |
| vx | (none) | float |
| vy | (none) | float |
| vz | (none) | float |
| sync | Node3D | Node3D |
PhysicsTake
3 method signatures. Comes from: PhysicsWorld.bake.
| Method | Parameters | Returns |
| frames | (none) | int |
| body_count | (none) | int |
| pose | float, int | PhysicsPose |
PhysicsPresentation
9 method signatures. Comes from: physics_presentation.
| Method | Parameters | Returns |
| title | string, float, float, string | PhysicsPresentation |
| bar | string, float, float, float, float, string | PhysicsPresentation |
| bullet | string, float, float, string | PhysicsPresentation |
| kpi | string, int, float, float, string | PhysicsPresentation |
| step | int | PhysicsPresentation |
| tumble | (none) | PhysicsPresentation |
| assemble | (none) | PhysicsPresentation |
| render | (none) | Image |
| body_count | (none) | int |
String values and argument orders stated by the repository
The schema types many options as plain string, so it defines no enums. The values below are the ones that appear in the repository documentation and runnable examples; other values may exist but are not listed because they could not be confirmed from public material.
| Where | Values or argument order |
| Colors | Hex strings such as #1e3c72. mix(color, color, t) blends two of them. |
| Plot.series(name, kind, color) | Kinds used in the examples: line, bar, scatter, area, stacked_bar, grouped_bar, errorbar, step, histogram, donut, box. |
| Series.marker, Series.dash | circle; dashed. |
| Plot.legend | none hides the legend. |
| Plot.x_scale | log. |
| Heatmap.palette, Image.colormap | viridis, magma, coolwarm; viridis. |
| Panel.manager | grid, border, place, pack. |
| LayoutItem.fill, LayoutItem.sticky | both, none; nsew. |
| Paint.stroke_cap, Paint.stroke_join | round. |
| Image.blend mode | over, screen. The migration notes say ten blend modes exist. |
| Image.morphology | erode, dilate, median. |
| Texture.filter, Texture.wrap | trilinear; repeat, repeat. |
| Scene3D.tonemap | aces. |
| Renderer names | raster and cycles, for Scene3D.render_image, Scene3D.save_job, render_available and the render-job commands. |
| Scene3D.render_image(width, height, renderer, samples, bounces, seed, denoise) | The seven argument overload: renderer name, path tracing samples, maximum bounces, repeatable seed, denoise switch. |
| Scene3D.render_image(width, height, samples) | Raster render; the migration notes map 2 by 2 supersampling to samples 2. |
| Scene3D.directional_light(x, y, z, color, intensity) | The vector points toward the light source. |
| Camera3D.perspective(fov, near, far) | Vertical field of view in degrees. |
| Node3D.position, rotation, scale | Set semantics; rotation in degrees. |
| mesh_plane | Lies in the XZ plane facing +Y. |
| physics_world(timestep, seed) | Fixed step in seconds and a seed, for example 1.0 / 120.0 and 42. |
| physics_material(friction, restitution) | Both in the range 0 to 1. |
| PhysicsWorld.box | Full width, height, depth, position x, y, z, mass, material. Mass zero is static. |
| PhysicsWorld.sphere | Radius, position x, y, z, mass, material. |
| PhysicsWorld.bake(frames, stride) | 2 to 512 samples, stride 1 to 1000. |
| PhysicsTake.pose(t, body_id) | t from 0 to 1; interpolated position and normalized quaternion. |
| physics_presentation(width, height, seed) | Authoring coordinates are top left pixels. |
| PhysicsPresentation.title(text, x, y, color) | One rigid tile per printable ASCII character. |
| PhysicsPresentation.bar(label, value, maximum, x, y, color) | Twenty normalized bins, rounded to nearest. |
| PhysicsPresentation.kpi(label, count, x, y, color) | Exactly 0 to 64 grains. |
Built in block functions
Besides the host and standard functions, the block language itself supplies these numeric and conversion built-ins, as listed by the compiler diagnostic for an undefined name: float, str, sin, cos, sqrt, abs, floor, pow, min, max, clamp, lerp, ease, ease_in, ease_out, int. Loops in the examples use for with range(start, end).
Physics limits
| Limit | Value |
| Bodies per world | 2048 |
| Simultaneous worlds | 4 |
| Fixed updates per world | 1,000,000 |
| Updates per step call | 10,000 |
| Updates per bake | 10,000 |
| Stored body poses per bake | 262,144 |
| Stored body poses across all retained takes | 524,288 |
| Body shapes | Boxes and spheres. Capsules, convex hulls and joints are not exposed. |
Standard library in v0.1.124: lmcode_std_v3, 206 signatures
The lmvideo release pins the standard catalog by hash in toolchain.lock.json (std_sha256 1defd1be67bf11cf1780f7d890059cd2ac6fd506a7b7fa578e31b5ef124aa221). That hash is the 206 signature edition of lmcode_std_v3: 83 function signatures and 123 methods on 16 container and Json types. All of them appear in lmvideo --lmcode-signatures and are callable in a block without any import.
Standard function groups
| Group | Signatures | Function names |
| Strings | 21 | str_base64_decode, str_base64_encode, str_contains, str_ends_with, str_find, str_hex_decode, str_hex_encode, str_is_float, str_is_int, str_len, str_lower, str_match, str_repeat, str_replace, str_split, str_starts_with, str_substr, str_to_float, str_to_int, str_trim, str_upper |
| Math | 16 | math_abs, math_ceil, math_floor, math_max, math_min, math_pow, math_round, math_sqrt |
| Files | 5 | file_append, file_exists, file_lines, file_read, file_write |
| JSON and templates | 2 | json_parse, template_render |
| Result envelope | 24 | lmcode_return_null, lmcode_return_put, lmcode_return_put_null, lmcode_return_set |
| Container constructors | 15 | float_list, float_map, float_pq, float_queue, float_stack, int_list, int_map, int_pq, int_queue, int_stack, str_list, str_map, str_pq, str_queue, str_stack |
Standard functions
| Function | Parameters | Returns |
| file_append | string, string | void |
| file_exists | string | bool |
| file_lines | string | StrList |
| file_read | string | string |
| file_write | string, string | void |
| float_list | (none) | FloatList |
| float_map | (none) | FloatMap |
| float_pq | (none) | FloatPQ |
| float_queue | (none) | FloatQueue |
| float_stack | (none) | FloatStack |
| int_list | (none) | IntList |
| int_map | (none) | IntMap |
| int_pq | (none) | IntPQ |
| int_queue | (none) | IntQueue |
| int_stack | (none) | IntStack |
| json_parse | string | Json |
| lmcode_return_null | (none) | void |
| lmcode_return_put | string, bool | void |
| lmcode_return_put | string, float | void |
| lmcode_return_put | string, FloatList | void |
| lmcode_return_put | string, FloatMap | void |
| lmcode_return_put | string, int | void |
| lmcode_return_put | string, IntList | void |
| lmcode_return_put | string, IntMap | void |
| lmcode_return_put | string, Json | void |
| lmcode_return_put | string, StrList | void |
| lmcode_return_put | string, StrMap | void |
| lmcode_return_put | string, string | void |
| lmcode_return_put_null | string | void |
| lmcode_return_set | bool | void |
| lmcode_return_set | float | void |
| lmcode_return_set | FloatList | void |
| lmcode_return_set | FloatMap | void |
| lmcode_return_set | int | void |
| lmcode_return_set | IntList | void |
| lmcode_return_set | IntMap | void |
| lmcode_return_set | Json | void |
| lmcode_return_set | StrList | void |
| lmcode_return_set | StrMap | void |
| lmcode_return_set | string | void |
| math_abs | int | int |
| math_abs | float | float |
| math_ceil | int | int |
| math_ceil | float | float |
| math_floor | int | int |
| math_floor | float | float |
| math_max | int, int | int |
| math_max | float, float | float |
| math_min | int, int | int |
| math_min | float, float | float |
| math_pow | int, int | int |
| math_pow | float, float | float |
| math_round | int | int |
| math_round | float | float |
| math_sqrt | int | int |
| math_sqrt | float | float |
| str_base64_decode | string | string |
| str_base64_encode | string | string |
| str_contains | string, string | bool |
| str_ends_with | string, string | bool |
| str_find | string, string | int |
| str_hex_decode | string | string |
| str_hex_encode | string | string |
| str_is_float | string | bool |
| str_is_int | string | bool |
| str_len | string | int |
| str_list | (none) | StrList |
| str_lower | string | string |
| str_map | (none) | StrMap |
| str_match | string, string | bool |
| str_pq | (none) | StrPQ |
| str_queue | (none) | StrQueue |
| str_repeat | string, int | string |
| str_replace | string, string, string | string |
| str_split | string, string | StrList |
| str_stack | (none) | StrStack |
| str_starts_with | string, string | bool |
| str_substr | string, int, int | string |
| str_to_float | string | float |
| str_to_int | string | int |
| str_trim | string | string |
| str_upper | string | string |
| template_render | string, Json | string |
Standard types
| Type | Method signatures | Methods |
| FloatList | 7 | add, at, clear, contains, index_of, len, set |
| FloatMap | 10 | len, has, get, get_or, set, key_at, remove, clear, keys, values |
| FloatPQ | 6 | push, pop, peek, len, empty, clear |
| FloatQueue | 7 | push, pop, peek, len, empty, clear, at |
| FloatStack | 7 | push, pop, peek, len, empty, clear, at |
| IntList | 7 | add, at, clear, contains, index_of, len, set |
| IntMap | 10 | len, has, get, get_or, set, key_at, remove, clear, keys, values |
| IntPQ | 6 | push, pop, peek, len, empty, clear |
| IntQueue | 7 | push, pop, peek, len, empty, clear, at |
| IntStack | 7 | push, pop, peek, len, empty, clear, at |
| Json | 11 | kind, len, at, get, has, keys, as_string, as_int, as_float, as_bool, to_json |
| StrList | 8 | add, at, clear, contains, index_of, join, len, set |
| StrMap | 10 | clear, get, get_or, has, key_at, len, remove, set, keys, values |
| StrPQ | 6 | push, pop, peek, len, empty, clear |
| StrQueue | 7 | push, pop, peek, len, empty, clear, at |
| StrStack | 7 | push, pop, peek, len, empty, clear, at |
The Json type is also the block result type: the schema declares result as nullable Json.
Standard REST and CLI interfaces: not in v0.1.124
The current lmcode_std_v3 catalog has 226 canonical signatures. The 20 added signatures are the former lmcode_std_rest_v1 module: 5 functions and 15 RestExchange methods, together with 10 standard interfaces. lmvideo v0.1.124 was built against the 206 signature catalog, so none of the names in this section exist in that release: its signature list contains no rest_ function and no RestExchange type. A recent compiler (checked with lmscript 0.2.482) still accepts the names at compile time because it knows the newer catalog, but the v0.1.124 host refuses the program when it loads it, with code LOAD_UNBOUND, as shown below. lmvideo picks the 226 signature catalog up when a later release is built against it. The tables are provided so that a reader knows what will and will not resolve today.
prog = _lmcode_ cli="lmvideo" install="github:lmctl-ai/lmvideo@v0.1.124";
rest_stop();
end _lmcode_
r = run_lmcode(prog);
println(json_stringify(r));
{"ok":false,"phase":"load","code":"LOAD_UNBOUND","message":"import 'fn rest_stop() -> void' is not provided by the host"}
Standard interfaces (current catalog only)
| Interface | Handler parameters | Returns | In lmvideo v0.1.124 |
| RestGet | exchange: RestExchange | void | No |
| RestPost | exchange: RestExchange | void | No |
| RestPut | exchange: RestExchange | void | No |
| RestDelete | exchange: RestExchange | void | No |
| RestPatch | exchange: RestExchange | void | No |
| RestHead | exchange: RestExchange | void | No |
| RestOptions | exchange: RestExchange | void | No |
| RestHandler | exchange: RestExchange | void | No |
| CliCommand | exchange: RestExchange | void | No |
| CliOption | exchange: RestExchange | void | No |
REST and CLI functions (current catalog only)
| Function | Parameters | Returns | In lmvideo v0.1.124 |
| rest_config | string, string | void | No |
| rest_route | string, string, string | void | No |
| rest_serve | (none) | void | No |
| rest_stop | (none) | void | No |
| rest_cli | StrList | string | No |
Route templates in the current catalog accept {param} and {rest...} as well as :param and :rest... placeholders. rest_cli takes an argument list and is the stateless CLI mode that dispatches options, commands and REST routes.
RestExchange methods (current catalog only)
| Method | Parameters | Returns | In lmvideo v0.1.124 |
| method | (none) | string | No |
| path | (none) | string | No |
| query | string | string | No |
| has_query | string | bool | No |
| param | string | string | No |
| header | string | string | No |
| has_header | string | bool | No |
| body | (none) | string | No |
| status | int | void | No |
| set_header | string, string | void | No |
| send | string | void | No |
| json | string | void | No |
| get | string | string | No |
| set | string, string | void | No |
| increment | string | int | No |
See also