@automovie/render 0.3.1 → 0.3.2
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/lib/AutoMovieFrameGrid.d.ts +54 -0
- package/lib/AutoMovieFrameGrid.js +71 -0
- package/lib/AutoMovieFrameGrid.js.map +1 -0
- package/lib/AutoMovieFrameGrid.mjs +20 -0
- package/lib/AutoMovieFrameGrid.mjs.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +2 -1
- package/package.json +4 -4
- package/src/AutoMovieFrameGrid.ts +70 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zero-based, regularly spaced presentation frames followed by the exact end.
|
|
3
|
+
* Takes and preview controls share the grid, including an endpoint that falls
|
|
4
|
+
* between regular frame times.
|
|
5
|
+
*
|
|
6
|
+
* @evidence contracts/development/common.md#meaningful-documentation States the index origin, temporal spacing, endpoint, and consumers.
|
|
7
|
+
* @evidence contracts/development/design.md#principled-representation Frame indices are zero-based integers, timestamps and duration are seconds, and cadence is positive frames per second. JavaScript numbers do not enforce these constraints, so the caller supplies a valid presentation clock and index.
|
|
8
|
+
* @evidence contracts/development/design.md#minimal-and-owned-surface Render owns frame schedules. The take producer reads the last index and frame times, and the preview controls also map a playhead second to a displayed frame index.
|
|
9
|
+
* @evidence contracts/development/design.md#prohibited-design-shortcuts The endpoint rule works for both exact-grid and fractional durations and requires no caller-specific mode.
|
|
10
|
+
*/
|
|
11
|
+
export declare namespace AutoMovieFrameGrid {
|
|
12
|
+
/**
|
|
13
|
+
* Find the final zero-based frame number for a nonnegative duration in
|
|
14
|
+
* seconds and a positive rate in frames per second. The exact end takes
|
|
15
|
+
* the place of the first regular frame at or past the end.
|
|
16
|
+
*
|
|
17
|
+
* @evidence contracts/development/common.md#meaningful-documentation Defines the units, index origin, and the final frame's relation to the regular cadence.
|
|
18
|
+
* @evidence contracts/development/implementation.md#principled-implementation Compares the candidate's canonical timestamp to the end since the product alone can round across an integer.
|
|
19
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure Computes one candidate, then advances it if its timestamp is still before the end.
|
|
20
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Keeps a fractional end distinct from the regular frame immediately before it without an arbitrary epsilon.
|
|
21
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Constant time and space.
|
|
22
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Computes one candidate and its time.
|
|
23
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Retains no state.
|
|
24
|
+
*/
|
|
25
|
+
function last(duration: number, fps: number): number;
|
|
26
|
+
/**
|
|
27
|
+
* Read a zero-based frame's timestamp in seconds at the given rate in
|
|
28
|
+
* frames per second, clamped to the final timestamp, `duration`.
|
|
29
|
+
*
|
|
30
|
+
* @evidence contracts/development/common.md#meaningful-documentation Defines the index origin, input and return units, and the end clamp.
|
|
31
|
+
* @evidence contracts/development/implementation.md#principled-implementation One division yields the canonical timestamp without accumulating rounding error.
|
|
32
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure Divides the index by the rate and clamps the result.
|
|
33
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Returns the exact end when the next regular frame would run past it.
|
|
34
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Constant time and space.
|
|
35
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Computes one timestamp.
|
|
36
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Retains no state.
|
|
37
|
+
*/
|
|
38
|
+
function time(frame: number, duration: number, fps: number): number;
|
|
39
|
+
/**
|
|
40
|
+
* Show the closest regular frame for an in-range second, reserving the
|
|
41
|
+
* final frame for the exact end. The caller supplies the duration in
|
|
42
|
+
* seconds, the rate in frames per second, and the already computed last
|
|
43
|
+
* frame number.
|
|
44
|
+
*
|
|
45
|
+
* @evidence contracts/development/common.md#meaningful-documentation Defines the rounding policy, the exact end, and the units of the supplied clock.
|
|
46
|
+
* @evidence contracts/development/implementation.md#principled-implementation Rounds within the regular grid and reserves the end index for the actual end, so it remains a separate scrubber position.
|
|
47
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure Returns the last index at the end and otherwise rounds and caps the regular index.
|
|
48
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts A playhead just before the end cannot occupy the end index.
|
|
49
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Constant time and space.
|
|
50
|
+
* @evidence contracts/development/implementation.md#reuse-equivalent-work Uses the last frame number already computed for the grid.
|
|
51
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Retains no state.
|
|
52
|
+
*/
|
|
53
|
+
function nearest(seconds: number, duration: number, fps: number, last: number): number;
|
|
54
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AutoMovieFrameGrid = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Zero-based, regularly spaced presentation frames followed by the exact end.
|
|
6
|
+
* Takes and preview controls share the grid, including an endpoint that falls
|
|
7
|
+
* between regular frame times.
|
|
8
|
+
*
|
|
9
|
+
* @evidence contracts/development/common.md#meaningful-documentation States the index origin, temporal spacing, endpoint, and consumers.
|
|
10
|
+
* @evidence contracts/development/design.md#principled-representation Frame indices are zero-based integers, timestamps and duration are seconds, and cadence is positive frames per second. JavaScript numbers do not enforce these constraints, so the caller supplies a valid presentation clock and index.
|
|
11
|
+
* @evidence contracts/development/design.md#minimal-and-owned-surface Render owns frame schedules. The take producer reads the last index and frame times, and the preview controls also map a playhead second to a displayed frame index.
|
|
12
|
+
* @evidence contracts/development/design.md#prohibited-design-shortcuts The endpoint rule works for both exact-grid and fractional durations and requires no caller-specific mode.
|
|
13
|
+
*/
|
|
14
|
+
var AutoMovieFrameGrid;
|
|
15
|
+
(function (AutoMovieFrameGrid) {
|
|
16
|
+
/**
|
|
17
|
+
* Find the final zero-based frame number for a nonnegative duration in
|
|
18
|
+
* seconds and a positive rate in frames per second. The exact end takes
|
|
19
|
+
* the place of the first regular frame at or past the end.
|
|
20
|
+
*
|
|
21
|
+
* @evidence contracts/development/common.md#meaningful-documentation Defines the units, index origin, and the final frame's relation to the regular cadence.
|
|
22
|
+
* @evidence contracts/development/implementation.md#principled-implementation Compares the candidate's canonical timestamp to the end since the product alone can round across an integer.
|
|
23
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure Computes one candidate, then advances it if its timestamp is still before the end.
|
|
24
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Keeps a fractional end distinct from the regular frame immediately before it without an arbitrary epsilon.
|
|
25
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Constant time and space.
|
|
26
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Computes one candidate and its time.
|
|
27
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Retains no state.
|
|
28
|
+
*/
|
|
29
|
+
function last(duration, fps) {
|
|
30
|
+
const nearest = Math.round(duration * fps);
|
|
31
|
+
return nearest / fps < duration ? nearest + 1 : nearest;
|
|
32
|
+
}
|
|
33
|
+
AutoMovieFrameGrid.last = last;
|
|
34
|
+
/**
|
|
35
|
+
* Read a zero-based frame's timestamp in seconds at the given rate in
|
|
36
|
+
* frames per second, clamped to the final timestamp, `duration`.
|
|
37
|
+
*
|
|
38
|
+
* @evidence contracts/development/common.md#meaningful-documentation Defines the index origin, input and return units, and the end clamp.
|
|
39
|
+
* @evidence contracts/development/implementation.md#principled-implementation One division yields the canonical timestamp without accumulating rounding error.
|
|
40
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure Divides the index by the rate and clamps the result.
|
|
41
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Returns the exact end when the next regular frame would run past it.
|
|
42
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Constant time and space.
|
|
43
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Computes one timestamp.
|
|
44
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Retains no state.
|
|
45
|
+
*/
|
|
46
|
+
function time(frame, duration, fps) {
|
|
47
|
+
return Math.min(frame / fps, duration);
|
|
48
|
+
}
|
|
49
|
+
AutoMovieFrameGrid.time = time;
|
|
50
|
+
/**
|
|
51
|
+
* Show the closest regular frame for an in-range second, reserving the
|
|
52
|
+
* final frame for the exact end. The caller supplies the duration in
|
|
53
|
+
* seconds, the rate in frames per second, and the already computed last
|
|
54
|
+
* frame number.
|
|
55
|
+
*
|
|
56
|
+
* @evidence contracts/development/common.md#meaningful-documentation Defines the rounding policy, the exact end, and the units of the supplied clock.
|
|
57
|
+
* @evidence contracts/development/implementation.md#principled-implementation Rounds within the regular grid and reserves the end index for the actual end, so it remains a separate scrubber position.
|
|
58
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure Returns the last index at the end and otherwise rounds and caps the regular index.
|
|
59
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts A playhead just before the end cannot occupy the end index.
|
|
60
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Constant time and space.
|
|
61
|
+
* @evidence contracts/development/implementation.md#reuse-equivalent-work Uses the last frame number already computed for the grid.
|
|
62
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Retains no state.
|
|
63
|
+
*/
|
|
64
|
+
function nearest(seconds, duration, fps, last) {
|
|
65
|
+
return seconds >= duration
|
|
66
|
+
? last
|
|
67
|
+
: Math.min(last - 1, Math.round(seconds * fps));
|
|
68
|
+
}
|
|
69
|
+
AutoMovieFrameGrid.nearest = nearest;
|
|
70
|
+
})(AutoMovieFrameGrid || (exports.AutoMovieFrameGrid = AutoMovieFrameGrid = {}));
|
|
71
|
+
//# sourceMappingURL=AutoMovieFrameGrid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutoMovieFrameGrid.js","sourceRoot":"","sources":["../src/AutoMovieFrameGrid.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;GASG;AACH,IAAiB,kBAAkB,CA2DlC;AA3DD,WAAiB,kBAAkB;IACjC;;;;;;;;;;;;OAYG;IACH,SAAgB,IAAI,CAAC,QAAgB,EAAE,GAAW;QAChD,MAAM,OAAO,GAAW,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,GAAG,CAAC,CAAC;QACnD,OAAO,OAAO,GAAG,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAC1D,CAAC;IAHe,mBAAA,IAAI,OAGnB,CAAA;IAED;;;;;;;;;;;OAWG;IACH,SAAgB,IAAI,CAAC,KAAa,EAAE,QAAgB,EAAE,GAAW;QAC/D,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,GAAG,EAAE,QAAQ,CAAC,CAAC;IACzC,CAAC;IAFe,mBAAA,IAAI,OAEnB,CAAA;IAED;;;;;;;;;;;;;OAaG;IACH,SAAgB,OAAO,CACrB,OAAe,EACf,QAAgB,EAChB,GAAW,EACX,IAAY;QAEZ,OAAO,OAAO,IAAI,QAAQ;YACxB,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC;IACpD,CAAC;IATe,mBAAA,OAAO,UAStB,CAAA;AACH,CAAC,EA3DgB,kBAAkB,aAAlB,kBAAkB,GAAlB,kBAAkB,QA2DlC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// src/AutoMovieFrameGrid.ts
|
|
2
|
+
let AutoMovieFrameGrid;
|
|
3
|
+
(function(_AutoMovieFrameGrid) {
|
|
4
|
+
function last(duration, fps) {
|
|
5
|
+
const nearest = Math.round(duration * fps);
|
|
6
|
+
return nearest / fps < duration ? nearest + 1 : nearest;
|
|
7
|
+
}
|
|
8
|
+
_AutoMovieFrameGrid.last = last;
|
|
9
|
+
function time(frame, duration, fps) {
|
|
10
|
+
return Math.min(frame / fps, duration);
|
|
11
|
+
}
|
|
12
|
+
_AutoMovieFrameGrid.time = time;
|
|
13
|
+
function nearest(seconds, duration, fps, last) {
|
|
14
|
+
return seconds >= duration ? last : Math.min(last - 1, Math.round(seconds * fps));
|
|
15
|
+
}
|
|
16
|
+
_AutoMovieFrameGrid.nearest = nearest;
|
|
17
|
+
})(AutoMovieFrameGrid || (AutoMovieFrameGrid = {}));
|
|
18
|
+
export { AutoMovieFrameGrid };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=AutoMovieFrameGrid.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutoMovieFrameGrid.mjs","names":[],"sources":["../src/AutoMovieFrameGrid.ts"],"sourcesContent":["/**\n * Zero-based, regularly spaced presentation frames followed by the exact end.\n * Takes and preview controls share the grid, including an endpoint that falls\n * between regular frame times.\n *\n * @evidence contracts/development/common.md#meaningful-documentation States the index origin, temporal spacing, endpoint, and consumers.\n * @evidence contracts/development/design.md#principled-representation Frame indices are zero-based integers, timestamps and duration are seconds, and cadence is positive frames per second. JavaScript numbers do not enforce these constraints, so the caller supplies a valid presentation clock and index.\n * @evidence contracts/development/design.md#minimal-and-owned-surface Render owns frame schedules. The take producer reads the last index and frame times, and the preview controls also map a playhead second to a displayed frame index.\n * @evidence contracts/development/design.md#prohibited-design-shortcuts The endpoint rule works for both exact-grid and fractional durations and requires no caller-specific mode.\n */\nexport namespace AutoMovieFrameGrid {\n /**\n * Find the final zero-based frame number for a nonnegative duration in\n * seconds and a positive rate in frames per second. The exact end takes\n * the place of the first regular frame at or past the end.\n *\n * @evidence contracts/development/common.md#meaningful-documentation Defines the units, index origin, and the final frame's relation to the regular cadence.\n * @evidence contracts/development/implementation.md#principled-implementation Compares the candidate's canonical timestamp to the end since the product alone can round across an integer.\n * @evidence contracts/development/implementation.md#clear-and-simple-structure Computes one candidate, then advances it if its timestamp is still before the end.\n * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Keeps a fractional end distinct from the regular frame immediately before it without an arbitrary epsilon.\n * @evidence contracts/development/implementation.md#efficient-algorithms Constant time and space.\n * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Computes one candidate and its time.\n * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Retains no state.\n */\n export function last(duration: number, fps: number): number {\n const nearest: number = Math.round(duration * fps);\n return nearest / fps < duration ? nearest + 1 : nearest;\n }\n\n /**\n * Read a zero-based frame's timestamp in seconds at the given rate in\n * frames per second, clamped to the final timestamp, `duration`.\n *\n * @evidence contracts/development/common.md#meaningful-documentation Defines the index origin, input and return units, and the end clamp.\n * @evidence contracts/development/implementation.md#principled-implementation One division yields the canonical timestamp without accumulating rounding error.\n * @evidence contracts/development/implementation.md#clear-and-simple-structure Divides the index by the rate and clamps the result.\n * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Returns the exact end when the next regular frame would run past it.\n * @evidence contracts/development/implementation.md#efficient-algorithms Constant time and space.\n * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Computes one timestamp.\n * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Retains no state.\n */\n export function time(frame: number, duration: number, fps: number): number {\n return Math.min(frame / fps, duration);\n }\n\n /**\n * Show the closest regular frame for an in-range second, reserving the\n * final frame for the exact end. The caller supplies the duration in\n * seconds, the rate in frames per second, and the already computed last\n * frame number.\n *\n * @evidence contracts/development/common.md#meaningful-documentation Defines the rounding policy, the exact end, and the units of the supplied clock.\n * @evidence contracts/development/implementation.md#principled-implementation Rounds within the regular grid and reserves the end index for the actual end, so it remains a separate scrubber position.\n * @evidence contracts/development/implementation.md#clear-and-simple-structure Returns the last index at the end and otherwise rounds and caps the regular index.\n * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts A playhead just before the end cannot occupy the end index.\n * @evidence contracts/development/implementation.md#efficient-algorithms Constant time and space.\n * @evidence contracts/development/implementation.md#reuse-equivalent-work Uses the last frame number already computed for the grid.\n * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Retains no state.\n */\n export function nearest(\n seconds: number,\n duration: number,\n fps: number,\n last: number,\n ): number {\n return seconds >= duration\n ? last\n : Math.min(last - 1, Math.round(seconds * fps));\n }\n}\n"],"mappings":";AAUO,IAAU;CAAV,SAAA,qBAAA;CAcE,SAAS,KAAK,UAAkB,KAAqB;EAC1D,MAAM,UAAkB,KAAK,MAAM,WAAW,GAAG;EACjD,OAAO,UAAU,MAAM,WAAW,UAAU,IAAI;CAClD;;CAcO,SAAS,KAAK,OAAe,UAAkB,KAAqB;EACzE,OAAO,KAAK,IAAI,QAAQ,KAAK,QAAQ;CACvC;;CAgBO,SAAS,QACd,SACA,UACA,KACA,MACQ;EACR,OAAO,WAAW,WACd,OACA,KAAK,IAAI,OAAO,GAAG,KAAK,MAAM,UAAU,GAAG,CAAC;CAClD;;AACD,EAAA,CAAA,uBAAA,qBAAA,CAAA,EAAD"}
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./caption/index.js"), exports);
|
|
18
18
|
__exportStar(require("./capture/index.js"), exports);
|
|
19
19
|
__exportStar(require("./delivery/index.js"), exports);
|
|
20
|
+
__exportStar(require("./AutoMovieFrameGrid.js"), exports);
|
|
20
21
|
__exportStar(require("./draw/index.js"), exports);
|
|
21
22
|
__exportStar(require("./film/index.js"), exports);
|
|
22
23
|
__exportStar(require("./ffmpegArgs.js"), exports);
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,qDAAmC;AACnC,sDAAoC;AACpC,kDAAgC;AAChC,kDAAgC;AAChC,kDAAgC;AAChC,iDAA+B;AAC/B,oDAAkC;AAClC,kDAAgC;AAChC,mEAAiD;AACjD,mEAAiD;AACjD,qEAAmD;AACnD,+DAA6C;AAC7C,oDAAkC;AAClC,mEAAiD;AACjD,8DAA4C;AAC5C,sDAAoC;AACpC,iEAA+C;AAC/C,mDAAiC;AACjC,qDAAmC;AACnC,mDAAiC;AACjC,wDAAsC;AACtC,gEAA8C;AAC9C,+DAA6C;AAC7C,8DAA4C;AAC5C,qEAAmD;AACnD,oEAAkD;AAClD,wEAAsD;AACtD,8EAA4D;AAC5D,qEAAmD;AACnD,oEAAkD;AAClD,0DAAwC;AACxC,4DAA0C;AAC1C,wEAAsD;AACtD,sEAAoD;AACpD,6EAA2D;AAC3D,4EAA0D;AAC1D,2DAAyC;AACzC,4DAA0C;AAC1C,0DAAwC;AACxC,8DAA4C;AAC5C,gEAA8C;AAC9C,4DAA0C;AAC1C,2DAAyC;AACzC,6DAA2C;AAC3C,oEAAkD;AAClD,kEAAgD;AAChD,iEAA+C;AAC/C,iEAA+C;AAC/C,8DAA4C;AAC5C,mDAAiC;AACjC,0DAAwC;AACxC,6DAA2C;AAC3C,iEAA+C;AAC/C,4DAA0C;AAC1C,4DAA0C;AAC1C,mDAAiC;AACjC,8EAA4D;AAC5D,gEAA8C;AAC9C,mDAAiC;AACjC,iFAA+D;AAC/D,6EAA2D;AAC3D,8EAA4D;AAC5D,+EAA6D;AAC7D,4EAA0D;AAC1D,kFAAgE;AAChE,qEAAmD;AACnD,kEAAgD;AAChD,4EAA0D;AAC1D,0EAAwD;AACxD,0EAAwD;AACxD,2EAAyD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,qDAAmC;AACnC,sDAAoC;AACpC,0DAAwC;AACxC,kDAAgC;AAChC,kDAAgC;AAChC,kDAAgC;AAChC,iDAA+B;AAC/B,oDAAkC;AAClC,kDAAgC;AAChC,mEAAiD;AACjD,mEAAiD;AACjD,qEAAmD;AACnD,+DAA6C;AAC7C,oDAAkC;AAClC,mEAAiD;AACjD,8DAA4C;AAC5C,sDAAoC;AACpC,iEAA+C;AAC/C,mDAAiC;AACjC,qDAAmC;AACnC,mDAAiC;AACjC,wDAAsC;AACtC,gEAA8C;AAC9C,+DAA6C;AAC7C,8DAA4C;AAC5C,qEAAmD;AACnD,oEAAkD;AAClD,wEAAsD;AACtD,8EAA4D;AAC5D,qEAAmD;AACnD,oEAAkD;AAClD,0DAAwC;AACxC,4DAA0C;AAC1C,wEAAsD;AACtD,sEAAoD;AACpD,6EAA2D;AAC3D,4EAA0D;AAC1D,2DAAyC;AACzC,4DAA0C;AAC1C,0DAAwC;AACxC,8DAA4C;AAC5C,gEAA8C;AAC9C,4DAA0C;AAC1C,2DAAyC;AACzC,6DAA2C;AAC3C,oEAAkD;AAClD,kEAAgD;AAChD,iEAA+C;AAC/C,iEAA+C;AAC/C,8DAA4C;AAC5C,mDAAiC;AACjC,0DAAwC;AACxC,6DAA2C;AAC3C,iEAA+C;AAC/C,4DAA0C;AAC1C,4DAA0C;AAC1C,mDAAiC;AACjC,8EAA4D;AAC5D,gEAA8C;AAC9C,mDAAiC;AACjC,iFAA+D;AAC/D,6EAA2D;AAC3D,8EAA4D;AAC5D,+EAA6D;AAC7D,4EAA0D;AAC1D,kFAAgE;AAChE,qEAAmD;AACnD,kEAAgD;AAChD,4EAA0D;AAC1D,0EAAwD;AACxD,0EAAwD;AACxD,2EAAyD"}
|
package/lib/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "./caption/index.mjs";
|
|
2
2
|
import "./capture/index.mjs";
|
|
3
3
|
import "./delivery/index.mjs";
|
|
4
|
+
import { AutoMovieFrameGrid } from "./AutoMovieFrameGrid.mjs";
|
|
4
5
|
import { auditAutoMovieRenderObservation } from "./auditAutoMovieRenderObservation.mjs";
|
|
5
6
|
import "./draw/index.mjs";
|
|
6
7
|
import { parseAutoMovieCaptionLanguage } from "./caption/parseAutoMovieCaptionLanguage.mjs";
|
|
@@ -290,4 +291,4 @@ import { assertProductionOpusProfile } from "./delivery/assertProductionOpusProf
|
|
|
290
291
|
import { productionOpusDescription } from "./delivery/productionOpusDescription.mjs";
|
|
291
292
|
import { AUTOMOVIE_MP4_SRGB_COLOUR } from "./delivery/AUTOMOVIE_MP4_SRGB_COLOUR.mjs";
|
|
292
293
|
import { AUTOMOVIE_MP4_UNITY_MATRIX } from "./delivery/AUTOMOVIE_MP4_UNITY_MATRIX.mjs";
|
|
293
|
-
export { AUTOMOVIE_FORMATION_CYCLE_SAMPLES, AUTOMOVIE_GUIDE_PASSES, AUTOMOVIE_MP4_SRGB_COLOUR, AUTOMOVIE_MP4_UNITY_MATRIX, AUTOMOVIE_PRODUCTION_OPUS_PROFILE, AUTO_MOVIE_CAPTURE_PLAN_KEYS, AUTO_MOVIE_DRAW_GLOBALS, AUTO_MOVIE_INSPECTION_DEPTH_LEAD, AUTO_MOVIE_INSPECTION_KEYS, AUTO_MOVIE_INSPECTION_KINDS, AUTO_MOVIE_INSPECTION_PALETTE, AutoMovieCaptureFolder, AutoMovieDrawSession, AutoMovieGeometryPhysicalVertices, AutoMoviePlayer, AutoMovieRasterSheet, AutoMovieResourceRetirementScope, AutoMovieSkinnedMesh, AutoMovieTextureCache, DEPTH_NORMALIZATION_RANGE, DETAIL_NORMAL_TARGET, EDGE_SHELL_NAME, EDGE_WIDTH, POSE_OVERLAY_NAME, RELIEF_WEIGHT_TARGET, SPACE_GROUP_NAME, SUBSURFACE_TARGET, addMaterialShaderPatch, applyAutoMovieDeliveryCrop, applyAutoMovieInspection, applyAutoMovieInspectionSection, applyAutoMovieInspectionShade, applyAutoMovieRigLocals, applyAutoMovieSectionPlanes, applyAutoMovieSemanticMask, applyAutoMovieShadowParticipation, applyAutoMovieViewerSubjectPose, applyDetailNormal, applyDualQuaternionSkinning, applyExpression, applyFormationCycleCadence, applyFormationCycleMaterial, applyLightMotion, applyLightState, applyMaterialOverlays, applyMaterialShaderPatches, applyObjectMotion, applyObjectMotions, applyPose, applyPracticalSurfaceMaterials, applyReliefWeights, applyRenderMode, applyRendererEnvironment, applySceneEnvironment, applySceneFog, applySubsurfaceShading, applyTransform, assertAutoMovieCaptureClock, assertAutoMovieSceneShadowProfile, assertAutoMovieViewerCameraDepthPrecision, assertProductionOpusProfile, assertProductionPngPicture, assertProductionVideoProfile, assessAutoMovieRenderBudget, attachAutoMovieSemanticMask, auditAutoMovieDecodedFrames, auditAutoMovieEncodedPresentation, auditAutoMovieRenderObservation, auditAutoMovieSemanticMaskScene, autoMovieAnalysisRampColor, autoMovieCaptionLanguageComparisonKey, autoMovieInspectionPathOf, autoMovieRenderBudgetEvidence, autoMovieRenderBudgetRefusal, autoMovieRenderTargetRendererOfGraphics, autoMovieRenderTargetSettingsOfShot, autoMovieSemanticMaskOf, autoMovieViewerNamedViewpoints, autoMovieViewerPoseFromHeading, autoMovieViewerSubjectKey, autoMovieViewerTurntableViewpoints, bakeFormationCycle, beatCaptions, bindAutoMovieDrawSceneSoftProps, buildAnalysisOverlayObject, buildAutoMovieConstruction, buildAutoMovieInspectionMarks, buildAutoMovieMaterialLibrary, buildFluidSprayObject, buildFluidSurfaceObject, buildGeometry, buildHumanCartoonFace, buildHumanPolygon, buildInstancedEffect, buildInstancedFormation, buildInstancedInstanceSet, buildLight, buildMaterial, buildModel, buildPlantingObject, buildPolygonShotActor, buildPropArticulation, buildScene, buildSceneSoftProps, buildSoftBodyObject, buildSpaceObject, canonicalProductionWebVtt, canonicalizeAutoMovieCaptionText, captureAutoMovieFramebufferRestore, captureAutoMovieMetricFrame, captureAutoMovieViewerSubjectView, captureViewerSnapshot, chooseAutoMovieInspectionMarks, collectAutoMovieOwnedResources, colorAutoMovieInspectionObjects, compareAutoMovieCaptureRounds, compareAutoMovieRasters, constructAutoMovieOwnedResources, createAutoMovieClosedSphereGeometry, createAutoMovieHttpArtifactStore, createAutoMovieHumanPolygonFigure, createAutoMovieInspectionDots, createAutoMovieInspectionStrokes, createAutoMovieMetricOrthographicCamera, createAutoMoviePhysicalPoseAdapter, createAutoMovieResourceRetirement, createAutoMovieSurfaceAppearance, createDetailNormalShaderPatch, createDualQuaternionSkinningShaderPatch, createImportedModelObject, createReliefWeightShaderPatch, decodeAutoMovieDrawPixels, decodeAutoMovieRasterPng, defaultMaterial, describeAutoMovieDrawScene, detailNormalFragment, detailNormalVertex, disposeCrossDissolve, disposeFadeToBlack, dualQuaternionSkinningOf, dualQuaternionSkinningVertex, encodeAutoMovieDrawPixels, encodeAutoMovieRasterPng, encodeAutoMovieWavPcm16, equalOrderedScalars, evaluateAutoMovieViewerCameraDepthPrecision, expandAutoMovieInspectionSweep, ffmpegArgs, flattenInstancedModel, flattenInstancedObject, focusAutoMovieInspection, formatAutoMovieCapturePlanRequest, formatAutoMovieInspectionCameraView, formatAutoMovieInspectionRequest, formatAutoMovieInspectionView, formationCycleCadence, formationCycleGait, formationCycleOf, formationCyclePosition, formationCycleStride, frameAutoMovieViewerSubject, frameName, framePattern, frameTimes, guardAutoMovieRenderModeRetirement, guardAutoMovieSceneShadowRetirement, guidePassFrameName, guidePassFramePattern, hashAutoMovieRasterImage, inspectAutoMovieCaptionReadabilityWithRuntime, installAutoMovieDraw, instancedModelParts, invalidateAutoMovieSceneShadowPrograms, invalidateAutoMovieSkinnedPose, isAutoMovieWebVttIdentifier, isGuidePass, legendAutoMovieInspectionMarks, listAutoMovieInspectionKinds, listAutoMovieInspectionPaths, mapImportedHumanoidBones, markAutoMovieInspectionTrails, maskColor, matchAutoMovieInspectionPath, materialOverlayFragment, materialOverlayVertex, materialTextureBindings, measureAutoMovieInspectionBounds, measureAutoMovieInspectionDefects, measureAutoMovieInspectionEdges, measureAutoMovieInspectionMeshes, measureAutoMovieInspectionPaths, mergeAutoMovieInspectionLegends, mixAutoMovieAudioPcm, normalizeGuidePasses, observeAutoMovieRendererFrame, parseAutoMovieCaptionLanguage, parseAutoMovieCapturePlanRequest, parseAutoMovieInspectionRequest, parseAutoMovieInspectionView, parseAutoMovieViewerSubjectKey, placeAutoMovieInspectionLabels, planAutoMovieCapture, planAutoMovieCaptureFrames, planAutoMovieCaptureLayout, planAutoMovieCaptureUrl, planAutoMovieDrawCall, planAutoMovieInspectionTrailTimes, planAutoMovieVideoEncoding, planAutoMovieVideoFrames, planAutoMovieVideoSceneCuts, planCaptionSidecar, planChunkedSequenceRender, planGuidePassOutputs, planPoseKeypointSidecar, planProductionRenderJob, planSequenceRender, planViewerFrameTimes, productionOpusDescription, productionVisualDeliveryOccurrence, readAutoMovieCaptureArguments, readAutoMovieCubeShadowDepth, readAutoMovieDeliveryCrop, readAutoMovieDisplayDestinationEncoding, readAutoMovieFilmDisplayTextureResidency, readAutoMovieMaterialTextureSources, readAutoMovieRenderTextureTarget, readAutoMovieShadowLightSource, readAutoMovieShadowTextureTargets, readAutoMovieTextureSource, readAutoMovieTransmissionTextureTarget, readAutoMovieVideoSceneCuts, regenerateFormationSlot, regenerateInstanceSlot, releaseViewerRenderer, reliefWeightFragment, reliefWeightVertex, renderAndSee, renderAutoMovieDrawnVideo, renderAutoMovieFilmFrame, renderAutoMovieScenePass, renderCaptionSidecar, renderCrossDissolve, renderCrossDissolveFrames, renderFadeToBlackFrame, renderPathStem, renderPoseKeypointSidecar, renderScreenplay, renderSequenceAndSee, renderSequenceVideo, renderVideo, replaceAutoMovieDrawInspection, reportAutoMovieResourceRetirement, resetAutoMovieSceneShadowTargets, resolveAutoMovieCapturePatterns, resolveAutoMovieFilmBeautyComposition, resolveAutoMovieInspectionColors, resolveAutoMovieInspectionView, resolveProductionPngProfile, resolveProductionRenderTierFrameFormat, resolveProductionVideoProfile, restoreAutoMovieRenderModeOnce, restoreAutoMovieRenderModeState, retireAutoMovieCubeShadowDepth, runAutoMovieCapture, runAutoMovieVideoCapture, sampleAutoMovieInspectionTrails, sampleCompiledEffect, sampleFormationCycleMatrix, sampleFormationMotion, sampleFormationSlotMotion, scaleAutoMovieCaptureLabels, selectAutoMovieDrawSubject, selectAutoMovieRenderBudget, selectFormationLod, serializeAutoMovieWebVttCueText, serializeAutoMovieWebVttIdentifier, serializeAutoMovieWebVttSingleLineText, sliceCaptionSidecar, spliceTangentNormal, stampAutoMovieDrawLegend, stampAutoMovieRasterLabel, subsurfaceFragment, subsurfacePhysicalChunk, subsurfaceTable, textureBindingAsset, updateAutoMovieComparisonCamera };
|
|
294
|
+
export { AUTOMOVIE_FORMATION_CYCLE_SAMPLES, AUTOMOVIE_GUIDE_PASSES, AUTOMOVIE_MP4_SRGB_COLOUR, AUTOMOVIE_MP4_UNITY_MATRIX, AUTOMOVIE_PRODUCTION_OPUS_PROFILE, AUTO_MOVIE_CAPTURE_PLAN_KEYS, AUTO_MOVIE_DRAW_GLOBALS, AUTO_MOVIE_INSPECTION_DEPTH_LEAD, AUTO_MOVIE_INSPECTION_KEYS, AUTO_MOVIE_INSPECTION_KINDS, AUTO_MOVIE_INSPECTION_PALETTE, AutoMovieCaptureFolder, AutoMovieDrawSession, AutoMovieFrameGrid, AutoMovieGeometryPhysicalVertices, AutoMoviePlayer, AutoMovieRasterSheet, AutoMovieResourceRetirementScope, AutoMovieSkinnedMesh, AutoMovieTextureCache, DEPTH_NORMALIZATION_RANGE, DETAIL_NORMAL_TARGET, EDGE_SHELL_NAME, EDGE_WIDTH, POSE_OVERLAY_NAME, RELIEF_WEIGHT_TARGET, SPACE_GROUP_NAME, SUBSURFACE_TARGET, addMaterialShaderPatch, applyAutoMovieDeliveryCrop, applyAutoMovieInspection, applyAutoMovieInspectionSection, applyAutoMovieInspectionShade, applyAutoMovieRigLocals, applyAutoMovieSectionPlanes, applyAutoMovieSemanticMask, applyAutoMovieShadowParticipation, applyAutoMovieViewerSubjectPose, applyDetailNormal, applyDualQuaternionSkinning, applyExpression, applyFormationCycleCadence, applyFormationCycleMaterial, applyLightMotion, applyLightState, applyMaterialOverlays, applyMaterialShaderPatches, applyObjectMotion, applyObjectMotions, applyPose, applyPracticalSurfaceMaterials, applyReliefWeights, applyRenderMode, applyRendererEnvironment, applySceneEnvironment, applySceneFog, applySubsurfaceShading, applyTransform, assertAutoMovieCaptureClock, assertAutoMovieSceneShadowProfile, assertAutoMovieViewerCameraDepthPrecision, assertProductionOpusProfile, assertProductionPngPicture, assertProductionVideoProfile, assessAutoMovieRenderBudget, attachAutoMovieSemanticMask, auditAutoMovieDecodedFrames, auditAutoMovieEncodedPresentation, auditAutoMovieRenderObservation, auditAutoMovieSemanticMaskScene, autoMovieAnalysisRampColor, autoMovieCaptionLanguageComparisonKey, autoMovieInspectionPathOf, autoMovieRenderBudgetEvidence, autoMovieRenderBudgetRefusal, autoMovieRenderTargetRendererOfGraphics, autoMovieRenderTargetSettingsOfShot, autoMovieSemanticMaskOf, autoMovieViewerNamedViewpoints, autoMovieViewerPoseFromHeading, autoMovieViewerSubjectKey, autoMovieViewerTurntableViewpoints, bakeFormationCycle, beatCaptions, bindAutoMovieDrawSceneSoftProps, buildAnalysisOverlayObject, buildAutoMovieConstruction, buildAutoMovieInspectionMarks, buildAutoMovieMaterialLibrary, buildFluidSprayObject, buildFluidSurfaceObject, buildGeometry, buildHumanCartoonFace, buildHumanPolygon, buildInstancedEffect, buildInstancedFormation, buildInstancedInstanceSet, buildLight, buildMaterial, buildModel, buildPlantingObject, buildPolygonShotActor, buildPropArticulation, buildScene, buildSceneSoftProps, buildSoftBodyObject, buildSpaceObject, canonicalProductionWebVtt, canonicalizeAutoMovieCaptionText, captureAutoMovieFramebufferRestore, captureAutoMovieMetricFrame, captureAutoMovieViewerSubjectView, captureViewerSnapshot, chooseAutoMovieInspectionMarks, collectAutoMovieOwnedResources, colorAutoMovieInspectionObjects, compareAutoMovieCaptureRounds, compareAutoMovieRasters, constructAutoMovieOwnedResources, createAutoMovieClosedSphereGeometry, createAutoMovieHttpArtifactStore, createAutoMovieHumanPolygonFigure, createAutoMovieInspectionDots, createAutoMovieInspectionStrokes, createAutoMovieMetricOrthographicCamera, createAutoMoviePhysicalPoseAdapter, createAutoMovieResourceRetirement, createAutoMovieSurfaceAppearance, createDetailNormalShaderPatch, createDualQuaternionSkinningShaderPatch, createImportedModelObject, createReliefWeightShaderPatch, decodeAutoMovieDrawPixels, decodeAutoMovieRasterPng, defaultMaterial, describeAutoMovieDrawScene, detailNormalFragment, detailNormalVertex, disposeCrossDissolve, disposeFadeToBlack, dualQuaternionSkinningOf, dualQuaternionSkinningVertex, encodeAutoMovieDrawPixels, encodeAutoMovieRasterPng, encodeAutoMovieWavPcm16, equalOrderedScalars, evaluateAutoMovieViewerCameraDepthPrecision, expandAutoMovieInspectionSweep, ffmpegArgs, flattenInstancedModel, flattenInstancedObject, focusAutoMovieInspection, formatAutoMovieCapturePlanRequest, formatAutoMovieInspectionCameraView, formatAutoMovieInspectionRequest, formatAutoMovieInspectionView, formationCycleCadence, formationCycleGait, formationCycleOf, formationCyclePosition, formationCycleStride, frameAutoMovieViewerSubject, frameName, framePattern, frameTimes, guardAutoMovieRenderModeRetirement, guardAutoMovieSceneShadowRetirement, guidePassFrameName, guidePassFramePattern, hashAutoMovieRasterImage, inspectAutoMovieCaptionReadabilityWithRuntime, installAutoMovieDraw, instancedModelParts, invalidateAutoMovieSceneShadowPrograms, invalidateAutoMovieSkinnedPose, isAutoMovieWebVttIdentifier, isGuidePass, legendAutoMovieInspectionMarks, listAutoMovieInspectionKinds, listAutoMovieInspectionPaths, mapImportedHumanoidBones, markAutoMovieInspectionTrails, maskColor, matchAutoMovieInspectionPath, materialOverlayFragment, materialOverlayVertex, materialTextureBindings, measureAutoMovieInspectionBounds, measureAutoMovieInspectionDefects, measureAutoMovieInspectionEdges, measureAutoMovieInspectionMeshes, measureAutoMovieInspectionPaths, mergeAutoMovieInspectionLegends, mixAutoMovieAudioPcm, normalizeGuidePasses, observeAutoMovieRendererFrame, parseAutoMovieCaptionLanguage, parseAutoMovieCapturePlanRequest, parseAutoMovieInspectionRequest, parseAutoMovieInspectionView, parseAutoMovieViewerSubjectKey, placeAutoMovieInspectionLabels, planAutoMovieCapture, planAutoMovieCaptureFrames, planAutoMovieCaptureLayout, planAutoMovieCaptureUrl, planAutoMovieDrawCall, planAutoMovieInspectionTrailTimes, planAutoMovieVideoEncoding, planAutoMovieVideoFrames, planAutoMovieVideoSceneCuts, planCaptionSidecar, planChunkedSequenceRender, planGuidePassOutputs, planPoseKeypointSidecar, planProductionRenderJob, planSequenceRender, planViewerFrameTimes, productionOpusDescription, productionVisualDeliveryOccurrence, readAutoMovieCaptureArguments, readAutoMovieCubeShadowDepth, readAutoMovieDeliveryCrop, readAutoMovieDisplayDestinationEncoding, readAutoMovieFilmDisplayTextureResidency, readAutoMovieMaterialTextureSources, readAutoMovieRenderTextureTarget, readAutoMovieShadowLightSource, readAutoMovieShadowTextureTargets, readAutoMovieTextureSource, readAutoMovieTransmissionTextureTarget, readAutoMovieVideoSceneCuts, regenerateFormationSlot, regenerateInstanceSlot, releaseViewerRenderer, reliefWeightFragment, reliefWeightVertex, renderAndSee, renderAutoMovieDrawnVideo, renderAutoMovieFilmFrame, renderAutoMovieScenePass, renderCaptionSidecar, renderCrossDissolve, renderCrossDissolveFrames, renderFadeToBlackFrame, renderPathStem, renderPoseKeypointSidecar, renderScreenplay, renderSequenceAndSee, renderSequenceVideo, renderVideo, replaceAutoMovieDrawInspection, reportAutoMovieResourceRetirement, resetAutoMovieSceneShadowTargets, resolveAutoMovieCapturePatterns, resolveAutoMovieFilmBeautyComposition, resolveAutoMovieInspectionColors, resolveAutoMovieInspectionView, resolveProductionPngProfile, resolveProductionRenderTierFrameFormat, resolveProductionVideoProfile, restoreAutoMovieRenderModeOnce, restoreAutoMovieRenderModeState, retireAutoMovieCubeShadowDepth, runAutoMovieCapture, runAutoMovieVideoCapture, sampleAutoMovieInspectionTrails, sampleCompiledEffect, sampleFormationCycleMatrix, sampleFormationMotion, sampleFormationSlotMotion, scaleAutoMovieCaptureLabels, selectAutoMovieDrawSubject, selectAutoMovieRenderBudget, selectFormationLod, serializeAutoMovieWebVttCueText, serializeAutoMovieWebVttIdentifier, serializeAutoMovieWebVttSingleLineText, sliceCaptionSidecar, spliceTangentNormal, stampAutoMovieDrawLegend, stampAutoMovieRasterLabel, subsurfaceFragment, subsurfacePhysicalChunk, subsurfaceTable, textureBindingAsset, updateAutoMovieComparisonCamera };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automovie/render",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "automovie render: deterministic frame schedule + encode plan from a render spec",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@automovie/engine": "^0.3.
|
|
32
|
-
"@automovie/ingest": "^0.3.
|
|
33
|
-
"@automovie/interface": "^0.3.
|
|
31
|
+
"@automovie/engine": "^0.3.2",
|
|
32
|
+
"@automovie/ingest": "^0.3.2",
|
|
33
|
+
"@automovie/interface": "^0.3.2",
|
|
34
34
|
"three": "^0.186.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zero-based, regularly spaced presentation frames followed by the exact end.
|
|
3
|
+
* Takes and preview controls share the grid, including an endpoint that falls
|
|
4
|
+
* between regular frame times.
|
|
5
|
+
*
|
|
6
|
+
* @evidence contracts/development/common.md#meaningful-documentation States the index origin, temporal spacing, endpoint, and consumers.
|
|
7
|
+
* @evidence contracts/development/design.md#principled-representation Frame indices are zero-based integers, timestamps and duration are seconds, and cadence is positive frames per second. JavaScript numbers do not enforce these constraints, so the caller supplies a valid presentation clock and index.
|
|
8
|
+
* @evidence contracts/development/design.md#minimal-and-owned-surface Render owns frame schedules. The take producer reads the last index and frame times, and the preview controls also map a playhead second to a displayed frame index.
|
|
9
|
+
* @evidence contracts/development/design.md#prohibited-design-shortcuts The endpoint rule works for both exact-grid and fractional durations and requires no caller-specific mode.
|
|
10
|
+
*/
|
|
11
|
+
export namespace AutoMovieFrameGrid {
|
|
12
|
+
/**
|
|
13
|
+
* Find the final zero-based frame number for a nonnegative duration in
|
|
14
|
+
* seconds and a positive rate in frames per second. The exact end takes
|
|
15
|
+
* the place of the first regular frame at or past the end.
|
|
16
|
+
*
|
|
17
|
+
* @evidence contracts/development/common.md#meaningful-documentation Defines the units, index origin, and the final frame's relation to the regular cadence.
|
|
18
|
+
* @evidence contracts/development/implementation.md#principled-implementation Compares the candidate's canonical timestamp to the end since the product alone can round across an integer.
|
|
19
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure Computes one candidate, then advances it if its timestamp is still before the end.
|
|
20
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Keeps a fractional end distinct from the regular frame immediately before it without an arbitrary epsilon.
|
|
21
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Constant time and space.
|
|
22
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Computes one candidate and its time.
|
|
23
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Retains no state.
|
|
24
|
+
*/
|
|
25
|
+
export function last(duration: number, fps: number): number {
|
|
26
|
+
const nearest: number = Math.round(duration * fps);
|
|
27
|
+
return nearest / fps < duration ? nearest + 1 : nearest;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Read a zero-based frame's timestamp in seconds at the given rate in
|
|
32
|
+
* frames per second, clamped to the final timestamp, `duration`.
|
|
33
|
+
*
|
|
34
|
+
* @evidence contracts/development/common.md#meaningful-documentation Defines the index origin, input and return units, and the end clamp.
|
|
35
|
+
* @evidence contracts/development/implementation.md#principled-implementation One division yields the canonical timestamp without accumulating rounding error.
|
|
36
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure Divides the index by the rate and clamps the result.
|
|
37
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Returns the exact end when the next regular frame would run past it.
|
|
38
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Constant time and space.
|
|
39
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Computes one timestamp.
|
|
40
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Retains no state.
|
|
41
|
+
*/
|
|
42
|
+
export function time(frame: number, duration: number, fps: number): number {
|
|
43
|
+
return Math.min(frame / fps, duration);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Show the closest regular frame for an in-range second, reserving the
|
|
48
|
+
* final frame for the exact end. The caller supplies the duration in
|
|
49
|
+
* seconds, the rate in frames per second, and the already computed last
|
|
50
|
+
* frame number.
|
|
51
|
+
*
|
|
52
|
+
* @evidence contracts/development/common.md#meaningful-documentation Defines the rounding policy, the exact end, and the units of the supplied clock.
|
|
53
|
+
* @evidence contracts/development/implementation.md#principled-implementation Rounds within the regular grid and reserves the end index for the actual end, so it remains a separate scrubber position.
|
|
54
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure Returns the last index at the end and otherwise rounds and caps the regular index.
|
|
55
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts A playhead just before the end cannot occupy the end index.
|
|
56
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Constant time and space.
|
|
57
|
+
* @evidence contracts/development/implementation.md#reuse-equivalent-work Uses the last frame number already computed for the grid.
|
|
58
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Retains no state.
|
|
59
|
+
*/
|
|
60
|
+
export function nearest(
|
|
61
|
+
seconds: number,
|
|
62
|
+
duration: number,
|
|
63
|
+
fps: number,
|
|
64
|
+
last: number,
|
|
65
|
+
): number {
|
|
66
|
+
return seconds >= duration
|
|
67
|
+
? last
|
|
68
|
+
: Math.min(last - 1, Math.round(seconds * fps));
|
|
69
|
+
}
|
|
70
|
+
}
|
package/src/index.ts
CHANGED