@cardstack/choreo 0.0.0 → 0.1.0-unstable.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/CHANGELOG.md +15 -0
- package/LICENSE +21 -0
- package/README.md +55 -6
- package/addon-main.cjs +4 -0
- package/declarations/anchors.d.ts +26 -0
- package/declarations/anchors.d.ts.map +1 -0
- package/declarations/arming.d.ts +33 -0
- package/declarations/arming.d.ts.map +1 -0
- package/declarations/beacon.d.ts +9 -0
- package/declarations/beacon.d.ts.map +1 -0
- package/declarations/beacons.d.ts +23 -0
- package/declarations/beacons.d.ts.map +1 -0
- package/declarations/changeset.d.ts +46 -0
- package/declarations/changeset.d.ts.map +1 -0
- package/declarations/choreo.d.ts +261 -0
- package/declarations/choreo.d.ts.map +1 -0
- package/declarations/compile.d.ts +45 -0
- package/declarations/compile.d.ts.map +1 -0
- package/declarations/deliver.d.ts +44 -0
- package/declarations/deliver.d.ts.map +1 -0
- package/declarations/easings.d.ts +20 -0
- package/declarations/easings.d.ts.map +1 -0
- package/declarations/far.d.ts +33 -0
- package/declarations/far.d.ts.map +1 -0
- package/declarations/film/clip.d.ts +51 -0
- package/declarations/film/clip.d.ts.map +1 -0
- package/declarations/film/clips.d.ts +155 -0
- package/declarations/film/clips.d.ts.map +1 -0
- package/declarations/film/film.d.ts +1208 -0
- package/declarations/film/film.d.ts.map +1 -0
- package/declarations/film/graph/adjust.d.ts +112 -0
- package/declarations/film/graph/adjust.d.ts.map +1 -0
- package/declarations/film/graph/compile.d.ts +140 -0
- package/declarations/film/graph/compile.d.ts.map +1 -0
- package/declarations/film/graph/host.d.ts +67 -0
- package/declarations/film/graph/host.d.ts.map +1 -0
- package/declarations/film/graph/nodes.d.ts +287 -0
- package/declarations/film/graph/nodes.d.ts.map +1 -0
- package/declarations/film/index.d.ts +24 -0
- package/declarations/film/index.d.ts.map +1 -0
- package/declarations/film/joins.d.ts +143 -0
- package/declarations/film/joins.d.ts.map +1 -0
- package/declarations/film/math.d.ts +15 -0
- package/declarations/film/math.d.ts.map +1 -0
- package/declarations/film/overlays.d.ts +54 -0
- package/declarations/film/overlays.d.ts.map +1 -0
- package/declarations/film/picture.d.ts +104 -0
- package/declarations/film/picture.d.ts.map +1 -0
- package/declarations/film/plate.d.ts +37 -0
- package/declarations/film/plate.d.ts.map +1 -0
- package/declarations/film/player.d.ts +120 -0
- package/declarations/film/player.d.ts.map +1 -0
- package/declarations/film/rail.d.ts +40 -0
- package/declarations/film/rail.d.ts.map +1 -0
- package/declarations/film/schedule.d.ts +93 -0
- package/declarations/film/schedule.d.ts.map +1 -0
- package/declarations/film/seam.d.ts +38 -0
- package/declarations/film/seam.d.ts.map +1 -0
- package/declarations/film/titles.d.ts +37 -0
- package/declarations/film/titles.d.ts.map +1 -0
- package/declarations/film/types.d.ts +544 -0
- package/declarations/film/types.d.ts.map +1 -0
- package/declarations/film.d.ts +3 -0
- package/declarations/film.d.ts.map +1 -0
- package/declarations/gesture.d.ts +33 -0
- package/declarations/gesture.d.ts.map +1 -0
- package/declarations/index.d.ts +26 -0
- package/declarations/index.d.ts.map +1 -0
- package/declarations/measure.d.ts +29 -0
- package/declarations/measure.d.ts.map +1 -0
- package/declarations/path.d.ts +73 -0
- package/declarations/path.d.ts.map +1 -0
- package/declarations/registry.d.ts +46 -0
- package/declarations/registry.d.ts.map +1 -0
- package/declarations/run.d.ts +406 -0
- package/declarations/run.d.ts.map +1 -0
- package/declarations/space.d.ts +31 -0
- package/declarations/space.d.ts.map +1 -0
- package/declarations/steps.d.ts +479 -0
- package/declarations/steps.d.ts.map +1 -0
- package/declarations/test-support/index.d.ts +30 -0
- package/declarations/test-support/index.d.ts.map +1 -0
- package/declarations/types.d.ts +761 -0
- package/declarations/types.d.ts.map +1 -0
- package/dist/anchors.js +34 -0
- package/dist/anchors.js.map +1 -0
- package/dist/arming.js +120 -0
- package/dist/arming.js.map +1 -0
- package/dist/beacon.js +25 -0
- package/dist/beacon.js.map +1 -0
- package/dist/beacons.js +77 -0
- package/dist/beacons.js.map +1 -0
- package/dist/changeset.js +129 -0
- package/dist/changeset.js.map +1 -0
- package/dist/choreo.js +1026 -0
- package/dist/choreo.js.map +1 -0
- package/dist/compile.js +1403 -0
- package/dist/compile.js.map +1 -0
- package/dist/deliver.js +326 -0
- package/dist/deliver.js.map +1 -0
- package/dist/easings.js +39 -0
- package/dist/easings.js.map +1 -0
- package/dist/far.js +147 -0
- package/dist/far.js.map +1 -0
- package/dist/film/clip.js +100 -0
- package/dist/film/clip.js.map +1 -0
- package/dist/film/clips.js +147 -0
- package/dist/film/clips.js.map +1 -0
- package/dist/film/film.js +4424 -0
- package/dist/film/film.js.map +1 -0
- package/dist/film/graph/adjust.js +160 -0
- package/dist/film/graph/adjust.js.map +1 -0
- package/dist/film/graph/compile.js +225 -0
- package/dist/film/graph/compile.js.map +1 -0
- package/dist/film/graph/host.js +77 -0
- package/dist/film/graph/host.js.map +1 -0
- package/dist/film/graph/nodes.js +500 -0
- package/dist/film/graph/nodes.js.map +1 -0
- package/dist/film/index.js +18 -0
- package/dist/film/index.js.map +1 -0
- package/dist/film/joins.js +260 -0
- package/dist/film/joins.js.map +1 -0
- package/dist/film/math.js +49 -0
- package/dist/film/math.js.map +1 -0
- package/dist/film/overlays.js +66 -0
- package/dist/film/overlays.js.map +1 -0
- package/dist/film/picture.js +58 -0
- package/dist/film/picture.js.map +1 -0
- package/dist/film/plate.js +36 -0
- package/dist/film/plate.js.map +1 -0
- package/dist/film/player.js +79 -0
- package/dist/film/player.js.map +1 -0
- package/dist/film/rail.js +38 -0
- package/dist/film/rail.js.map +1 -0
- package/dist/film/schedule.js +238 -0
- package/dist/film/schedule.js.map +1 -0
- package/dist/film/seam.js +64 -0
- package/dist/film/seam.js.map +1 -0
- package/dist/film/titles.js +45 -0
- package/dist/film/titles.js.map +1 -0
- package/dist/film/types.js +2 -0
- package/dist/film/types.js.map +1 -0
- package/dist/film.js +18 -0
- package/dist/film.js.map +1 -0
- package/dist/gesture.js +111 -0
- package/dist/gesture.js.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/measure.js +99 -0
- package/dist/measure.js.map +1 -0
- package/dist/path.js +272 -0
- package/dist/path.js.map +1 -0
- package/dist/registry.js +55 -0
- package/dist/registry.js.map +1 -0
- package/dist/run.js +2423 -0
- package/dist/run.js.map +1 -0
- package/dist/space.js +57 -0
- package/dist/space.js.map +1 -0
- package/dist/steps.js +831 -0
- package/dist/steps.js.map +1 -0
- package/dist/test-support/index.js +150 -0
- package/dist/test-support/index.js.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +202 -6
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The cosine easings, recovered from boxel-motion (`easings/cosine.ts` at
|
|
3
|
+
* `cardstack/boxel@394503e3b7^`) — the ones its own flagship transition used.
|
|
4
|
+
*
|
|
5
|
+
* `easeInAndOut` is the interesting one: a raised cosine has zero slope at both
|
|
6
|
+
* ends, so an animation interrupted at t=0 inherits none of its own curve and
|
|
7
|
+
* all of whatever it is replacing. That is the property Ember Animated leans on
|
|
8
|
+
* to make a summed corrective curve continuous; here the same shape is simply
|
|
9
|
+
* available as an `@ease`.
|
|
10
|
+
*
|
|
11
|
+
* <c.Tween @of={{c.kept 'card'}} @opacity={{1}} @ms={{300}} @ease={{easeIn}} />
|
|
12
|
+
*
|
|
13
|
+
* `@ease` also takes an engine easing name or a cubic-bezier as four numbers;
|
|
14
|
+
* these exist because a bezier cannot express a raised cosine exactly.
|
|
15
|
+
*/
|
|
16
|
+
/** a raised cosine: zero slope at both ends */
|
|
17
|
+
export declare function easeInAndOut(t: number): number;
|
|
18
|
+
export declare function easeIn(t: number): number;
|
|
19
|
+
export declare function easeOut(t: number): number;
|
|
20
|
+
//# sourceMappingURL=easings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easings.d.ts","sourceRoot":"","sources":["../src/easings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,+CAA+C;AAC/C,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE9C;AAYD,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAExC;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEzC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ChoreoNode, Sprite } from './types.ts';
|
|
2
|
+
/** one region's measured pass, waiting for the others before it runs */
|
|
3
|
+
export interface Pass {
|
|
4
|
+
claimed: ChoreoNode[];
|
|
5
|
+
host: PassHost;
|
|
6
|
+
inserted: Sprite[];
|
|
7
|
+
kept: Sprite[];
|
|
8
|
+
removed: Sprite[];
|
|
9
|
+
root: HTMLElement;
|
|
10
|
+
}
|
|
11
|
+
export interface PassHost {
|
|
12
|
+
/** phase 3: compile and play, now that identities have been reconciled */
|
|
13
|
+
finishPass(pass: Pass): void;
|
|
14
|
+
/** phase 1: snapshot vs. now, into a changeset — no animation started yet */
|
|
15
|
+
measurePass(): Pass | undefined;
|
|
16
|
+
}
|
|
17
|
+
export declare function setPassScheduler(fn: (run: () => void) => void): void;
|
|
18
|
+
/**
|
|
19
|
+
* Announce that this region has a pass coming. Called while Glimmer is still
|
|
20
|
+
* rendering, so by the time the barrier runs, every region taking part in this
|
|
21
|
+
* pass is known — which is what lets the match be synchronous.
|
|
22
|
+
*/
|
|
23
|
+
export declare function join(host: PassHost): void;
|
|
24
|
+
export declare function leave(host: PassHost): void;
|
|
25
|
+
/**
|
|
26
|
+
* Drop a barrier that will never run. A test torn down between `join` and the
|
|
27
|
+
* post-render callback leaves a destroyed region parked in `intents`, and the
|
|
28
|
+
* next test's first pass would try to measure it. `setupChoreo(hooks)` runs
|
|
29
|
+
* this before and after every test.
|
|
30
|
+
*/
|
|
31
|
+
export declare function resetBarrier(): void;
|
|
32
|
+
export declare function setBeforeMeasure(fn: () => void): void;
|
|
33
|
+
//# sourceMappingURL=far.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"far.d.ts","sourceRoot":"","sources":["../src/far.ts"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAErD,wEAAwE;AACxE,MAAM,WAAW,IAAI;IACnB,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,MAAM,WAAW,QAAQ;IACvB,0EAA0E;IAC1E,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAC7B,6EAA6E;IAC7E,WAAW,IAAI,IAAI,GAAG,SAAS,CAAC;CACjC;AAOD,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,MAAM,IAAI,KAAK,IAAI,QAE7D;AAED;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,QAAQ,QAMlC;AAED,wBAAgB,KAAK,CAAC,IAAI,EAAE,QAAQ,QAEnC;AAKD;;;;;GAKG;AACH,wBAAgB,YAAY,SAG3B;AAID,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,IAAI,QAE9C"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import type { ClipSpec, ClipState } from './clips.ts';
|
|
3
|
+
import type { ElementModifier } from './types.ts';
|
|
4
|
+
export interface ClipSignature {
|
|
5
|
+
Args: {
|
|
6
|
+
/** the picture, read back, when the clip is a freeze */
|
|
7
|
+
freeze?: string;
|
|
8
|
+
/** a new element per clip window, so the entrance replays */
|
|
9
|
+
key: string;
|
|
10
|
+
/** which lane this clip is on: the film's own handle is per lane */
|
|
11
|
+
lane: number;
|
|
12
|
+
/** the film's handle on the media element, for the per-frame sync */
|
|
13
|
+
mount: ElementModifier<HTMLElement, [number]>;
|
|
14
|
+
spec: ClipSpec;
|
|
15
|
+
/** the resolved source, under `assets` */
|
|
16
|
+
src: string;
|
|
17
|
+
state: ClipState;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A CLIP ON THE PICTURE. A video, a still or a freeze of the picture
|
|
22
|
+
* itself, standing over the frame for its window — full frame, or as an
|
|
23
|
+
* inset with its caption like the photograph. The media is not played by
|
|
24
|
+
* the browser's own clock: the film writes its source time every frame
|
|
25
|
+
* (a paused element seeked, a playing one corrected), so a clip is where
|
|
26
|
+
* the clock says it is whether the film played there or was scrubbed
|
|
27
|
+
* there. It arrives the way the insert does — wiped in — and leaves in a
|
|
28
|
+
* short fade.
|
|
29
|
+
*/
|
|
30
|
+
export declare class Clip extends Component<ClipSignature> {
|
|
31
|
+
/** a pip is placed by the score, in percent of the frame */
|
|
32
|
+
get place(): string;
|
|
33
|
+
/** a pip fades; the editorial card is wiped in and out */
|
|
34
|
+
get isPip(): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* THE LOOK THIS CLIP IS WEARING, as a CSS filter — composed in the same
|
|
37
|
+
* order the picture's own shader composes its grade (saturate, then
|
|
38
|
+
* contrast, then brightness, then sepia and hue), because filter order
|
|
39
|
+
* is not commutative and the two should agree about what a number
|
|
40
|
+
* means. Blur goes last, where a lens would put it.
|
|
41
|
+
*
|
|
42
|
+
* It rides the MEDIA, not the figure, so an inset's caption and its card
|
|
43
|
+
* are not graded with the footage.
|
|
44
|
+
*/
|
|
45
|
+
get look(): string;
|
|
46
|
+
/** seconds a pip takes to arrive and to go */
|
|
47
|
+
get fade(): number;
|
|
48
|
+
get muted(): boolean;
|
|
49
|
+
get volume(): number;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=clip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clip.d.ts","sourceRoot":"","sources":["../../src/film/clip.gts"],"names":[],"mappings":"AA+LA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAI3C,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE;QACJ,wDAAwD;QACxD,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,6DAA6D;QAC7D,GAAG,EAAE,MAAM,CAAC;QACZ,oEAAoE;QACpE,IAAI,EAAE,MAAM,CAAC;QACb,qEAAqE;QACrE,KAAK,EAAE,eAAe,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QAC9C,IAAI,EAAE,QAAQ,CAAC;QACf,0CAA0C;QAC1C,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,SAAS,CAAC;KAClB,CAAC;CACH;AAED;;;;;;;;;GASG;AACH,qBAAa,IAAK,SAAQ,SAAS,CAAC,aAAa,CAAC;IAChD,4DAA4D;IAC5D,IAAI,KAAK,IAAI,MAAM,CAYlB;IAED,0DAA0D;IAC1D,IAAI,KAAK,IAAI,OAAO,CAEnB;IAED;;;;;;;;;OASG;IACH,IAAI,IAAI,IAAI,MAAM,CAgCjB;IAED,8CAA8C;IAC9C,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,KAAK,IAAI,OAAO,CAEnB;IAED,IAAI,MAAM,IAAI,MAAM,CAEnB;CA6IF"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLIPS — a source-time window over the film's clock.
|
|
3
|
+
*
|
|
4
|
+
* A beat is a shot of the picture. A clip is something else laid over it
|
|
5
|
+
* for a while: a video, a still, or a freeze of the picture itself. Its
|
|
6
|
+
* arithmetic is the compositor's (notes/choreo-composition.md, Phase C3),
|
|
7
|
+
* lifted whole because it was already right:
|
|
8
|
+
*
|
|
9
|
+
* source = in + (film − start) × rate
|
|
10
|
+
* window = for, or (out − in) / rate, or the rest of the beat
|
|
11
|
+
*
|
|
12
|
+
* Before `start` the clip is absent; inside its window it is active and
|
|
13
|
+
* its source time is the number above; past it the end policy applies —
|
|
14
|
+
* `remove` (the default) takes it off, `hold` keeps the last sample on
|
|
15
|
+
* screen, `freeze` keeps it on screen and writes nothing further. Every
|
|
16
|
+
* state is re-derived from the film time on every frame, never discovered
|
|
17
|
+
* by playing from zero — which is what lets an exact film scrub into the
|
|
18
|
+
* middle of a clip and find it where it should be.
|
|
19
|
+
*
|
|
20
|
+
* A clip may outlive its beat: the window is measured on the film's
|
|
21
|
+
* clock, so a still that starts late in one shot can cross the seam into
|
|
22
|
+
* the next. That is the clip overlap an editor means.
|
|
23
|
+
*/
|
|
24
|
+
import type { Beat } from './types.ts';
|
|
25
|
+
export type ClipKind = 'freeze' | 'image' | 'video';
|
|
26
|
+
export type ClipEnd = 'freeze' | 'hold' | 'remove';
|
|
27
|
+
export interface ClipSpec {
|
|
28
|
+
/** seconds into the beat at which the clip appears (default 0) */
|
|
29
|
+
at?: number;
|
|
30
|
+
/** a line under an inset, and who to credit */
|
|
31
|
+
caption?: string;
|
|
32
|
+
credit?: string;
|
|
33
|
+
/** past its window: taken off (default), held on its last sample, or frozen */
|
|
34
|
+
end?: ClipEnd;
|
|
35
|
+
/** a pip's own fade, seconds in and out (default 0.4) */
|
|
36
|
+
fade?: number;
|
|
37
|
+
/**
|
|
38
|
+
* `cover` is the full frame over the picture; `inset` is the editorial
|
|
39
|
+
* photograph, a paper card in the corner the type is not using; `pip`
|
|
40
|
+
* is a LAYER — placed, sized and faded by the score, with nothing
|
|
41
|
+
* around it. A pip is what a picture-in-picture actually is, and the
|
|
42
|
+
* card is what an inset actually is; they were one thing and should
|
|
43
|
+
* not have been.
|
|
44
|
+
*/
|
|
45
|
+
fit?: 'cover' | 'inset' | 'pip';
|
|
46
|
+
/** seconds it stays; default: to the end of the beat, or the source's own length */
|
|
47
|
+
for?: number;
|
|
48
|
+
/** the source's in point, seconds (video) */
|
|
49
|
+
in?: number;
|
|
50
|
+
kind: ClipKind;
|
|
51
|
+
/**
|
|
52
|
+
* WHICH LANE THIS CLIP IS ON, and it is the whole reason a beat can
|
|
53
|
+
* carry more than one.
|
|
54
|
+
*
|
|
55
|
+
* Within a lane the rule is what it always was: the newest clip wins,
|
|
56
|
+
* an older one is never reached past it, and an end policy decides
|
|
57
|
+
* whether the lane empties or holds. Across lanes clips coexist, which
|
|
58
|
+
* is what a picture-in-picture over a full-frame video needs and what a
|
|
59
|
+
* single slot could not do — a second clip on a beat used to overwrite
|
|
60
|
+
* the first silently.
|
|
61
|
+
*
|
|
62
|
+
* Defaults to the clip's own position among its beat's clips, so two
|
|
63
|
+
* insets on one shot are two lanes without anybody saying so; name it
|
|
64
|
+
* when a later beat should REPLACE an earlier clip rather than sit
|
|
65
|
+
* beside it.
|
|
66
|
+
*/
|
|
67
|
+
lane?: number;
|
|
68
|
+
/** a look held on this clip alone (`f.clip.Look`) */
|
|
69
|
+
look?: ClipLook;
|
|
70
|
+
/** the source's out point, seconds (video); with `in`, sets the window */
|
|
71
|
+
out?: number;
|
|
72
|
+
/** a pip's corner radius, in percent of its width */
|
|
73
|
+
radius?: number;
|
|
74
|
+
/** source seconds per film second (video) */
|
|
75
|
+
rate?: number;
|
|
76
|
+
/** under `assets`; a freeze needs none */
|
|
77
|
+
src?: string;
|
|
78
|
+
/** the clip's own sound, 0..1; 0 (the default) keeps the film's voice in charge */
|
|
79
|
+
volume?: number;
|
|
80
|
+
/** a pip's width, percent of the frame (default 30) */
|
|
81
|
+
w?: number;
|
|
82
|
+
/** a pip's left edge, percent of the frame (default 66) */
|
|
83
|
+
x?: number;
|
|
84
|
+
/** a pip's top edge, percent of the frame (default 10) */
|
|
85
|
+
y?: number;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* A LOOK HELD ON A CLIP — the first adjustment that belongs to something
|
|
89
|
+
* other than the picture.
|
|
90
|
+
*
|
|
91
|
+
* `f.picture.Look` reaches the WebGL page's own grade; a clip is a DOM
|
|
92
|
+
* element and has never had one, so a video inset over a graded picture
|
|
93
|
+
* was ungraded and there was no way to say otherwise. These are the
|
|
94
|
+
* operations a browser can do to an element without a texture, composed
|
|
95
|
+
* in the order the film's own shader composes them (saturate, contrast,
|
|
96
|
+
* brightness, then sepia and hue) — because filter order is not
|
|
97
|
+
* commutative and the two should agree.
|
|
98
|
+
*
|
|
99
|
+
* What this is NOT is the whole filter stack: curves, secondaries and a
|
|
100
|
+
* LUT need the pixels, which needs the clip through a texture. This is
|
|
101
|
+
* the half a browser gives for free.
|
|
102
|
+
*/
|
|
103
|
+
export interface ClipLook {
|
|
104
|
+
/** gaussian blur, pixels */
|
|
105
|
+
blur?: number;
|
|
106
|
+
/** exposure, 1 is unchanged */
|
|
107
|
+
bri?: number;
|
|
108
|
+
/** contrast, 1 is unchanged */
|
|
109
|
+
con?: number;
|
|
110
|
+
/** to grey, 0..1 */
|
|
111
|
+
gray?: number;
|
|
112
|
+
/** hue rotation, degrees */
|
|
113
|
+
hue?: number;
|
|
114
|
+
/** the whole layer's opacity, 0..1 */
|
|
115
|
+
opacity?: number;
|
|
116
|
+
/** saturation, 1 is unchanged, 0 is monochrome */
|
|
117
|
+
sat?: number;
|
|
118
|
+
/** to sepia, 0..1 */
|
|
119
|
+
sepia?: number;
|
|
120
|
+
}
|
|
121
|
+
export type ClipState = 'absent' | 'active' | 'frozen' | 'held';
|
|
122
|
+
export interface ResolvedClip {
|
|
123
|
+
/** which beat's clip this is */
|
|
124
|
+
index: number;
|
|
125
|
+
/** film seconds since the clip's window opened */
|
|
126
|
+
since: number;
|
|
127
|
+
/** the source time to show, seconds; null when frozen */
|
|
128
|
+
source: null | number;
|
|
129
|
+
spec: ClipSpec;
|
|
130
|
+
state: ClipState;
|
|
131
|
+
}
|
|
132
|
+
/** how long a clip's window is, in film seconds */
|
|
133
|
+
export declare function clipWindow(spec: ClipSpec, beatStart: number, nextStart: number): number;
|
|
134
|
+
/**
|
|
135
|
+
* The clip on screen at a film time, if any: the most recent beat at or
|
|
136
|
+
* before `index` whose clip's window holds the time, or whose end policy
|
|
137
|
+
* keeps it on screen past its window. Older clips are never reached past
|
|
138
|
+
* a newer one — a clip that was removed is gone, and one that is held is
|
|
139
|
+
* the one on screen.
|
|
140
|
+
*/
|
|
141
|
+
export declare function resolveClip(beats: readonly Beat[], beatStart: (i: number) => number, film: number, index: number, total: number, lane?: number): ResolvedClip | null;
|
|
142
|
+
/** every lane any beat up to `index` puts a clip on, in order */
|
|
143
|
+
export declare function clipLanes(beats: readonly Beat[], index: number): number[];
|
|
144
|
+
/**
|
|
145
|
+
* EVERY CLIP ON SCREEN AT A FILM TIME, one per lane, in lane order — which
|
|
146
|
+
* is also paint order, so a score decides what sits over what by which
|
|
147
|
+
* lane it puts a thing on.
|
|
148
|
+
*
|
|
149
|
+
* A beat used to carry one clip and a second on the same shot overwrote
|
|
150
|
+
* the first without saying so. Lanes are the smallest thing that fixes
|
|
151
|
+
* that without inventing a track model: the resolver below is the old
|
|
152
|
+
* one, run once per lane.
|
|
153
|
+
*/
|
|
154
|
+
export declare function resolveClips(beats: readonly Beat[], beatStart: (i: number) => number, film: number, index: number, total: number): ResolvedClip[];
|
|
155
|
+
//# sourceMappingURL=clips.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clips.d.ts","sourceRoot":"","sources":["../../src/film/clips.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;AAEpD,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ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