@remotion/effects 4.0.490 → 4.0.491
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/dist/effect-internals.d.ts +8 -0
- package/dist/entrypoints/blur.d.ts +6 -0
- package/dist/esm/liquid-contours.mjs +473 -0
- package/dist/esm/page-turn.mjs +521 -0
- package/dist/esm/skew.mjs +345 -0
- package/dist/liquid-contours.d.ts +101 -0
- package/dist/page-turn.d.ts +91 -0
- package/dist/skew.d.ts +12 -0
- package/package.json +19 -3
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
// src/skew.ts
|
|
2
|
+
import { Internals } from "remotion";
|
|
3
|
+
|
|
4
|
+
// src/validate-effect-param.ts
|
|
5
|
+
var assertEffectParamsObject = (params, effectLabel) => {
|
|
6
|
+
if (params === null || typeof params !== "object") {
|
|
7
|
+
throw new TypeError(`${effectLabel} effect requires a parameters object, but got ${JSON.stringify(params)}`);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var assertRequiredFiniteNumber = (value, name) => {
|
|
11
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
12
|
+
throw new TypeError(`"${name}" must be a finite number, but got ${JSON.stringify(value)}`);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
var assertRequiredColor = (value, name) => {
|
|
16
|
+
if (typeof value !== "string" || value.length === 0) {
|
|
17
|
+
throw new TypeError(`"${name}" must be a non-empty string, but got ${JSON.stringify(value)}`);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
var assertOptionalColor = (value, name) => {
|
|
21
|
+
if (value === undefined) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
assertRequiredColor(value, name);
|
|
25
|
+
};
|
|
26
|
+
var assertOptionalBoolean = (value, name) => {
|
|
27
|
+
if (value === undefined) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (typeof value !== "boolean") {
|
|
31
|
+
throw new TypeError(`"${name}" must be a boolean, but got ${JSON.stringify(value)}`);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// src/color-utils.ts
|
|
36
|
+
var DEFAULT_AMOUNT = 1;
|
|
37
|
+
var DEFAULT_BRIGHTNESS_AMOUNT = 0;
|
|
38
|
+
var DEFAULT_HUE_DEGREES = 0;
|
|
39
|
+
var colorAmountSchema = {
|
|
40
|
+
type: "number",
|
|
41
|
+
min: 0,
|
|
42
|
+
max: 1,
|
|
43
|
+
step: 0.01,
|
|
44
|
+
default: DEFAULT_AMOUNT,
|
|
45
|
+
description: "Amount",
|
|
46
|
+
hiddenFromList: false
|
|
47
|
+
};
|
|
48
|
+
var colorMultiplierSchema = {
|
|
49
|
+
type: "number",
|
|
50
|
+
min: 0,
|
|
51
|
+
step: 0.01,
|
|
52
|
+
default: DEFAULT_AMOUNT,
|
|
53
|
+
description: "Amount",
|
|
54
|
+
hiddenFromList: false
|
|
55
|
+
};
|
|
56
|
+
var brightnessAmountSchema = {
|
|
57
|
+
type: "number",
|
|
58
|
+
min: -1,
|
|
59
|
+
max: 1,
|
|
60
|
+
step: 0.01,
|
|
61
|
+
default: DEFAULT_BRIGHTNESS_AMOUNT,
|
|
62
|
+
description: "Amount",
|
|
63
|
+
hiddenFromList: false
|
|
64
|
+
};
|
|
65
|
+
var hueDegreesSchema = {
|
|
66
|
+
type: "rotation-degrees",
|
|
67
|
+
step: 1,
|
|
68
|
+
default: DEFAULT_HUE_DEGREES,
|
|
69
|
+
description: "Degrees"
|
|
70
|
+
};
|
|
71
|
+
var assertOptionalFiniteNumber = (value, name) => {
|
|
72
|
+
if (value === undefined) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
assertRequiredFiniteNumber(value, name);
|
|
76
|
+
};
|
|
77
|
+
var validateUnitInterval = (value, name) => {
|
|
78
|
+
if (value < 0) {
|
|
79
|
+
throw new TypeError(`"${name}" must be >= 0, but got ${JSON.stringify(value)}`);
|
|
80
|
+
}
|
|
81
|
+
if (value > 1) {
|
|
82
|
+
throw new TypeError(`"${name}" must be <= 1, but got ${JSON.stringify(value)}`);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
var validateNonNegative = (value, name) => {
|
|
86
|
+
if (value < 0) {
|
|
87
|
+
throw new TypeError(`"${name}" must be >= 0, but got ${JSON.stringify(value)}`);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
var validateSignedUnitInterval = (value, name) => {
|
|
91
|
+
if (value < -1) {
|
|
92
|
+
throw new TypeError(`"${name}" must be >= -1, but got ${JSON.stringify(value)}`);
|
|
93
|
+
}
|
|
94
|
+
if (value > 1) {
|
|
95
|
+
throw new TypeError(`"${name}" must be <= 1, but got ${JSON.stringify(value)}`);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
var clampColorChannel = (value) => {
|
|
99
|
+
return Math.max(0, Math.min(255, value));
|
|
100
|
+
};
|
|
101
|
+
var parseColorRgba = (ctx, color) => {
|
|
102
|
+
ctx.clearRect(0, 0, 1, 1);
|
|
103
|
+
ctx.fillStyle = color;
|
|
104
|
+
ctx.fillRect(0, 0, 1, 1);
|
|
105
|
+
const { data } = ctx.getImageData(0, 0, 1, 1);
|
|
106
|
+
return [data[0], data[1], data[2], data[3]];
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
// src/uv-coordinate.ts
|
|
110
|
+
var publicUvToShaderUv = (uv) => {
|
|
111
|
+
return [uv[0], 1 - uv[1]];
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// src/skew.ts
|
|
115
|
+
var { createEffect, createWebGL2ContextError } = Internals;
|
|
116
|
+
var DEFAULT_X = 20;
|
|
117
|
+
var DEFAULT_Y = 0;
|
|
118
|
+
var DEFAULT_ORIGIN = [0.5, 0.5];
|
|
119
|
+
var MAX_ABSOLUTE_ANGLE = 89;
|
|
120
|
+
var skewSchema = {
|
|
121
|
+
x: {
|
|
122
|
+
type: "rotation-degrees",
|
|
123
|
+
min: -80,
|
|
124
|
+
max: 80,
|
|
125
|
+
step: 1,
|
|
126
|
+
default: DEFAULT_X,
|
|
127
|
+
description: "X angle"
|
|
128
|
+
},
|
|
129
|
+
y: {
|
|
130
|
+
type: "rotation-degrees",
|
|
131
|
+
min: -80,
|
|
132
|
+
max: 80,
|
|
133
|
+
step: 1,
|
|
134
|
+
default: DEFAULT_Y,
|
|
135
|
+
description: "Y angle"
|
|
136
|
+
},
|
|
137
|
+
origin: {
|
|
138
|
+
type: "uv-coordinate",
|
|
139
|
+
min: 0,
|
|
140
|
+
max: 1,
|
|
141
|
+
step: 0.01,
|
|
142
|
+
default: DEFAULT_ORIGIN,
|
|
143
|
+
description: "Origin"
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
var resolve = (params) => ({
|
|
147
|
+
x: params.x ?? DEFAULT_X,
|
|
148
|
+
y: params.y ?? DEFAULT_Y,
|
|
149
|
+
origin: [...params.origin ?? DEFAULT_ORIGIN]
|
|
150
|
+
});
|
|
151
|
+
var assertOptionalUvCoordinate = (value, name) => {
|
|
152
|
+
if (value === undefined) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
if (!Array.isArray(value) || value.length !== 2 || value.some((item) => typeof item !== "number" || !Number.isFinite(item))) {
|
|
156
|
+
throw new TypeError(`"${name}" must be a [number, number] tuple`);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
var validateUvCoordinate = (value, name) => {
|
|
160
|
+
if (value < 0 || value > 1) {
|
|
161
|
+
throw new TypeError(`"${name}" must be between 0 and 1, but got ${JSON.stringify(value)}`);
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
var validateAngle = (value, name) => {
|
|
165
|
+
if (Math.abs(value) >= MAX_ABSOLUTE_ANGLE) {
|
|
166
|
+
throw new TypeError(`"${name}" must be greater than -${MAX_ABSOLUTE_ANGLE} and less than ${MAX_ABSOLUTE_ANGLE}, but got ${JSON.stringify(value)}`);
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
var validateSkewParams = (params) => {
|
|
170
|
+
assertEffectParamsObject(params, "Skew");
|
|
171
|
+
assertOptionalFiniteNumber(params.x, "x");
|
|
172
|
+
assertOptionalFiniteNumber(params.y, "y");
|
|
173
|
+
assertOptionalUvCoordinate(params.origin, "origin");
|
|
174
|
+
const resolved = resolve(params);
|
|
175
|
+
validateAngle(resolved.x, "x");
|
|
176
|
+
validateAngle(resolved.y, "y");
|
|
177
|
+
validateUvCoordinate(resolved.origin[0], "origin[0]");
|
|
178
|
+
validateUvCoordinate(resolved.origin[1], "origin[1]");
|
|
179
|
+
};
|
|
180
|
+
var SKEW_VS = `#version 300 es
|
|
181
|
+
in vec2 aPos;
|
|
182
|
+
in vec2 aUv;
|
|
183
|
+
out vec2 vUv;
|
|
184
|
+
|
|
185
|
+
void main() {
|
|
186
|
+
vUv = aUv;
|
|
187
|
+
gl_Position = vec4(aPos, 0.0, 1.0);
|
|
188
|
+
}
|
|
189
|
+
`;
|
|
190
|
+
var SKEW_FS = `#version 300 es
|
|
191
|
+
precision highp float;
|
|
192
|
+
|
|
193
|
+
in vec2 vUv;
|
|
194
|
+
out vec4 fragColor;
|
|
195
|
+
|
|
196
|
+
uniform sampler2D uSource;
|
|
197
|
+
uniform vec2 uResolution;
|
|
198
|
+
uniform vec2 uSkew;
|
|
199
|
+
uniform vec2 uOrigin;
|
|
200
|
+
|
|
201
|
+
void main() {
|
|
202
|
+
vec2 destination = (vUv - uOrigin) * uResolution;
|
|
203
|
+
|
|
204
|
+
// Invert a horizontal skew followed by a vertical skew.
|
|
205
|
+
float sourceY = destination.y - uSkew.y * destination.x;
|
|
206
|
+
float sourceX = destination.x - uSkew.x * sourceY;
|
|
207
|
+
vec2 sourceUv = vec2(sourceX, sourceY) / uResolution + uOrigin;
|
|
208
|
+
|
|
209
|
+
if (any(lessThan(sourceUv, vec2(0.0))) || any(greaterThan(sourceUv, vec2(1.0)))) {
|
|
210
|
+
fragColor = vec4(0.0);
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
fragColor = texture(uSource, sourceUv);
|
|
215
|
+
}
|
|
216
|
+
`;
|
|
217
|
+
var compileShader = (gl, type, source) => {
|
|
218
|
+
const shader = gl.createShader(type);
|
|
219
|
+
if (!shader) {
|
|
220
|
+
throw new Error("Failed to create WebGL shader");
|
|
221
|
+
}
|
|
222
|
+
gl.shaderSource(shader, source);
|
|
223
|
+
gl.compileShader(shader);
|
|
224
|
+
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
|
|
225
|
+
const log = gl.getShaderInfoLog(shader);
|
|
226
|
+
gl.deleteShader(shader);
|
|
227
|
+
throw new Error(`Skew shader compile failed: ${log ?? "(no log)"}`);
|
|
228
|
+
}
|
|
229
|
+
return shader;
|
|
230
|
+
};
|
|
231
|
+
var setupSkew = (target) => {
|
|
232
|
+
const gl = target.getContext("webgl2", {
|
|
233
|
+
premultipliedAlpha: true,
|
|
234
|
+
alpha: true,
|
|
235
|
+
preserveDrawingBuffer: true
|
|
236
|
+
});
|
|
237
|
+
if (!gl) {
|
|
238
|
+
throw createWebGL2ContextError("skew effect");
|
|
239
|
+
}
|
|
240
|
+
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
|
|
241
|
+
const vertexShader = compileShader(gl, gl.VERTEX_SHADER, SKEW_VS);
|
|
242
|
+
const fragmentShader = compileShader(gl, gl.FRAGMENT_SHADER, SKEW_FS);
|
|
243
|
+
const program = gl.createProgram();
|
|
244
|
+
if (!program) {
|
|
245
|
+
throw new Error("Failed to create WebGL program");
|
|
246
|
+
}
|
|
247
|
+
gl.attachShader(program, vertexShader);
|
|
248
|
+
gl.attachShader(program, fragmentShader);
|
|
249
|
+
gl.linkProgram(program);
|
|
250
|
+
gl.deleteShader(vertexShader);
|
|
251
|
+
gl.deleteShader(fragmentShader);
|
|
252
|
+
if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
|
|
253
|
+
const log = gl.getProgramInfoLog(program);
|
|
254
|
+
gl.deleteProgram(program);
|
|
255
|
+
throw new Error(`Skew program link failed: ${log ?? "(no log)"}`);
|
|
256
|
+
}
|
|
257
|
+
const vao = gl.createVertexArray();
|
|
258
|
+
const vbo = gl.createBuffer();
|
|
259
|
+
if (!vao || !vbo) {
|
|
260
|
+
throw new Error("Failed to create WebGL geometry");
|
|
261
|
+
}
|
|
262
|
+
gl.bindVertexArray(vao);
|
|
263
|
+
gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
|
|
264
|
+
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, -1, 1, 0, 1, 1, 1, 1, 1]), gl.STATIC_DRAW);
|
|
265
|
+
const aPos = gl.getAttribLocation(program, "aPos");
|
|
266
|
+
const aUv = gl.getAttribLocation(program, "aUv");
|
|
267
|
+
gl.enableVertexAttribArray(aPos);
|
|
268
|
+
gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 16, 0);
|
|
269
|
+
gl.enableVertexAttribArray(aUv);
|
|
270
|
+
gl.vertexAttribPointer(aUv, 2, gl.FLOAT, false, 16, 8);
|
|
271
|
+
gl.bindVertexArray(null);
|
|
272
|
+
const texture = gl.createTexture();
|
|
273
|
+
if (!texture) {
|
|
274
|
+
throw new Error("Failed to create WebGL texture");
|
|
275
|
+
}
|
|
276
|
+
gl.bindTexture(gl.TEXTURE_2D, texture);
|
|
277
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
278
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
279
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
|
|
280
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
|
|
281
|
+
gl.bindTexture(gl.TEXTURE_2D, null);
|
|
282
|
+
return {
|
|
283
|
+
gl,
|
|
284
|
+
program,
|
|
285
|
+
vao,
|
|
286
|
+
vbo,
|
|
287
|
+
texture,
|
|
288
|
+
uSource: gl.getUniformLocation(program, "uSource"),
|
|
289
|
+
uResolution: gl.getUniformLocation(program, "uResolution"),
|
|
290
|
+
uSkew: gl.getUniformLocation(program, "uSkew"),
|
|
291
|
+
uOrigin: gl.getUniformLocation(program, "uOrigin")
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
var skew = createEffect({
|
|
295
|
+
type: "dev.remotion.effects.skew",
|
|
296
|
+
label: "skew()",
|
|
297
|
+
documentationLink: "https://www.remotion.dev/docs/effects/skew",
|
|
298
|
+
backend: "webgl2",
|
|
299
|
+
calculateKey: (params) => {
|
|
300
|
+
const resolved = resolve(params);
|
|
301
|
+
return `skew-${resolved.x}-${resolved.y}-${resolved.origin[0]}-${resolved.origin[1]}`;
|
|
302
|
+
},
|
|
303
|
+
setup: setupSkew,
|
|
304
|
+
apply: ({ source, width, height, params, state, flipSourceY }) => {
|
|
305
|
+
const resolved = resolve(params);
|
|
306
|
+
const radians = Math.PI / 180;
|
|
307
|
+
const { gl } = state;
|
|
308
|
+
gl.viewport(0, 0, width, height);
|
|
309
|
+
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
|
|
310
|
+
gl.clearColor(0, 0, 0, 0);
|
|
311
|
+
gl.clear(gl.COLOR_BUFFER_BIT);
|
|
312
|
+
gl.useProgram(state.program);
|
|
313
|
+
gl.bindVertexArray(state.vao);
|
|
314
|
+
gl.activeTexture(gl.TEXTURE0);
|
|
315
|
+
gl.bindTexture(gl.TEXTURE_2D, state.texture);
|
|
316
|
+
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipSourceY);
|
|
317
|
+
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, source);
|
|
318
|
+
if (state.uSource)
|
|
319
|
+
gl.uniform1i(state.uSource, 0);
|
|
320
|
+
if (state.uResolution)
|
|
321
|
+
gl.uniform2f(state.uResolution, width, height);
|
|
322
|
+
if (state.uSkew) {
|
|
323
|
+
gl.uniform2f(state.uSkew, Math.tan(resolved.x * radians), Math.tan(resolved.y * radians));
|
|
324
|
+
}
|
|
325
|
+
if (state.uOrigin) {
|
|
326
|
+
const [originX, originY] = publicUvToShaderUv(resolved.origin);
|
|
327
|
+
gl.uniform2f(state.uOrigin, originX, originY);
|
|
328
|
+
}
|
|
329
|
+
gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
|
|
330
|
+
gl.bindVertexArray(null);
|
|
331
|
+
gl.bindTexture(gl.TEXTURE_2D, null);
|
|
332
|
+
gl.useProgram(null);
|
|
333
|
+
},
|
|
334
|
+
cleanup: ({ gl, program, vao, vbo, texture }) => {
|
|
335
|
+
gl.deleteTexture(texture);
|
|
336
|
+
gl.deleteBuffer(vbo);
|
|
337
|
+
gl.deleteProgram(program);
|
|
338
|
+
gl.deleteVertexArray(vao);
|
|
339
|
+
},
|
|
340
|
+
schema: skewSchema,
|
|
341
|
+
validateParams: validateSkewParams
|
|
342
|
+
});
|
|
343
|
+
export {
|
|
344
|
+
skew
|
|
345
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
export declare const liquidContoursSchema: {
|
|
2
|
+
readonly firstColor: {
|
|
3
|
+
readonly type: "color";
|
|
4
|
+
readonly default: "#ff1a0a";
|
|
5
|
+
readonly description: "First color";
|
|
6
|
+
};
|
|
7
|
+
readonly secondColor: {
|
|
8
|
+
readonly type: "color";
|
|
9
|
+
readonly default: "#050505";
|
|
10
|
+
readonly description: "Second color";
|
|
11
|
+
};
|
|
12
|
+
readonly spacing: {
|
|
13
|
+
readonly type: "number";
|
|
14
|
+
readonly min: 2;
|
|
15
|
+
readonly max: 300;
|
|
16
|
+
readonly step: 1;
|
|
17
|
+
readonly default: 62;
|
|
18
|
+
readonly description: "Spacing";
|
|
19
|
+
readonly hiddenFromList: false;
|
|
20
|
+
};
|
|
21
|
+
readonly scale: {
|
|
22
|
+
readonly type: "number";
|
|
23
|
+
readonly min: 20;
|
|
24
|
+
readonly max: 1000;
|
|
25
|
+
readonly step: 1;
|
|
26
|
+
readonly default: 300;
|
|
27
|
+
readonly description: "Scale";
|
|
28
|
+
readonly hiddenFromList: false;
|
|
29
|
+
};
|
|
30
|
+
readonly complexity: {
|
|
31
|
+
readonly type: "number";
|
|
32
|
+
readonly min: 0;
|
|
33
|
+
readonly max: 1;
|
|
34
|
+
readonly step: 0.01;
|
|
35
|
+
readonly default: 0;
|
|
36
|
+
readonly description: "Complexity";
|
|
37
|
+
readonly hiddenFromList: false;
|
|
38
|
+
};
|
|
39
|
+
readonly smoothness: {
|
|
40
|
+
readonly type: "number";
|
|
41
|
+
readonly min: 0;
|
|
42
|
+
readonly max: 1;
|
|
43
|
+
readonly step: 0.01;
|
|
44
|
+
readonly default: 1;
|
|
45
|
+
readonly description: "Edge smoothness";
|
|
46
|
+
readonly hiddenFromList: false;
|
|
47
|
+
};
|
|
48
|
+
readonly seed: {
|
|
49
|
+
readonly type: "number";
|
|
50
|
+
readonly step: 1;
|
|
51
|
+
readonly default: 4;
|
|
52
|
+
readonly description: "Seed";
|
|
53
|
+
readonly hiddenFromList: false;
|
|
54
|
+
};
|
|
55
|
+
readonly offsetX: {
|
|
56
|
+
readonly type: "number";
|
|
57
|
+
readonly step: 0.1;
|
|
58
|
+
readonly default: 13.4;
|
|
59
|
+
readonly description: "Offset X";
|
|
60
|
+
readonly hiddenFromList: false;
|
|
61
|
+
};
|
|
62
|
+
readonly offsetY: {
|
|
63
|
+
readonly type: "number";
|
|
64
|
+
readonly step: 0.1;
|
|
65
|
+
readonly default: 0;
|
|
66
|
+
readonly description: "Offset Y";
|
|
67
|
+
readonly hiddenFromList: false;
|
|
68
|
+
};
|
|
69
|
+
readonly phase: {
|
|
70
|
+
readonly type: "number";
|
|
71
|
+
readonly step: 0.01;
|
|
72
|
+
readonly default: 3.23;
|
|
73
|
+
readonly description: "Phase";
|
|
74
|
+
readonly hiddenFromList: false;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
export type LiquidContoursParams = {
|
|
78
|
+
/** First alternating band color. Defaults to `#ff1a0a`. */
|
|
79
|
+
readonly firstColor?: string;
|
|
80
|
+
/** Second alternating band color. Defaults to `#050505`. */
|
|
81
|
+
readonly secondColor?: string;
|
|
82
|
+
/** Width of a pair of bands in pixels. Defaults to `62`. */
|
|
83
|
+
readonly spacing?: number;
|
|
84
|
+
/** Size of the generated shapes in pixels. Defaults to `300`. */
|
|
85
|
+
readonly scale?: number;
|
|
86
|
+
/** Amount of small-scale detail from `0` to `1`. Defaults to `0`. */
|
|
87
|
+
readonly complexity?: number;
|
|
88
|
+
/** Edge softness from `0` to `1`. Defaults to `1`. */
|
|
89
|
+
readonly smoothness?: number;
|
|
90
|
+
/** Deterministic seed. Defaults to `4`. */
|
|
91
|
+
readonly seed?: number;
|
|
92
|
+
/** Horizontal pattern offset in pixels. Defaults to `13.4`. */
|
|
93
|
+
readonly offsetX?: number;
|
|
94
|
+
/** Vertical pattern offset in pixels. Defaults to `0`. */
|
|
95
|
+
readonly offsetY?: number;
|
|
96
|
+
/** Shifts the alternating bands. Defaults to `3.23`. */
|
|
97
|
+
readonly phase?: number;
|
|
98
|
+
};
|
|
99
|
+
export declare const liquidContours: (params?: (LiquidContoursParams & {
|
|
100
|
+
readonly disabled?: boolean | undefined;
|
|
101
|
+
}) | undefined) => import("remotion").EffectDescriptor<unknown>;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
export declare const pageTurnSchema: {
|
|
2
|
+
readonly progress: {
|
|
3
|
+
readonly type: "number";
|
|
4
|
+
readonly min: 0;
|
|
5
|
+
readonly max: 1;
|
|
6
|
+
readonly step: 0.01;
|
|
7
|
+
readonly default: 0.5;
|
|
8
|
+
readonly description: "Progress";
|
|
9
|
+
readonly hiddenFromList: false;
|
|
10
|
+
};
|
|
11
|
+
readonly foldPosition: {
|
|
12
|
+
readonly type: "uv-coordinate";
|
|
13
|
+
readonly step: 0.01;
|
|
14
|
+
readonly default: readonly [1, 1];
|
|
15
|
+
readonly description: "Fold position";
|
|
16
|
+
};
|
|
17
|
+
readonly angle: {
|
|
18
|
+
readonly type: "rotation-degrees";
|
|
19
|
+
readonly step: 1;
|
|
20
|
+
readonly default: 225;
|
|
21
|
+
readonly description: "Angle";
|
|
22
|
+
};
|
|
23
|
+
readonly foldRadius: {
|
|
24
|
+
readonly type: "number";
|
|
25
|
+
readonly min: 0.02;
|
|
26
|
+
readonly max: 0.5;
|
|
27
|
+
readonly step: 0.01;
|
|
28
|
+
readonly default: 0.18;
|
|
29
|
+
readonly description: "Fold radius";
|
|
30
|
+
readonly hiddenFromList: false;
|
|
31
|
+
};
|
|
32
|
+
readonly lightDirection: {
|
|
33
|
+
readonly type: "rotation-degrees";
|
|
34
|
+
readonly step: 1;
|
|
35
|
+
readonly default: 60;
|
|
36
|
+
readonly description: "Light direction";
|
|
37
|
+
};
|
|
38
|
+
readonly shadow: {
|
|
39
|
+
readonly type: "number";
|
|
40
|
+
readonly min: 0;
|
|
41
|
+
readonly max: 1;
|
|
42
|
+
readonly step: 0.01;
|
|
43
|
+
readonly default: 0.45;
|
|
44
|
+
readonly description: "Shadow";
|
|
45
|
+
readonly hiddenFromList: false;
|
|
46
|
+
};
|
|
47
|
+
readonly backOpacity: {
|
|
48
|
+
readonly type: "number";
|
|
49
|
+
readonly min: 0;
|
|
50
|
+
readonly max: 1;
|
|
51
|
+
readonly step: 0.01;
|
|
52
|
+
readonly default: 0.85;
|
|
53
|
+
readonly description: "Back opacity";
|
|
54
|
+
readonly hiddenFromList: false;
|
|
55
|
+
};
|
|
56
|
+
readonly paperColor: {
|
|
57
|
+
readonly type: "color";
|
|
58
|
+
readonly default: "#fff8dc";
|
|
59
|
+
readonly description: "Paper color";
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export type PageTurnFoldPosition = readonly [number, number];
|
|
63
|
+
export type PageTurnParams = {
|
|
64
|
+
/**
|
|
65
|
+
* Turn amount from 0 (flat source) to 1 (fully turned away).
|
|
66
|
+
* Defaults to `0.5`.
|
|
67
|
+
*/
|
|
68
|
+
readonly progress?: number;
|
|
69
|
+
/**
|
|
70
|
+
* Point where the page starts folding, in UV coordinates.
|
|
71
|
+
* Defaults to `[1, 1]`.
|
|
72
|
+
*/
|
|
73
|
+
readonly foldPosition?: PageTurnFoldPosition;
|
|
74
|
+
/** Direction of the turn in degrees. Defaults to `225`. */
|
|
75
|
+
readonly angle?: number;
|
|
76
|
+
/**
|
|
77
|
+
* Width of the curled band as a fraction of the canvas. Defaults to `0.18`.
|
|
78
|
+
*/
|
|
79
|
+
readonly foldRadius?: number;
|
|
80
|
+
/** Direction of the light in degrees. Defaults to `60`. */
|
|
81
|
+
readonly lightDirection?: number;
|
|
82
|
+
/** Strength of the crease and back-face shading. Defaults to `0.45`. */
|
|
83
|
+
readonly shadow?: number;
|
|
84
|
+
/** Opacity of the dimmed back face of the page. Defaults to `0.85`. */
|
|
85
|
+
readonly backOpacity?: number;
|
|
86
|
+
/** Color of the paper back side. Defaults to `#fff8dc`. */
|
|
87
|
+
readonly paperColor?: string;
|
|
88
|
+
};
|
|
89
|
+
export declare const pageTurn: (params?: (PageTurnParams & {
|
|
90
|
+
readonly disabled?: boolean | undefined;
|
|
91
|
+
}) | undefined) => import("remotion").EffectDescriptor<unknown>;
|
package/dist/skew.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type SkewOrigin = readonly [number, number];
|
|
2
|
+
export type SkewParams = {
|
|
3
|
+
/** Horizontal skew angle in degrees. Defaults to `20`. */
|
|
4
|
+
readonly x?: number;
|
|
5
|
+
/** Vertical skew angle in degrees. Defaults to `0`. */
|
|
6
|
+
readonly y?: number;
|
|
7
|
+
/** Origin of the skew in UV coordinates. Defaults to `[0.5, 0.5]`. */
|
|
8
|
+
readonly origin?: SkewOrigin;
|
|
9
|
+
};
|
|
10
|
+
export declare const skew: (params?: (SkewParams & {
|
|
11
|
+
readonly disabled?: boolean | undefined;
|
|
12
|
+
}) | undefined) => import("remotion").EffectDescriptor<unknown>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/effects",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.491",
|
|
4
4
|
"description": "Effects that can be applied to Remotion-based canvas components",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"remotion": "4.0.
|
|
29
|
+
"remotion": "4.0.491"
|
|
30
30
|
},
|
|
31
31
|
"exports": {
|
|
32
32
|
".": {
|
|
@@ -169,6 +169,11 @@
|
|
|
169
169
|
"module": "./dist/esm/linear-gradient-tint.mjs",
|
|
170
170
|
"import": "./dist/esm/linear-gradient-tint.mjs"
|
|
171
171
|
},
|
|
172
|
+
"./liquid-contours": {
|
|
173
|
+
"types": "./dist/liquid-contours.d.ts",
|
|
174
|
+
"module": "./dist/esm/liquid-contours.mjs",
|
|
175
|
+
"import": "./dist/esm/liquid-contours.mjs"
|
|
176
|
+
},
|
|
172
177
|
"./linear-progressive-blur": {
|
|
173
178
|
"types": "./dist/linear-progressive-blur.d.ts",
|
|
174
179
|
"module": "./dist/esm/linear-progressive-blur.mjs",
|
|
@@ -259,6 +264,11 @@
|
|
|
259
264
|
"module": "./dist/esm/shrinkwrap.mjs",
|
|
260
265
|
"import": "./dist/esm/shrinkwrap.mjs"
|
|
261
266
|
},
|
|
267
|
+
"./skew": {
|
|
268
|
+
"types": "./dist/skew.d.ts",
|
|
269
|
+
"module": "./dist/esm/skew.mjs",
|
|
270
|
+
"import": "./dist/esm/skew.mjs"
|
|
271
|
+
},
|
|
262
272
|
"./speckle": {
|
|
263
273
|
"types": "./dist/speckle.d.ts",
|
|
264
274
|
"module": "./dist/esm/speckle.mjs",
|
|
@@ -404,6 +414,9 @@
|
|
|
404
414
|
"linear-gradient-tint": [
|
|
405
415
|
"dist/linear-gradient-tint.d.ts"
|
|
406
416
|
],
|
|
417
|
+
"liquid-contours": [
|
|
418
|
+
"dist/liquid-contours.d.ts"
|
|
419
|
+
],
|
|
407
420
|
"linear-progressive-blur": [
|
|
408
421
|
"dist/linear-progressive-blur.d.ts"
|
|
409
422
|
],
|
|
@@ -458,6 +471,9 @@
|
|
|
458
471
|
"shrinkwrap": [
|
|
459
472
|
"dist/shrinkwrap.d.ts"
|
|
460
473
|
],
|
|
474
|
+
"skew": [
|
|
475
|
+
"dist/skew.d.ts"
|
|
476
|
+
],
|
|
461
477
|
"speckle": [
|
|
462
478
|
"dist/speckle.d.ts"
|
|
463
479
|
],
|
|
@@ -498,7 +514,7 @@
|
|
|
498
514
|
},
|
|
499
515
|
"homepage": "https://www.remotion.dev/docs/effects/api",
|
|
500
516
|
"devDependencies": {
|
|
501
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
517
|
+
"@remotion/eslint-config-internal": "4.0.491",
|
|
502
518
|
"@vitest/browser-playwright": "4.0.9",
|
|
503
519
|
"eslint": "9.19.0",
|
|
504
520
|
"vitest": "4.0.9",
|