etro 0.8.3 → 0.9.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/.github/workflows/nodejs.yml +6 -3
- package/CHANGELOG.md +37 -0
- package/CODE_OF_CONDUCT.md +1 -1
- package/CONTRIBUTING.md +10 -10
- package/README.md +32 -52
- package/dist/effect/base.d.ts +6 -6
- package/dist/effect/elliptical-mask.d.ts +4 -4
- package/dist/effect/index.d.ts +1 -0
- package/dist/effect/shader.d.ts +4 -4
- package/dist/effect/stack.d.ts +7 -7
- package/dist/effect/transform.d.ts +4 -4
- package/dist/effect/visual.d.ts +17 -0
- package/dist/etro-cjs.js +74 -6450
- package/dist/etro-iife.js +74 -6450
- package/dist/layer/audio-source.d.ts +1 -2
- package/dist/layer/image.d.ts +2 -2
- package/dist/layer/visual.d.ts +3 -3
- package/dist/movie.d.ts +14 -5
- package/dist/util.d.ts +2 -0
- package/karma.conf.js +28 -2
- package/package.json +7 -10
- package/scripts/gen-effect-samples.html +27 -18
- package/scripts/save-effect-samples.js +6 -1
- package/src/effect/base.ts +7 -7
- package/src/effect/elliptical-mask.ts +4 -4
- package/src/effect/index.ts +1 -0
- package/src/effect/shader.ts +4 -4
- package/src/effect/stack.ts +10 -10
- package/src/effect/transform.ts +4 -4
- package/src/effect/visual.ts +21 -0
- package/src/layer/audio-source.ts +8 -6
- package/src/layer/base.ts +1 -1
- package/src/layer/image.ts +3 -3
- package/src/layer/visual.ts +4 -4
- package/src/movie.ts +58 -31
- package/src/util.ts +2 -0
- package/.env +0 -2
- package/rename-file.sh +0 -18
- package/rename-versions.sh +0 -14
- package/rename.sh +0 -22
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
name: Node CI
|
|
2
2
|
|
|
3
|
-
on:
|
|
3
|
+
on:
|
|
4
|
+
- push
|
|
5
|
+
- pull_request
|
|
4
6
|
|
|
5
7
|
jobs:
|
|
6
8
|
build:
|
|
@@ -8,7 +10,7 @@ jobs:
|
|
|
8
10
|
|
|
9
11
|
strategy:
|
|
10
12
|
matrix:
|
|
11
|
-
node-version: [
|
|
13
|
+
node-version: [15.x, 16.x, 17.x]
|
|
12
14
|
|
|
13
15
|
steps:
|
|
14
16
|
- uses: actions/checkout@v1
|
|
@@ -22,8 +24,9 @@ jobs:
|
|
|
22
24
|
- name: npm install, lint, build, and test
|
|
23
25
|
run: |
|
|
24
26
|
npm ci
|
|
27
|
+
node node_modules/puppeteer/install.js
|
|
25
28
|
npm run lint
|
|
26
29
|
npm run build
|
|
27
|
-
npm test
|
|
30
|
+
xvfb-run --auto-servernum npm test
|
|
28
31
|
env:
|
|
29
32
|
CI: true
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,40 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
|
6
6
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
7
7
|
|
|
8
|
+
## [0.9.0] - 2022-07-17
|
|
9
|
+
### Changed
|
|
10
|
+
- Methods in the `Base` effect now accept `Base` layers instead of `Visual` layers.
|
|
11
|
+
|
|
12
|
+
### Deprecated
|
|
13
|
+
- `autoRefresh` option ([#130](https://github.com/etro-js/etro/issues/130)).
|
|
14
|
+
- `publicExcludes` ([#130](https://github.com/etro-js/etro/issues/130)).
|
|
15
|
+
- All `change` events ([#130](https://github.com/etro-js/etro/issues/130)).
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
- Layers no longer trigger infinite loops when their active states change ([#127](https://github.com/etro-js/etro/issues/127)).
|
|
19
|
+
- Add missing `VisualSource` options to `Image` layer ([#128](https://github.com/etro-js/etro/pull/128)).
|
|
20
|
+
- Layers are now stopped when recording ends.
|
|
21
|
+
- `stop()` is no longer called on inactive layers.
|
|
22
|
+
- Movies no longer publish `'movie.ended'` when done recording.
|
|
23
|
+
- `Audio` and `Video` layers not detaching properly.
|
|
24
|
+
- When done playing or recording, movies only reset their time if they're in repeat mode.
|
|
25
|
+
- The `timeupdate` event is no longer fired when `currentTime` remains the same (due to `performance.now()` rounding).
|
|
26
|
+
|
|
27
|
+
## [0.8.5] - 2022-03-06
|
|
28
|
+
### Deprecated
|
|
29
|
+
- `vd.effect.Base` - All visual effects now inherit from `vd.effect.Visual` instead.
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
- Movie constructor throwing `Can't find variable: AudioContext` on WebKit browsers.
|
|
33
|
+
|
|
34
|
+
## [0.8.4] - 2022-02-23
|
|
35
|
+
### Fixed
|
|
36
|
+
- **Major memory leak.**
|
|
37
|
+
- `Movie#play()` not resolving.
|
|
38
|
+
- `Movie#paused` set to false after done playing or recording.
|
|
39
|
+
- Movies' `currentTime` being off by a fraction of a second a few frames after playing.
|
|
40
|
+
- Movies' `currentTime` setter not respecting `autoRefresh`.
|
|
41
|
+
|
|
8
42
|
## [0.8.3] - 2022-01-18
|
|
9
43
|
### Fixed
|
|
10
44
|
- Recording not respecting the `type` option.
|
|
@@ -193,6 +227,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
|
193
227
|
- Gaussian blur
|
|
194
228
|
- Transform
|
|
195
229
|
|
|
230
|
+
[0.9.0]: https://github.com/etro-js/etro/compare/v0.8.5...v0.9.0
|
|
231
|
+
[0.8.5]: https://github.com/etro-js/etro/compare/v0.8.4...v0.8.5
|
|
232
|
+
[0.8.4]: https://github.com/etro-js/etro/compare/v0.8.3...v0.8.4
|
|
196
233
|
[0.8.3]: https://github.com/etro-js/etro/compare/v0.8.2...v0.8.3
|
|
197
234
|
[0.8.2]: https://github.com/etro-js/etro/compare/v0.8.1...v0.8.2
|
|
198
235
|
[0.8.1]: https://github.com/etro-js/etro/compare/v0.8.0...v0.8.1
|
package/CODE_OF_CONDUCT.md
CHANGED
|
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
|
|
|
55
55
|
## Enforcement
|
|
56
56
|
|
|
57
57
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
58
|
-
reported by contacting
|
|
58
|
+
reported by contacting us at etroframework\@gmail.com. All complaints will be
|
|
59
59
|
reviewed and investigated and will result in a response that is deemed necessary
|
|
60
60
|
and appropriate to the circumstances. The project team is obligated to maintain
|
|
61
61
|
confidentiality with regard to the reporter of an incident. Further details of
|
package/CONTRIBUTING.md
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
Thank you for considering contributing to Etro! There are many ways you can contribute to Etro, like creating issues for features or bugs, improving the docs or wiki, or writing the actual code for the library. This page covers how to make changes to the repository files (either code or docs).
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
[Join our Discord](https://discord.gg/myrBsQ8Cht)
|
|
8
8
|
|
|
9
9
|
## Setting up your local environment
|
|
10
10
|
|
|
11
11
|
#### Step 0: Dependencies
|
|
12
12
|
|
|
13
|
-
- You will need Git, Node, NPM (at least 7.x) and
|
|
13
|
+
- You will need Git, Node, NPM (at least 7.x) and Firefox (for headless unit testing) installed
|
|
14
14
|
|
|
15
15
|
#### Step 1: Fork
|
|
16
16
|
|
|
@@ -20,15 +20,16 @@ Thank you for considering contributing to Etro! There are many ways you can cont
|
|
|
20
20
|
git clone -b master --single-branch https://github.com/username/etro.git
|
|
21
21
|
cd etro
|
|
22
22
|
npm install
|
|
23
|
+
node node_modules/puppeteer/install.js
|
|
23
24
|
```
|
|
24
25
|
|
|
25
26
|
## Making your changes
|
|
26
27
|
|
|
27
28
|
#### Step 2: Code
|
|
28
29
|
|
|
29
|
-
- Make some changes
|
|
30
|
-
- If you are writing code, the linter uses [StandardJS](https://standardjs.com/rules.html) for style conventions
|
|
31
|
-
- When you're ready to submit
|
|
30
|
+
- Make some changes
|
|
31
|
+
- If you are writing code, the linter uses [StandardJS](https://standardjs.com/rules.html) for style conventions
|
|
32
|
+
- When you're ready to submit, first run
|
|
32
33
|
|
|
33
34
|
```
|
|
34
35
|
npm run lint
|
|
@@ -56,19 +57,18 @@ Thank you for considering contributing to Etro! There are many ways you can cont
|
|
|
56
57
|
|
|
57
58
|
#### Step 3: Push
|
|
58
59
|
|
|
59
|
-
- First, rebase (
|
|
60
|
+
- First, rebase (please avoid merging) to integrate your work with any new changes in the main repository
|
|
60
61
|
|
|
61
62
|
```
|
|
62
63
|
git fetch upstream
|
|
63
64
|
git rebase upstream/master
|
|
64
65
|
```
|
|
65
66
|
|
|
66
|
-
- Push to
|
|
67
|
+
- Push to the fork
|
|
67
68
|
|
|
68
69
|
#### Step 4: Pull request
|
|
69
70
|
|
|
70
|
-
- Open a pull request from
|
|
71
|
-
- In the PR title, include **fixes ###** for bugs and **resolves ###** for feature requests
|
|
71
|
+
- Open a pull request from the branch in your fork to the main repository
|
|
72
72
|
- If you changed any core functionality, make sure you explain your motives for those changes
|
|
73
73
|
|
|
74
74
|
#### Step 5: Feedback
|
|
@@ -79,7 +79,7 @@ Thank you for considering contributing to Etro! There are many ways you can cont
|
|
|
79
79
|
|
|
80
80
|
### Etro Overview
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
Check out [the overview guide](https://etrojs.dev/docs/overview) for usage information
|
|
83
83
|
|
|
84
84
|
### API Structure
|
|
85
85
|
|
package/README.md
CHANGED
|
@@ -3,25 +3,25 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/etro)
|
|
4
4
|
[](https://actions-badge.atrox.dev/etro-js/etro/goto)
|
|
5
5
|
|
|
6
|
-
>
|
|
7
|
-
>
|
|
8
|
-
> for migrating.
|
|
6
|
+
> Etro was previously known as Etro, but it had to be renamed to avoid
|
|
7
|
+
> confusion with an existing software product.
|
|
9
8
|
|
|
10
|
-
Etro is a typescript framework for programmatically editing videos. Similar
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
and
|
|
15
|
-
|
|
9
|
+
Etro is a typescript framework for programmatically editing videos. Similar to
|
|
10
|
+
GUI-based video-editing software, it lets you composite layers and add effects.
|
|
11
|
+
Etro comes shipped with text, video, audio and image layers, along with a bunch
|
|
12
|
+
of GLSL effects. You can also define your own layers and effects with javascript
|
|
13
|
+
and GLSL.
|
|
14
|
+
|
|
15
|
+
[Join our Discord](https://discord.gg/myrBsQ8Cht)
|
|
16
16
|
|
|
17
17
|
## Features
|
|
18
18
|
|
|
19
19
|
- Composite video and audio layers
|
|
20
20
|
- Use built-in hardware accelerated effects
|
|
21
21
|
- Write your own effects in JavaScript and GLSL
|
|
22
|
-
- Manipulate audio with the web audio API
|
|
23
|
-
- Define layer and effect
|
|
24
|
-
-
|
|
22
|
+
- Manipulate audio with the web audio API *(audio effects coming soon)*
|
|
23
|
+
- Define layer and effect parameters as keyframes or custom functions
|
|
24
|
+
- Render to a blob in realtime *(offline rendering coming soon)*
|
|
25
25
|
|
|
26
26
|
## Installation
|
|
27
27
|
|
|
@@ -29,29 +29,24 @@ own.
|
|
|
29
29
|
npm i etro
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
## Usage
|
|
32
|
+
## Basic Usage
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Let's look at an example:
|
|
35
35
|
```js
|
|
36
36
|
import etro from 'etro'
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
Or include it as a global etro:
|
|
40
|
-
```js
|
|
41
|
-
<script src="node_modules/etro/dist/etro-iife.js"></script>
|
|
42
|
-
```
|
|
43
37
|
|
|
44
|
-
Let's look at an example:
|
|
45
|
-
```js
|
|
46
38
|
var movie = new etro.Movie({ canvas: outputCanvas })
|
|
47
39
|
var layer = new etro.layer.Video({ startTime: 0, source: videoElement }) // the layer starts at 0s
|
|
48
40
|
movie.addLayer(layer)
|
|
41
|
+
|
|
49
42
|
movie.record({ frameRate: 24 }) // or just `play` if you don't need to save it
|
|
50
43
|
.then(blob => ...)
|
|
51
44
|
```
|
|
52
45
|
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
The blob could then be downloaded as a video file or displayed using a `<video>`
|
|
47
|
+
element.
|
|
48
|
+
|
|
49
|
+
## Effects
|
|
55
50
|
|
|
56
51
|
Effects can transform the output of a layer or movie:
|
|
57
52
|
```js
|
|
@@ -59,32 +54,23 @@ var layer = new etro.layer.Video({ startTime: 0, source: videoElement })
|
|
|
59
54
|
.addEffect(new etro.effect.Brightness({ brightness: +100) }))
|
|
60
55
|
```
|
|
61
56
|
|
|
62
|
-
##
|
|
63
|
-
|
|
64
|
-
To use Etro in Node, use the [wrapper](https://github.com/etro-js/etro-node):
|
|
65
|
-
```
|
|
66
|
-
npm i etro-node
|
|
67
|
-
```
|
|
57
|
+
## Dynamic Properties
|
|
68
58
|
|
|
59
|
+
Most properties also support keyframes and functions:
|
|
69
60
|
```js
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
//
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
movie
|
|
79
|
-
.exportRaw()
|
|
80
|
-
.then(window.done)
|
|
81
|
-
// Tell Etro Node what inputs to load with { id: path }
|
|
82
|
-
}, { input1: 'image.png' }, 'output.mp4')
|
|
61
|
+
// Keyframes
|
|
62
|
+
layer.effects[0].brightness = new etro.KeyFrame(
|
|
63
|
+
[0, -75], // brightness == -75 at 0 seconds
|
|
64
|
+
[2, +75] // +75 at 2 seconds
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
// Function
|
|
68
|
+
layer.effects[0].brightness = () => 100 * Math.random() - 50
|
|
83
69
|
```
|
|
84
70
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
71
|
+
## Using in Node
|
|
72
|
+
|
|
73
|
+
To use Etro in Node, see the [wrapper](https://github.com/etro-js/etro-node):
|
|
88
74
|
|
|
89
75
|
## Running the Examples
|
|
90
76
|
|
|
@@ -104,12 +90,6 @@ npm start
|
|
|
104
90
|
Now you can open any example (such as
|
|
105
91
|
http://127.0.0.1:8080/examples/introduction/hello-world1.html).
|
|
106
92
|
|
|
107
|
-
## TypeScript
|
|
108
|
-
|
|
109
|
-
Etro is written in TypeScript, so it should work out of the box with TypeScript
|
|
110
|
-
projects. However, it is also compatible with projects that do not use
|
|
111
|
-
TypeScript.
|
|
112
|
-
|
|
113
93
|
## Further Reading
|
|
114
94
|
|
|
115
95
|
- [Documentation](https://etrojs.dev/docs)
|
package/dist/effect/base.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Movie } from '../movie';
|
|
2
|
-
import {
|
|
2
|
+
import { Base as BaseLayer } from '../layer/index';
|
|
3
3
|
import BaseObject from '../object';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* @deprecated All visual effects now inherit from `Visual` instead
|
|
6
6
|
*/
|
|
7
7
|
export declare class Base implements BaseObject {
|
|
8
8
|
type: string;
|
|
@@ -21,8 +21,8 @@ export declare class Base implements BaseObject {
|
|
|
21
21
|
* Attaches this effect to `target` if not already attached.
|
|
22
22
|
* @ignore
|
|
23
23
|
*/
|
|
24
|
-
tryAttach(target: Movie |
|
|
25
|
-
attach(movie: Movie |
|
|
24
|
+
tryAttach(target: Movie | BaseLayer): void;
|
|
25
|
+
attach(movie: Movie | BaseLayer): void;
|
|
26
26
|
/**
|
|
27
27
|
* Dettaches this effect from its target if the number of times `tryDetach`
|
|
28
28
|
* has been called (including this call) equals the number of times
|
|
@@ -40,12 +40,12 @@ export declare class Base implements BaseObject {
|
|
|
40
40
|
* (will soon be replaced with an instance getter)
|
|
41
41
|
* @abstract
|
|
42
42
|
*/
|
|
43
|
-
apply(target: Movie |
|
|
43
|
+
apply(target: Movie | BaseLayer, reltime: number): void;
|
|
44
44
|
/**
|
|
45
45
|
* The current time of the target
|
|
46
46
|
*/
|
|
47
47
|
get currentTime(): number;
|
|
48
|
-
get parent(): Movie |
|
|
48
|
+
get parent(): Movie | BaseLayer;
|
|
49
49
|
get movie(): Movie;
|
|
50
50
|
getDefaultOptions(): Record<string, unknown>;
|
|
51
51
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Movie } from '../movie';
|
|
2
2
|
import { Dynamic } from '../util';
|
|
3
|
-
import {
|
|
4
|
-
import { Visual } from '../layer/index';
|
|
3
|
+
import { Visual } from './visual';
|
|
4
|
+
import { Visual as VisualLayer } from '../layer/index';
|
|
5
5
|
export declare class EllipticalMaskOptions {
|
|
6
6
|
x: Dynamic<number>;
|
|
7
7
|
y: Dynamic<number>;
|
|
@@ -15,7 +15,7 @@ export declare class EllipticalMaskOptions {
|
|
|
15
15
|
/**
|
|
16
16
|
* Preserves an ellipse of the layer and clears the rest
|
|
17
17
|
*/
|
|
18
|
-
export declare class EllipticalMask extends
|
|
18
|
+
export declare class EllipticalMask extends Visual {
|
|
19
19
|
x: Dynamic<number>;
|
|
20
20
|
y: Dynamic<number>;
|
|
21
21
|
radiusX: Dynamic<number>;
|
|
@@ -27,5 +27,5 @@ export declare class EllipticalMask extends Base {
|
|
|
27
27
|
private _tmpCanvas;
|
|
28
28
|
private _tmpCtx;
|
|
29
29
|
constructor(options: EllipticalMaskOptions);
|
|
30
|
-
apply(target: Movie |
|
|
30
|
+
apply(target: Movie | VisualLayer, reltime: number): void;
|
|
31
31
|
}
|
package/dist/effect/index.d.ts
CHANGED
package/dist/effect/shader.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Visual } from '../layer/index';
|
|
1
|
+
import { Visual as VisualLayer } from '../layer/index';
|
|
2
2
|
import { Movie } from '../movie';
|
|
3
|
-
import {
|
|
3
|
+
import { Visual } from './visual';
|
|
4
4
|
export interface UniformOptions {
|
|
5
5
|
type?: string;
|
|
6
6
|
defaultFloatComponent?: number;
|
|
@@ -26,7 +26,7 @@ export interface ShaderOptions {
|
|
|
26
26
|
/**
|
|
27
27
|
* A hardware-accelerated pixel mapping using WebGL
|
|
28
28
|
*/
|
|
29
|
-
export declare class Shader extends
|
|
29
|
+
export declare class Shader extends Visual {
|
|
30
30
|
/**
|
|
31
31
|
* WebGL texture units consumed by {@link Shader}
|
|
32
32
|
*/
|
|
@@ -57,7 +57,7 @@ export declare class Shader extends Base {
|
|
|
57
57
|
private _initTextures;
|
|
58
58
|
private _initAttribs;
|
|
59
59
|
private _initUniforms;
|
|
60
|
-
apply(target: Movie |
|
|
60
|
+
apply(target: Movie | VisualLayer, reltime: number): void;
|
|
61
61
|
private _checkDimensions;
|
|
62
62
|
private _refreshGl;
|
|
63
63
|
private _enablePositionAttrib;
|
package/dist/effect/stack.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { Movie } from '../movie';
|
|
2
|
-
import {
|
|
3
|
-
import { Visual } from '../layer';
|
|
2
|
+
import { Visual } from './visual';
|
|
3
|
+
import { Visual as VisualLayer } from '../layer';
|
|
4
4
|
export interface StackOptions {
|
|
5
|
-
effects:
|
|
5
|
+
effects: Visual[];
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* A sequence of effects to apply, treated as one effect. This can be useful
|
|
9
9
|
* for defining reused effect sequences as one effect.
|
|
10
10
|
*/
|
|
11
|
-
export declare class Stack extends
|
|
12
|
-
readonly effects:
|
|
11
|
+
export declare class Stack extends Visual {
|
|
12
|
+
readonly effects: Visual[];
|
|
13
13
|
private _effectsBack;
|
|
14
14
|
constructor(options: StackOptions);
|
|
15
15
|
attach(movie: Movie): void;
|
|
16
16
|
detach(): void;
|
|
17
|
-
apply(target: Movie |
|
|
17
|
+
apply(target: Movie | VisualLayer, reltime: number): void;
|
|
18
18
|
/**
|
|
19
19
|
* Convenience method for chaining
|
|
20
20
|
* @param effect - the effect to append
|
|
21
21
|
*/
|
|
22
|
-
addEffect(effect:
|
|
22
|
+
addEffect(effect: Visual): Stack;
|
|
23
23
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Visual } from '../layer/index';
|
|
1
|
+
import { Visual as VisualLayer } from '../layer/index';
|
|
2
2
|
import { Movie } from '../movie';
|
|
3
3
|
import { Dynamic } from '../util';
|
|
4
|
-
import {
|
|
4
|
+
import { Visual } from './visual';
|
|
5
5
|
export interface TransformOptions {
|
|
6
6
|
matrix: Dynamic<Transform.Matrix>;
|
|
7
7
|
}
|
|
@@ -11,7 +11,7 @@ export interface TransformOptions {
|
|
|
11
11
|
* translations, scalings and rotations) or B) input the matrix values
|
|
12
12
|
* directly, using the optional argument in the constructor.
|
|
13
13
|
*/
|
|
14
|
-
declare class Transform extends
|
|
14
|
+
declare class Transform extends Visual {
|
|
15
15
|
/** Matrix that determines how to transform the target */
|
|
16
16
|
matrix: Dynamic<Transform.Matrix>;
|
|
17
17
|
private _tmpMatrix;
|
|
@@ -21,7 +21,7 @@ declare class Transform extends Base {
|
|
|
21
21
|
* @param matrix - matrix that determines how to transform the target
|
|
22
22
|
*/
|
|
23
23
|
constructor(options: TransformOptions);
|
|
24
|
-
apply(target: Movie |
|
|
24
|
+
apply(target: Movie | VisualLayer, reltime: number): void;
|
|
25
25
|
}
|
|
26
26
|
declare namespace Transform {
|
|
27
27
|
/**
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Movie } from '../movie';
|
|
2
|
+
import { Visual as VisualLayer } from '../layer/index';
|
|
3
|
+
import { Base } from './base';
|
|
4
|
+
/**
|
|
5
|
+
* Modifies the visual contents of a layer.
|
|
6
|
+
*/
|
|
7
|
+
export declare class Visual extends Base {
|
|
8
|
+
/**
|
|
9
|
+
* Apply this effect to a target at the given time
|
|
10
|
+
*
|
|
11
|
+
* @param target
|
|
12
|
+
* @param reltime - the movie's current time relative to the layer
|
|
13
|
+
* (will soon be replaced with an instance getter)
|
|
14
|
+
* @abstract
|
|
15
|
+
*/
|
|
16
|
+
apply(target: Movie | VisualLayer, reltime: number): void;
|
|
17
|
+
}
|