@remotion/effects 4.0.488 → 4.0.490

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.
@@ -0,0 +1,513 @@
1
+ // src/radial-progressive-pixelate/index.ts
2
+ import { Internals as Internals2 } 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/progressive-pixelate-runtime.ts
110
+ import { Internals } from "remotion";
111
+ var { createWebGL2ContextError } = Internals;
112
+ var VERTEX_SHADER = `#version 300 es
113
+ layout(location = 0) in vec2 aPos;
114
+ layout(location = 1) in vec2 aUv;
115
+ out vec2 vUv;
116
+
117
+ void main() {
118
+ vUv = aUv;
119
+ gl_Position = vec4(aPos, 0.0, 1.0);
120
+ }
121
+ `;
122
+ var FRAGMENT_SHADER = `#version 300 es
123
+ precision highp float;
124
+
125
+ in vec2 vUv;
126
+ out vec4 fragColor;
127
+
128
+ uniform sampler2D uSource;
129
+ uniform vec2 uResolution;
130
+ uniform int uMode;
131
+ uniform vec2 uStart;
132
+ uniform vec2 uEnd;
133
+ uniform vec2 uCenter;
134
+ uniform float uWidth;
135
+ uniform float uHeight;
136
+ uniform float uRotation;
137
+ uniform float uRadialStart;
138
+ uniform float uStartBlockSize;
139
+ uniform float uEndBlockSize;
140
+
141
+ float linearProgress(vec2 uv) {
142
+ vec2 gradient = uEnd - uStart;
143
+ float gradientLengthSq = dot(gradient, gradient);
144
+ if (gradientLengthSq <= 0.0000001) {
145
+ return 0.0;
146
+ }
147
+
148
+ return clamp(dot(uv - uStart, gradient) / gradientLengthSq, 0.0, 1.0);
149
+ }
150
+
151
+ float radialProgress(vec2 uv) {
152
+ vec2 radii = vec2(uWidth * uResolution.x, uHeight * uResolution.y) * 0.5;
153
+ if (radii.x <= 0.0000001 || radii.y <= 0.0000001) {
154
+ return 0.0;
155
+ }
156
+
157
+ vec2 delta = (uv - uCenter) * uResolution;
158
+ float angle = radians(uRotation);
159
+ float c = cos(angle);
160
+ float s = sin(angle);
161
+ vec2 local = vec2(
162
+ c * delta.x + s * delta.y,
163
+ -s * delta.x + c * delta.y
164
+ );
165
+ float ellipseProgress = clamp(length(local / radii), 0.0, 1.0);
166
+ float distance = 1.0 - uRadialStart;
167
+ return abs(distance) <= 0.0000001
168
+ ? step(uRadialStart, ellipseProgress)
169
+ : clamp((ellipseProgress - uRadialStart) / distance, 0.0, 1.0);
170
+ }
171
+
172
+ vec4 samplePixelated(float blockSize) {
173
+ vec2 pixelSizeUv = vec2(blockSize) / uResolution;
174
+ vec2 blockUv = floor(vUv / pixelSizeUv) * pixelSizeUv + pixelSizeUv * 0.5;
175
+ return texture(uSource, blockUv);
176
+ }
177
+
178
+ void main() {
179
+ // Public UV coordinates use top-left origin, matching canvas/CSS coordinates.
180
+ vec2 publicUv = vec2(vUv.x, 1.0 - vUv.y);
181
+ float progress = uMode == 0
182
+ ? linearProgress(publicUv)
183
+ : radialProgress(publicUv);
184
+ float targetBlockSize = max(
185
+ 1.0,
186
+ mix(uStartBlockSize, uEndBlockSize, progress)
187
+ );
188
+
189
+ // Adjacent power-of-two grids remain aligned as the block size changes.
190
+ float level = log2(targetBlockSize);
191
+ float lowerBlockSize = exp2(floor(level));
192
+ float upperBlockSize = lowerBlockSize * 2.0;
193
+ float levelProgress = fract(level);
194
+ fragColor = mix(
195
+ samplePixelated(lowerBlockSize),
196
+ samplePixelated(upperBlockSize),
197
+ levelProgress
198
+ );
199
+ }
200
+ `;
201
+ var compileShader = (gl, type, source) => {
202
+ const shader = gl.createShader(type);
203
+ if (!shader) {
204
+ throw new Error("Failed to create WebGL shader");
205
+ }
206
+ gl.shaderSource(shader, source);
207
+ gl.compileShader(shader);
208
+ if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
209
+ const log = gl.getShaderInfoLog(shader);
210
+ gl.deleteShader(shader);
211
+ throw new Error(`Progressive pixelate shader compile failed: ${log ?? "(no log)"}`);
212
+ }
213
+ return shader;
214
+ };
215
+ var linkProgram = (gl, vs, fs) => {
216
+ const program = gl.createProgram();
217
+ if (!program) {
218
+ throw new Error("Failed to create WebGL program");
219
+ }
220
+ gl.attachShader(program, vs);
221
+ gl.attachShader(program, fs);
222
+ gl.linkProgram(program);
223
+ if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
224
+ const log = gl.getProgramInfoLog(program);
225
+ gl.deleteProgram(program);
226
+ throw new Error(`Progressive pixelate program link failed: ${log ?? "(no log)"}`);
227
+ }
228
+ return program;
229
+ };
230
+ var setupProgressivePixelate = (target) => {
231
+ const gl = target.getContext("webgl2", {
232
+ premultipliedAlpha: true,
233
+ alpha: true,
234
+ preserveDrawingBuffer: true
235
+ });
236
+ if (!gl) {
237
+ throw createWebGL2ContextError("progressive pixelate effect");
238
+ }
239
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
240
+ const vs = compileShader(gl, gl.VERTEX_SHADER, VERTEX_SHADER);
241
+ const fs = compileShader(gl, gl.FRAGMENT_SHADER, FRAGMENT_SHADER);
242
+ const program = linkProgram(gl, vs, fs);
243
+ gl.deleteShader(vs);
244
+ gl.deleteShader(fs);
245
+ const vao = gl.createVertexArray();
246
+ if (!vao) {
247
+ throw new Error("Failed to create WebGL vertex array");
248
+ }
249
+ gl.bindVertexArray(vao);
250
+ const data = new Float32Array([
251
+ -1,
252
+ -1,
253
+ 0,
254
+ 0,
255
+ 1,
256
+ -1,
257
+ 1,
258
+ 0,
259
+ -1,
260
+ 1,
261
+ 0,
262
+ 1,
263
+ 1,
264
+ 1,
265
+ 1,
266
+ 1
267
+ ]);
268
+ const vbo = gl.createBuffer();
269
+ if (!vbo) {
270
+ throw new Error("Failed to create WebGL buffer");
271
+ }
272
+ gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
273
+ gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);
274
+ gl.enableVertexAttribArray(0);
275
+ gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 16, 0);
276
+ gl.enableVertexAttribArray(1);
277
+ gl.vertexAttribPointer(1, 2, gl.FLOAT, false, 16, 8);
278
+ gl.bindVertexArray(null);
279
+ const texture = gl.createTexture();
280
+ if (!texture) {
281
+ throw new Error("Failed to create WebGL texture");
282
+ }
283
+ gl.bindTexture(gl.TEXTURE_2D, texture);
284
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
285
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
286
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
287
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
288
+ gl.bindTexture(gl.TEXTURE_2D, null);
289
+ return {
290
+ gl,
291
+ program,
292
+ vao,
293
+ vbo,
294
+ texture,
295
+ uniforms: {
296
+ uSource: gl.getUniformLocation(program, "uSource"),
297
+ uResolution: gl.getUniformLocation(program, "uResolution"),
298
+ uMode: gl.getUniformLocation(program, "uMode"),
299
+ uStart: gl.getUniformLocation(program, "uStart"),
300
+ uEnd: gl.getUniformLocation(program, "uEnd"),
301
+ uCenter: gl.getUniformLocation(program, "uCenter"),
302
+ uWidth: gl.getUniformLocation(program, "uWidth"),
303
+ uHeight: gl.getUniformLocation(program, "uHeight"),
304
+ uRotation: gl.getUniformLocation(program, "uRotation"),
305
+ uRadialStart: gl.getUniformLocation(program, "uRadialStart"),
306
+ uStartBlockSize: gl.getUniformLocation(program, "uStartBlockSize"),
307
+ uEndBlockSize: gl.getUniformLocation(program, "uEndBlockSize")
308
+ }
309
+ };
310
+ };
311
+ var prepareProgressivePixelate = ({
312
+ state,
313
+ source,
314
+ width,
315
+ height,
316
+ flipSourceY
317
+ }) => {
318
+ const { gl, uniforms } = state;
319
+ gl.viewport(0, 0, width, height);
320
+ gl.clearColor(0, 0, 0, 0);
321
+ gl.clear(gl.COLOR_BUFFER_BIT);
322
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
323
+ gl.activeTexture(gl.TEXTURE0);
324
+ gl.bindTexture(gl.TEXTURE_2D, state.texture);
325
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipSourceY);
326
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
327
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, source);
328
+ gl.useProgram(state.program);
329
+ if (uniforms.uSource)
330
+ gl.uniform1i(uniforms.uSource, 0);
331
+ if (uniforms.uResolution)
332
+ gl.uniform2f(uniforms.uResolution, width, height);
333
+ };
334
+ var drawProgressivePixelate = (state) => {
335
+ const { gl } = state;
336
+ gl.bindVertexArray(state.vao);
337
+ gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
338
+ gl.bindVertexArray(null);
339
+ gl.bindTexture(gl.TEXTURE_2D, null);
340
+ gl.useProgram(null);
341
+ };
342
+ var cleanupProgressivePixelate = ({
343
+ gl,
344
+ program,
345
+ vao,
346
+ vbo,
347
+ texture
348
+ }) => {
349
+ gl.deleteTexture(texture);
350
+ gl.deleteBuffer(vbo);
351
+ gl.deleteProgram(program);
352
+ gl.deleteVertexArray(vao);
353
+ };
354
+
355
+ // src/radial-progressive-pixelate/index.ts
356
+ var { createEffect } = Internals2;
357
+ var DEFAULT_CENTER = [0.5, 0.5];
358
+ var DEFAULT_WIDTH = 1;
359
+ var DEFAULT_HEIGHT = 1;
360
+ var DEFAULT_ROTATION = 0;
361
+ var DEFAULT_START = 0;
362
+ var DEFAULT_START_BLOCK_SIZE = 1;
363
+ var DEFAULT_END_BLOCK_SIZE = 40;
364
+ var radialProgressivePixelateSchema = {
365
+ center: {
366
+ type: "uv-coordinate",
367
+ min: -1,
368
+ max: 2,
369
+ step: 0.01,
370
+ default: DEFAULT_CENTER,
371
+ description: "Center",
372
+ visual: {
373
+ type: "ellipse",
374
+ width: "width",
375
+ height: "height",
376
+ rotation: "rotation",
377
+ innerScale: "start"
378
+ }
379
+ },
380
+ width: {
381
+ type: "number",
382
+ min: 0,
383
+ step: 0.01,
384
+ default: DEFAULT_WIDTH,
385
+ description: "Width",
386
+ hiddenFromList: false
387
+ },
388
+ height: {
389
+ type: "number",
390
+ min: 0,
391
+ step: 0.01,
392
+ default: DEFAULT_HEIGHT,
393
+ description: "Height",
394
+ hiddenFromList: false
395
+ },
396
+ rotation: {
397
+ type: "rotation-degrees",
398
+ step: 1,
399
+ default: DEFAULT_ROTATION,
400
+ description: "Rotation"
401
+ },
402
+ start: {
403
+ type: "number",
404
+ min: 0,
405
+ max: 1,
406
+ step: 0.01,
407
+ default: DEFAULT_START,
408
+ description: "Start",
409
+ hiddenFromList: false
410
+ },
411
+ startBlockSize: {
412
+ type: "number",
413
+ min: 1,
414
+ max: 200,
415
+ step: 1,
416
+ default: DEFAULT_START_BLOCK_SIZE,
417
+ description: "Start block size",
418
+ hiddenFromList: false
419
+ },
420
+ endBlockSize: {
421
+ type: "number",
422
+ min: 1,
423
+ max: 200,
424
+ step: 1,
425
+ default: DEFAULT_END_BLOCK_SIZE,
426
+ description: "End block size",
427
+ hiddenFromList: false
428
+ }
429
+ };
430
+ var resolve = (params) => ({
431
+ center: [
432
+ ...params.center ?? DEFAULT_CENTER
433
+ ],
434
+ width: params.width ?? DEFAULT_WIDTH,
435
+ height: params.height ?? DEFAULT_HEIGHT,
436
+ rotation: params.rotation ?? DEFAULT_ROTATION,
437
+ start: params.start ?? DEFAULT_START,
438
+ startBlockSize: params.startBlockSize ?? DEFAULT_START_BLOCK_SIZE,
439
+ endBlockSize: params.endBlockSize ?? DEFAULT_END_BLOCK_SIZE
440
+ });
441
+ var assertOptionalUvCoordinate = (value, name) => {
442
+ if (value === undefined) {
443
+ return;
444
+ }
445
+ if (!Array.isArray(value) || value.length !== 2 || value.some((item) => typeof item !== "number" || !Number.isFinite(item))) {
446
+ throw new TypeError(`"${name}" must be a [number, number] tuple`);
447
+ }
448
+ };
449
+ var validateBlockSize = (value, name) => {
450
+ if (value < 1) {
451
+ throw new TypeError(`"${name}" must be >= 1`);
452
+ }
453
+ };
454
+ var validateParams = (params) => {
455
+ assertEffectParamsObject(params, "Radial progressive pixelate");
456
+ assertOptionalUvCoordinate(params.center, "center");
457
+ assertOptionalFiniteNumber(params.width, "width");
458
+ assertOptionalFiniteNumber(params.height, "height");
459
+ assertOptionalFiniteNumber(params.rotation, "rotation");
460
+ validateNonNegative(params.width ?? DEFAULT_WIDTH, "width");
461
+ validateNonNegative(params.height ?? DEFAULT_HEIGHT, "height");
462
+ assertOptionalFiniteNumber(params.start, "start");
463
+ validateUnitInterval(params.start ?? DEFAULT_START, "start");
464
+ assertOptionalFiniteNumber(params.startBlockSize, "startBlockSize");
465
+ assertOptionalFiniteNumber(params.endBlockSize, "endBlockSize");
466
+ validateBlockSize(params.startBlockSize ?? DEFAULT_START_BLOCK_SIZE, "startBlockSize");
467
+ validateBlockSize(params.endBlockSize ?? DEFAULT_END_BLOCK_SIZE, "endBlockSize");
468
+ };
469
+ var radialProgressivePixelate = createEffect({
470
+ type: "dev.remotion.effects.radialProgressivePixelate",
471
+ label: "radialProgressivePixelate()",
472
+ documentationLink: "https://www.remotion.dev/docs/effects/radial-progressive-pixelate",
473
+ backend: "webgl2",
474
+ calculateKey: (params) => {
475
+ const r = resolve(params);
476
+ return `radial-progressive-pixelate-${r.center.join(":")}-${r.width}-${r.height}-${r.rotation}-${r.start}-${r.startBlockSize}-${r.endBlockSize}`;
477
+ },
478
+ setup: setupProgressivePixelate,
479
+ apply: ({ source, width, height, params, state, flipSourceY }) => {
480
+ const r = resolve(params);
481
+ prepareProgressivePixelate({
482
+ state,
483
+ source,
484
+ width,
485
+ height,
486
+ flipSourceY
487
+ });
488
+ const { gl, uniforms } = state;
489
+ if (uniforms.uMode)
490
+ gl.uniform1i(uniforms.uMode, 1);
491
+ if (uniforms.uCenter)
492
+ gl.uniform2f(uniforms.uCenter, r.center[0], r.center[1]);
493
+ if (uniforms.uWidth)
494
+ gl.uniform1f(uniforms.uWidth, r.width);
495
+ if (uniforms.uHeight)
496
+ gl.uniform1f(uniforms.uHeight, r.height);
497
+ if (uniforms.uRotation)
498
+ gl.uniform1f(uniforms.uRotation, r.rotation);
499
+ if (uniforms.uRadialStart)
500
+ gl.uniform1f(uniforms.uRadialStart, r.start);
501
+ if (uniforms.uStartBlockSize)
502
+ gl.uniform1f(uniforms.uStartBlockSize, r.startBlockSize);
503
+ if (uniforms.uEndBlockSize)
504
+ gl.uniform1f(uniforms.uEndBlockSize, r.endBlockSize);
505
+ drawProgressivePixelate(state);
506
+ },
507
+ cleanup: cleanupProgressivePixelate,
508
+ schema: radialProgressivePixelateSchema,
509
+ validateParams
510
+ });
511
+ export {
512
+ radialProgressivePixelate
513
+ };
@@ -42,7 +42,8 @@ var scaleSchema = {
42
42
  step: 0.1,
43
43
  default: 1,
44
44
  description: "Factor",
45
- hiddenFromList: false
45
+ hiddenFromList: false,
46
+ defaultKeyframeOutput: "perceptual-scale"
46
47
  },
47
48
  horizontal: {
48
49
  type: "boolean",
@@ -0,0 +1,14 @@
1
+ export type LinearProgressivePixelateUvCoordinate = readonly [number, number];
2
+ export type LinearProgressivePixelateParams = {
3
+ /** UV coordinate where `startBlockSize` is reached. Defaults to `[0, 0.5]`. */
4
+ readonly start?: LinearProgressivePixelateUvCoordinate;
5
+ /** UV coordinate where `endBlockSize` is reached. Defaults to `[1, 0.5]`. */
6
+ readonly end?: LinearProgressivePixelateUvCoordinate;
7
+ /** Pixel block size at `start`. Defaults to `1`. */
8
+ readonly startBlockSize?: number;
9
+ /** Pixel block size at `end`. Defaults to `40`. */
10
+ readonly endBlockSize?: number;
11
+ };
12
+ export declare const linearProgressivePixelate: (params?: (LinearProgressivePixelateParams & {
13
+ readonly disabled?: boolean | undefined;
14
+ }) | undefined) => import("remotion").EffectDescriptor<unknown>;
@@ -0,0 +1 @@
1
+ export { linearProgressivePixelate, type LinearProgressivePixelateParams, type LinearProgressivePixelateUvCoordinate, } from './linear-progressive-pixelate/index.js';
@@ -0,0 +1,32 @@
1
+ export type ProgressivePixelateUniforms = {
2
+ readonly uSource: WebGLUniformLocation | null;
3
+ readonly uResolution: WebGLUniformLocation | null;
4
+ readonly uMode: WebGLUniformLocation | null;
5
+ readonly uStart: WebGLUniformLocation | null;
6
+ readonly uEnd: WebGLUniformLocation | null;
7
+ readonly uCenter: WebGLUniformLocation | null;
8
+ readonly uWidth: WebGLUniformLocation | null;
9
+ readonly uHeight: WebGLUniformLocation | null;
10
+ readonly uRotation: WebGLUniformLocation | null;
11
+ readonly uRadialStart: WebGLUniformLocation | null;
12
+ readonly uStartBlockSize: WebGLUniformLocation | null;
13
+ readonly uEndBlockSize: WebGLUniformLocation | null;
14
+ };
15
+ export type ProgressivePixelateState = {
16
+ readonly gl: WebGL2RenderingContext;
17
+ readonly program: WebGLProgram;
18
+ readonly vao: WebGLVertexArrayObject;
19
+ readonly vbo: WebGLBuffer;
20
+ readonly texture: WebGLTexture;
21
+ readonly uniforms: ProgressivePixelateUniforms;
22
+ };
23
+ export declare const setupProgressivePixelate: (target: HTMLCanvasElement) => ProgressivePixelateState;
24
+ export declare const prepareProgressivePixelate: ({ state, source, width, height, flipSourceY, }: {
25
+ readonly state: ProgressivePixelateState;
26
+ readonly source: CanvasImageSource;
27
+ readonly width: number;
28
+ readonly height: number;
29
+ readonly flipSourceY: boolean;
30
+ }) => void;
31
+ export declare const drawProgressivePixelate: (state: ProgressivePixelateState) => void;
32
+ export declare const cleanupProgressivePixelate: ({ gl, program, vao, vbo, texture, }: ProgressivePixelateState) => void;
@@ -0,0 +1,20 @@
1
+ export type RadialProgressivePixelateUvCoordinate = readonly [number, number];
2
+ export type RadialProgressivePixelateParams = {
3
+ /** UV coordinate at the center of the ellipse. Defaults to `[0.5, 0.5]`. */
4
+ readonly center?: RadialProgressivePixelateUvCoordinate;
5
+ /** Full ellipse width in UV coordinates. Defaults to `1`. */
6
+ readonly width?: number;
7
+ /** Full ellipse height in UV coordinates. Defaults to `1`. */
8
+ readonly height?: number;
9
+ /** Ellipse rotation in degrees. Defaults to `0`. */
10
+ readonly rotation?: number;
11
+ /** Normalized ellipse progress where interpolation starts. Defaults to `0`. */
12
+ readonly start?: number;
13
+ /** Pixel block size at `start`. Defaults to `1`. */
14
+ readonly startBlockSize?: number;
15
+ /** Pixel block size at the outer ellipse. Defaults to `40`. */
16
+ readonly endBlockSize?: number;
17
+ };
18
+ export declare const radialProgressivePixelate: (params?: (RadialProgressivePixelateParams & {
19
+ readonly disabled?: boolean | undefined;
20
+ }) | undefined) => import("remotion").EffectDescriptor<unknown>;
@@ -0,0 +1 @@
1
+ export { radialProgressivePixelate, type RadialProgressivePixelateParams, type RadialProgressivePixelateUvCoordinate, } from './radial-progressive-pixelate/index.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/effects",
3
- "version": "4.0.488",
3
+ "version": "4.0.490",
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.488"
29
+ "remotion": "4.0.490"
30
30
  },
31
31
  "exports": {
32
32
  ".": {
@@ -174,6 +174,11 @@
174
174
  "module": "./dist/esm/linear-progressive-blur.mjs",
175
175
  "import": "./dist/esm/linear-progressive-blur.mjs"
176
176
  },
177
+ "./linear-progressive-pixelate": {
178
+ "types": "./dist/linear-progressive-pixelate.d.ts",
179
+ "module": "./dist/esm/linear-progressive-pixelate.mjs",
180
+ "import": "./dist/esm/linear-progressive-pixelate.mjs"
181
+ },
177
182
  "./light-trail": {
178
183
  "types": "./dist/light-trail.d.ts",
179
184
  "module": "./dist/esm/light-trail.mjs",
@@ -219,6 +224,11 @@
219
224
  "module": "./dist/esm/radial-progressive-blur.mjs",
220
225
  "import": "./dist/esm/radial-progressive-blur.mjs"
221
226
  },
227
+ "./radial-progressive-pixelate": {
228
+ "types": "./dist/radial-progressive-pixelate.d.ts",
229
+ "module": "./dist/esm/radial-progressive-pixelate.mjs",
230
+ "import": "./dist/esm/radial-progressive-pixelate.mjs"
231
+ },
222
232
  "./rings": {
223
233
  "types": "./dist/rings.d.ts",
224
234
  "module": "./dist/esm/rings.mjs",
@@ -397,6 +407,9 @@
397
407
  "linear-progressive-blur": [
398
408
  "dist/linear-progressive-blur.d.ts"
399
409
  ],
410
+ "linear-progressive-pixelate": [
411
+ "dist/linear-progressive-pixelate.d.ts"
412
+ ],
400
413
  "light-trail": [
401
414
  "dist/light-trail.d.ts"
402
415
  ],
@@ -424,6 +437,9 @@
424
437
  "radial-progressive-blur": [
425
438
  "dist/radial-progressive-blur.d.ts"
426
439
  ],
440
+ "radial-progressive-pixelate": [
441
+ "dist/radial-progressive-pixelate.d.ts"
442
+ ],
427
443
  "rings": [
428
444
  "dist/rings.d.ts"
429
445
  ],
@@ -482,7 +498,7 @@
482
498
  },
483
499
  "homepage": "https://www.remotion.dev/docs/effects/api",
484
500
  "devDependencies": {
485
- "@remotion/eslint-config-internal": "4.0.488",
501
+ "@remotion/eslint-config-internal": "4.0.490",
486
502
  "@vitest/browser-playwright": "4.0.9",
487
503
  "eslint": "9.19.0",
488
504
  "vitest": "4.0.9",
@@ -1,8 +0,0 @@
1
- export declare const EffectInternals: {
2
- readonly halftone: (params?: (import("./halftone.js").HalftoneParams & {
3
- readonly disabled?: boolean | undefined;
4
- }) | undefined) => import("remotion").EffectDescriptor<unknown>;
5
- readonly tint: (params: import("./tint.js").TintParams & {
6
- readonly disabled?: boolean | undefined;
7
- }) => import("remotion").EffectDescriptor<unknown>;
8
- };
@@ -1,6 +0,0 @@
1
- import * as blurExports from '../blur/index.js';
2
- export type { BlurParams } from '../blur/index.js';
3
- declare const blur: (params: blurExports.BlurParams & {
4
- readonly disabled?: boolean | undefined;
5
- }) => import("remotion").EffectDescriptor<unknown>;
6
- export { blur };