@automovie/template 0.0.0 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @automovie/template
2
2
 
3
- The scaffold every AutoMovie production starts from, together with the functions that render it and write it to disk. Most people reach it through the [`automovie` CLI](../cli/README.md). Use this package directly when your own tool has to install or update a scaffold.
3
+ The scaffold every AutoMovie production starts from, together with the functions that render it and write it to disk. Most people reach it through the [`automovie` CLI](../../README.md#commands). Use this package directly when your own tool has to install or update a scaffold.
4
4
 
5
5
  ## Use
6
6
 
@@ -5,17 +5,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.AUTOMOVIE_TEMPLATE_VERSIONS = void 0;
6
6
  /** Dependency versions baked into the scaffold, kept in sync with this repo. */
7
7
  exports.AUTOMOVIE_TEMPLATE_VERSIONS = {
8
- cli: "^0.0.0",
9
- engine: "^0.0.0",
10
- evidence: "^0.0.0",
11
- human: "^0.0.0",
12
- ingest: "^0.0.0",
13
- interface: "^0.0.0",
14
- motions: "^0.0.0",
15
- recovery: "^0.0.0",
16
- render: "^0.0.0",
17
- template: "^0.0.0",
18
- viewer: "^0.0.0",
8
+ cli: "^0.1.0",
9
+ engine: "^0.1.0",
10
+ evidence: "^0.1.0",
11
+ human: "^0.1.0",
12
+ ingest: "^0.1.0",
13
+ interface: "^0.1.0",
14
+ motions: "^0.1.0",
15
+ recovery: "^0.1.0",
16
+ render: "^0.1.0",
17
+ template: "^0.1.0",
18
+ viewer: "^0.1.0",
19
19
  huggingFaceTransformers: "3.8.1",
20
20
  h264Mp4Encoder: "^1.0.12",
21
21
  ffmpegStatic: "^5.2.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automovie/template",
3
- "version": "0.0.0",
3
+ "version": "0.1.0",
4
4
  "description": "The self-contained scaffold every AutoMovie production is created from and the library that materializes it.",
5
5
  "main": "lib/index.js",
6
6
  "exports": {
@@ -50,7 +50,7 @@
50
50
  "ttsc": "^0.36.3",
51
51
  "typescript": "^7.0.2",
52
52
  "@wrtnlabs/evidence": "^0.8.2",
53
- "@automovie/evidence": "^0.0.0"
53
+ "@automovie/evidence": "^0.1.0"
54
54
  },
55
55
  "scripts": {
56
56
  "build:versions": "ttsx --no-plugins build/resolveTemplateVersions.ts",
@@ -17,7 +17,7 @@ The project includes instructions, contracts and a working empty Viewer with exa
17
17
 
18
18
  ## Viewer and export
19
19
 
20
- Run `npm run dev`, then open [the Viewer](http://127.0.0.1:5173/). Play, pause and seek use the same deterministic performance as export. Each delivered video is one film in `src/composition/films/`, registered in `src/composition/films/index.ts` under its screenplay file's name, with its running time, frame rate and optional `width` × `height` delivery raster (1280 × 720 by default; 720 × 1280 for a vertical short); `?film=<name>` selects one, and may be omitted while only one exists. URL parameters `start`, `end`, `rate` and `play=1` select interval playback, for example [0–15 seconds at half speed](http://127.0.0.1:5173/?film=starter&start=0&end=15&rate=0.5&play=1). The starter film `src/composition/films/starter.ts` holds an empty scene; each film composes its scenes and sets its own running time.
20
+ Run `npm run dev`, then open [the Viewer](http://127.0.0.1:5173/). Play, pause and seek use the same deterministic performance as export. Each delivered video is one film in `src/composition/films/`, registered in `src/composition/films/index.ts` under its screenplay file's name, with its running time, frame rate and optional `width` × `height` delivery raster (1280 × 720 by default; 720 × 1280 for a vertical short); `?film=<name>` selects one, and may be omitted while only one exists. URL parameters `start`, `end`, `rate` and `play=1` select interval playback, for example [0 to 15 seconds at half speed](http://127.0.0.1:5173/?film=starter&start=0&end=15&rate=0.5&play=1). The starter film `src/composition/films/starter.ts` holds an empty scene; each film composes its scenes and sets its own running time.
21
21
 
22
22
  Keep the server running, set `CHROME_PATH` to an installed Chrome or Chromium executable, then run `npm run render -- --film <name>`, omitting `--film` while only one film exists. `src/executable/render.ts` sets the selected film's capture URL, raster, frame rate, duration and destinations. FFmpeg is supplied by `ffmpeg-static`; `FFMPEG_PATH` selects another executable. `VIEWER_URL` selects another running host. Capture mode uses `?capture=1&w=1280&h=720&film=<name>` and the completed `__afSeek(seconds)` hook.
23
23
 
@@ -1,4 +1,11 @@
1
1
  import { planViewerFrameTimes } from "@automovie/render";
2
+ import {
3
+ AutoMovieRasterSheet,
4
+ type IAutoMovieSceneRaster,
5
+ encodeAutoMovieRasterPng,
6
+ rasterizeAutoMovieScene,
7
+ stampAutoMovieRasterLabel,
8
+ } from "@automovie/viewer";
2
9
  import ffmpeg from "ffmpeg-static";
3
10
  import { spawnSync } from "node:child_process";
4
11
  import { mkdir, readdir, rm, writeFile } from "node:fs/promises";
@@ -11,11 +18,6 @@ import type { IFilmProduction } from "../IFilmProduction";
11
18
  import { films } from "../composition/films";
12
19
  import { selectFilm } from "../selectFilm";
13
20
  import { planCaptureStills } from "./planCaptureStills";
14
- import { AutoMovieRasterSheet } from "./viewer/node/raster/AutoMovieRasterSheet";
15
- import { type IAutoMovieSceneRaster } from "./viewer/node/raster/IAutoMovieSceneRaster";
16
- import { encodeAutoMovieRasterPng } from "./viewer/node/raster/encodeAutoMovieRasterPng";
17
- import { rasterizeAutoMovieScene } from "./viewer/node/raster/rasterizeAutoMovieScene";
18
- import { stampAutoMovieRasterLabel } from "./viewer/node/raster/stampAutoMovieRasterLabel";
19
21
 
20
22
  /**
21
23
  * Draw film frames straight from Node, with no Viewer server, browser or
@@ -3,17 +3,17 @@
3
3
 
4
4
  /** Dependency versions baked into the scaffold, kept in sync with this repo. */
5
5
  export const AUTOMOVIE_TEMPLATE_VERSIONS: Record<string, string> = {
6
- cli: "^0.0.0",
7
- engine: "^0.0.0",
8
- evidence: "^0.0.0",
9
- human: "^0.0.0",
10
- ingest: "^0.0.0",
11
- interface: "^0.0.0",
12
- motions: "^0.0.0",
13
- recovery: "^0.0.0",
14
- render: "^0.0.0",
15
- template: "^0.0.0",
16
- viewer: "^0.0.0",
6
+ cli: "^0.1.0",
7
+ engine: "^0.1.0",
8
+ evidence: "^0.1.0",
9
+ human: "^0.1.0",
10
+ ingest: "^0.1.0",
11
+ interface: "^0.1.0",
12
+ motions: "^0.1.0",
13
+ recovery: "^0.1.0",
14
+ render: "^0.1.0",
15
+ template: "^0.1.0",
16
+ viewer: "^0.1.0",
17
17
  huggingFaceTransformers: "3.8.1",
18
18
  h264Mp4Encoder: "^1.0.12",
19
19
  ffmpegStatic: "^5.2.0",
@@ -1,221 +0,0 @@
1
- import * as THREE from "three";
2
-
3
- /**
4
- * The scene's lights, read once per frame, and the diffuse irradiance they
5
- * give a surface point: what `rasterizeAutoMovieScene` multiplies by a
6
- * material's albedo.
7
- *
8
- * Ambient, hemisphere, directional, point, spot and rectangular-area lights
9
- * contribute with three.js's punctual-light conventions: colour times
10
- * intensity, Lambert cosine, the renderer's distance attenuation and the spot
11
- * cone falloff; an area light is treated as a point at its position. Shadows,
12
- * light probes and environment maps are not modelled. A scene with no light
13
- * gets a camera headlight and an ambient term so its shapes stay readable.
14
- *
15
- * @evidence contracts/development/common.md#meaningful-documentation The comment lists every light kind read, the conventions applied, what is not modelled, and the fallback for an unlit scene.
16
- * @evidence contracts/development/design.md#principled-representation Lights are flattened once into world-space records, so each triangle's shading is a loop over plain numbers instead of a scene traversal.
17
- * @evidence contracts/development/design.md#minimal-and-owned-surface A constructor and one shading query; light records stay private.
18
- * @evidence contracts/development/design.md#prohibited-design-shortcuts No light is recognised by name or production; the fallback depends only on the absence of lights.
19
- */
20
- export class AutoMovieRasterLighting {
21
- /** World-space light records. */
22
- private readonly lights: ILight[];
23
-
24
- /**
25
- * Read the visible lights under `scene`.
26
- *
27
- * @param scene The drawn scene graph, with current world matrices.
28
- * @param camera The drawing camera, used for the fallback headlight.
29
- */
30
- public constructor(scene: THREE.Object3D, camera: THREE.Camera) {
31
- this.lights = [];
32
- scene.traverseVisible((object: THREE.Object3D): void => {
33
- if (!(object instanceof THREE.Light)) return;
34
- const color: [number, number, number] = [
35
- object.color.r * object.intensity,
36
- object.color.g * object.intensity,
37
- object.color.b * object.intensity,
38
- ];
39
- const position: THREE.Vector3 = new THREE.Vector3().setFromMatrixPosition(
40
- object.matrixWorld,
41
- );
42
- if (object instanceof THREE.AmbientLight)
43
- this.lights.push({ kind: "ambient", color });
44
- else if (object instanceof THREE.HemisphereLight)
45
- this.lights.push({
46
- kind: "hemisphere",
47
- color,
48
- ground: [
49
- object.groundColor.r * object.intensity,
50
- object.groundColor.g * object.intensity,
51
- object.groundColor.b * object.intensity,
52
- ],
53
- direction: position.clone().normalize(),
54
- });
55
- else if (object instanceof THREE.DirectionalLight)
56
- this.lights.push({
57
- kind: "directional",
58
- color,
59
- direction: position
60
- .clone()
61
- .sub(
62
- new THREE.Vector3().setFromMatrixPosition(
63
- object.target.matrixWorld,
64
- ),
65
- )
66
- .normalize(),
67
- });
68
- else if (object instanceof THREE.SpotLight)
69
- this.lights.push({
70
- kind: "point",
71
- color,
72
- position,
73
- distance: object.distance,
74
- decay: object.decay,
75
- cone: {
76
- axis: new THREE.Vector3()
77
- .setFromMatrixPosition(object.target.matrixWorld)
78
- .sub(position)
79
- .normalize(),
80
- outer: Math.cos(object.angle),
81
- inner: Math.cos(object.angle * (1 - object.penumbra)),
82
- },
83
- });
84
- else if (object instanceof THREE.PointLight)
85
- this.lights.push({
86
- kind: "point",
87
- color,
88
- position,
89
- distance: object.distance,
90
- decay: object.decay,
91
- });
92
- else if (object instanceof THREE.RectAreaLight)
93
- this.lights.push({
94
- kind: "point",
95
- color,
96
- position,
97
- distance: 0,
98
- decay: 2,
99
- });
100
- });
101
-
102
- // An unlit scene would draw black; a headlight and ambient term keep its
103
- // shapes readable, scaled by pi so Lambert albedo comes out at 0.3 + 0.8 cos.
104
- if (this.lights.length === 0) {
105
- camera.updateMatrixWorld();
106
- this.lights.push(
107
- {
108
- kind: "ambient",
109
- color: [0.3 * Math.PI, 0.3 * Math.PI, 0.3 * Math.PI],
110
- },
111
- {
112
- kind: "directional",
113
- color: [0.8 * Math.PI, 0.8 * Math.PI, 0.8 * Math.PI],
114
- direction: new THREE.Vector3(0.3, 0.5, 1)
115
- .normalize()
116
- .transformDirection(camera.matrixWorld),
117
- },
118
- );
119
- }
120
- }
121
-
122
- /**
123
- * Diffuse irradiance at a world point with a unit world normal, linear RGB.
124
- * Dividing by pi and multiplying by albedo gives the reflected colour, as
125
- * three.js's Lambert BRDF does.
126
- *
127
- * @evidence contracts/development/common.md#meaningful-documentation States the inputs' spaces, the output's meaning and how a caller turns it into colour.
128
- * @evidence contracts/development/implementation.md#principled-implementation Each light kind uses three.js's own formula: cosine for directional, sky/ground mix for hemisphere, cutoff-windowed inverse power decay and smoothstep cone for punctual lights.
129
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One loop with one branch per light kind.
130
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Back-facing light contributes nothing instead of being mirrored; no light is boosted.
131
- * @evidence contracts/development/implementation.md#efficient-algorithms Linear in the number of lights.
132
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Light records were flattened once in the constructor.
133
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Allocates only the returned triple.
134
- */
135
- public irradiance(
136
- point: THREE.Vector3,
137
- normal: THREE.Vector3,
138
- ): [number, number, number] {
139
- let r: number = 0;
140
- let g: number = 0;
141
- let b: number = 0;
142
- for (const light of this.lights) {
143
- let weight: number = 0;
144
- if (light.kind === "ambient") weight = 1;
145
- else if (light.kind === "hemisphere") {
146
- const sky: number = 0.5 * normal.dot(light.direction) + 0.5;
147
- r += light.ground[0] + (light.color[0] - light.ground[0]) * sky;
148
- g += light.ground[1] + (light.color[1] - light.ground[1]) * sky;
149
- b += light.ground[2] + (light.color[2] - light.ground[2]) * sky;
150
- continue;
151
- } else if (light.kind === "directional")
152
- weight = Math.max(0, normal.dot(light.direction));
153
- else {
154
- const dx: number = light.position.x - point.x;
155
- const dy: number = light.position.y - point.y;
156
- const dz: number = light.position.z - point.z;
157
- const distance: number = Math.hypot(dx, dy, dz);
158
- if (distance === 0) continue;
159
- const cosine: number =
160
- (normal.x * dx + normal.y * dy + normal.z * dz) / distance;
161
- if (cosine <= 0) continue;
162
- weight = cosine * attenuation(distance, light.distance, light.decay);
163
- if (light.cone !== undefined) {
164
- const along: number =
165
- -(
166
- light.cone.axis.x * dx +
167
- light.cone.axis.y * dy +
168
- light.cone.axis.z * dz
169
- ) / distance;
170
- weight *= smoothstep(light.cone.outer, light.cone.inner, along);
171
- }
172
- }
173
- r += light.color[0] * weight;
174
- g += light.color[1] * weight;
175
- b += light.color[2] * weight;
176
- }
177
- return [r, g, b];
178
- }
179
- }
180
-
181
- /** One flattened world-space light. */
182
- type ILight =
183
- | { kind: "ambient"; color: [number, number, number] }
184
- | {
185
- kind: "hemisphere";
186
- color: [number, number, number];
187
- ground: [number, number, number];
188
- direction: THREE.Vector3;
189
- }
190
- | {
191
- kind: "directional";
192
- color: [number, number, number];
193
- direction: THREE.Vector3;
194
- }
195
- | {
196
- kind: "point";
197
- color: [number, number, number];
198
- position: THREE.Vector3;
199
- distance: number;
200
- decay: number;
201
- cone?: { axis: THREE.Vector3; outer: number; inner: number };
202
- };
203
-
204
- /** three.js's punctual-light distance attenuation. */
205
- function attenuation(distance: number, cutoff: number, decay: number): number {
206
- let falloff: number = 1 / Math.max(Math.pow(distance, decay), 0.01);
207
- if (cutoff > 0) {
208
- const ratio: number = Math.min(
209
- 1,
210
- Math.max(0, 1 - Math.pow(distance / cutoff, 4)),
211
- );
212
- falloff *= ratio * ratio;
213
- }
214
- return falloff;
215
- }
216
-
217
- /** Hermite step between two edges, as GLSL's `smoothstep`. */
218
- function smoothstep(edge0: number, edge1: number, x: number): number {
219
- const t: number = Math.min(1, Math.max(0, (x - edge0) / (edge1 - edge0)));
220
- return t * t * (3 - 2 * t);
221
- }
@@ -1,175 +0,0 @@
1
- import type { IAutoMovieSceneRaster } from "./IAutoMovieSceneRaster.js";
2
- import { stampAutoMovieRasterLabel } from "./stampAutoMovieRasterLabel.js";
3
-
4
- /**
5
- * A contact sheet of Node-drawn frames, filled one frame at a time: each
6
- * frame is area-averaged into its cell in row-major order and captioned
7
- * after reduction, so the caption stays legible however small the cell is.
8
- *
9
- * Frames are reduced as they arrive, so a sheet never holds more than its own
10
- * pixels; the finished sheet is an ordinary raster for
11
- * `encodeAutoMovieRasterPng`.
12
- *
13
- * ```ts
14
- * const sheet = new AutoMovieRasterSheet(20, 5, 180, 320);
15
- * for (const [seconds, frame] of frames) sheet.add(frame, `${seconds}s`);
16
- * await writeFile("sheet.png", encodeAutoMovieRasterPng(sheet.finish()));
17
- * ```
18
- *
19
- * @evidence contracts/development/common.md#meaningful-documentation The comment states the fill order, the reduction, when captions are drawn, the memory bound and how the result is encoded.
20
- * @evidence contracts/development/design.md#principled-representation The sheet is itself an IAutoMovieSceneRaster, so encoding and captioning reuse the frame path unchanged.
21
- * @evidence contracts/development/design.md#minimal-and-owned-surface A constructor, `add` and `finish`; layout is fixed by the constructor.
22
- * @evidence contracts/development/design.md#prohibited-design-shortcuts Nothing names a film or capture command; captions are caller text.
23
- */
24
- export class AutoMovieRasterSheet {
25
- /** The sheet pixels, opaque RGBA. */
26
- private readonly sheet: IAutoMovieSceneRaster;
27
-
28
- /** Cells filled so far. */
29
- private count: number;
30
-
31
- /** Number of cells. */
32
- private readonly capacity: number;
33
-
34
- /** Cells per row. */
35
- private readonly columns: number;
36
-
37
- /** Cell width in pixels. */
38
- private readonly cellWidth: number;
39
-
40
- /** Cell height in pixels. */
41
- private readonly cellHeight: number;
42
-
43
- /**
44
- * Allocate an empty sheet.
45
- *
46
- * @param capacity Number of cells, a positive integer.
47
- * @param columns Cells per row, a positive integer.
48
- * @param cellWidth Cell width in pixels, a positive integer.
49
- * @param cellHeight Cell height in pixels, a positive integer.
50
- */
51
- public constructor(
52
- capacity: number,
53
- columns: number,
54
- cellWidth: number,
55
- cellHeight: number,
56
- ) {
57
- this.capacity = capacity;
58
- this.columns = columns;
59
- this.cellWidth = cellWidth;
60
- this.cellHeight = cellHeight;
61
- if (
62
- ![capacity, columns, cellWidth, cellHeight].every(
63
- (value: number): boolean => Number.isSafeInteger(value) && value > 0,
64
- )
65
- )
66
- throw new Error(
67
- "Sheet capacity, columns and cell size must be positive integers",
68
- );
69
- const used: number = Math.min(columns, capacity);
70
- const width: number = used * cellWidth;
71
- const height: number = Math.ceil(capacity / used) * cellHeight;
72
- if (width * height > 64_000_000)
73
- throw new Error("Sheet exceeds 64 megapixels");
74
- this.sheet = {
75
- width,
76
- height,
77
- pixels: new Uint8ClampedArray(width * height * 4),
78
- statistics: {
79
- meshes: 0,
80
- triangles: 0,
81
- lines: 0,
82
- points: 0,
83
- skipped: {},
84
- untextured: 0,
85
- approximated: 0,
86
- },
87
- };
88
- for (let offset: number = 3; offset < this.sheet.pixels.length; offset += 4)
89
- this.sheet.pixels[offset] = 255;
90
- this.count = 0;
91
- }
92
-
93
- /**
94
- * Reduce one frame into the next cell and caption it.
95
- *
96
- * @evidence contracts/development/common.md#meaningful-documentation States that the frame fills the next cell and receives the caption.
97
- * @evidence contracts/development/implementation.md#principled-implementation Each cell pixel averages the source pixels its footprint covers, so thin lines and small figures survive reduction instead of being skipped by point sampling.
98
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One pass over the cell's pixels, then one caption.
99
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts A full sheet throws instead of overwriting a cell.
100
- * @evidence contracts/development/implementation.md#efficient-algorithms Linear in the source frame's pixel count.
101
- * @evidence contracts/development/implementation.md#reuse-equivalent-work The caption reuses the frame label stamp on a cell view of the sheet.
102
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The frame is not retained.
103
- */
104
- public add(frame: IAutoMovieSceneRaster, caption: string): void {
105
- if (this.count >= this.capacity) throw new Error("The sheet is full");
106
- const left: number = (this.count % this.columns) * this.cellWidth;
107
- const top: number = Math.floor(this.count / this.columns) * this.cellHeight;
108
- const cell: IAutoMovieSceneRaster = {
109
- width: this.cellWidth,
110
- height: this.cellHeight,
111
- pixels: new Uint8ClampedArray(this.cellWidth * this.cellHeight * 4),
112
- statistics: this.sheet.statistics,
113
- };
114
- for (let y: number = 0; y < this.cellHeight; y++) {
115
- const y0: number = Math.floor((y * frame.height) / this.cellHeight);
116
- const y1: number = Math.max(
117
- y0 + 1,
118
- Math.floor(((y + 1) * frame.height) / this.cellHeight),
119
- );
120
- for (let x: number = 0; x < this.cellWidth; x++) {
121
- const x0: number = Math.floor((x * frame.width) / this.cellWidth);
122
- const x1: number = Math.max(
123
- x0 + 1,
124
- Math.floor(((x + 1) * frame.width) / this.cellWidth),
125
- );
126
- let r: number = 0;
127
- let g: number = 0;
128
- let b: number = 0;
129
- for (let sy: number = y0; sy < y1; sy++)
130
- for (let sx: number = x0; sx < x1; sx++) {
131
- const source: number = (sy * frame.width + sx) * 4;
132
- r += frame.pixels[source]!;
133
- g += frame.pixels[source + 1]!;
134
- b += frame.pixels[source + 2]!;
135
- }
136
- const n: number = (y1 - y0) * (x1 - x0);
137
- const target: number = (y * this.cellWidth + x) * 4;
138
- cell.pixels[target] = r / n;
139
- cell.pixels[target + 1] = g / n;
140
- cell.pixels[target + 2] = b / n;
141
- cell.pixels[target + 3] = 255;
142
- }
143
- }
144
- stampAutoMovieRasterLabel(
145
- cell,
146
- caption,
147
- Math.max(1, Math.round(this.cellHeight / 90)),
148
- );
149
- for (let y: number = 0; y < this.cellHeight; y++)
150
- this.sheet.pixels.set(
151
- cell.pixels.subarray(
152
- y * this.cellWidth * 4,
153
- (y + 1) * this.cellWidth * 4,
154
- ),
155
- ((top + y) * this.sheet.width + left) * 4,
156
- );
157
- this.count++;
158
- }
159
-
160
- /**
161
- * The sheet as filled so far; unfilled cells stay black.
162
- *
163
- * @evidence contracts/development/common.md#meaningful-documentation States what the result holds and how unfilled cells look.
164
- * @evidence contracts/development/implementation.md#principled-implementation Returns the sheet raster itself, which every frame was reduced into.
165
- * @evidence contracts/development/implementation.md#clear-and-simple-structure A single return.
166
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts An empty sheet throws rather than producing a blank image.
167
- * @evidence contracts/development/implementation.md#efficient-algorithms Constant time.
168
- * @evidence contracts/development/implementation.md#reuse-equivalent-work No copy is made.
169
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The caller owns the returned raster; the sheet keeps no other buffer.
170
- */
171
- public finish(): IAutoMovieSceneRaster {
172
- if (this.count === 0) throw new Error("The sheet has no frames");
173
- return this.sheet;
174
- }
175
- }