@clypra-studio/engine 1.0.0 → 1.0.1
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/{TransitionDefinition-CC6oSTYB.d.cts → TransitionDefinition-CQoSb4ZB.d.cts} +9 -9
- package/dist/{TransitionDefinition-CC6oSTYB.d.ts → TransitionDefinition-CQoSb4ZB.d.ts} +9 -9
- package/dist/{chunk-LGW5SSLZ.js → chunk-2VGI6ZB7.js} +2 -7
- package/dist/chunk-2VGI6ZB7.js.map +1 -0
- package/dist/{chunk-AUMNXFYQ.js → chunk-4PKBLJ34.js} +1 -1
- package/dist/chunk-4PKBLJ34.js.map +1 -0
- package/dist/{chunk-4Y7ZSGHJ.js → chunk-FIJBB3MH.js} +1 -1
- package/dist/chunk-FIJBB3MH.js.map +1 -0
- package/dist/{index-BP1N8Yg7.d.cts → index-Da47I6aX.d.cts} +3 -3
- package/dist/{index-BP1N8Yg7.d.ts → index-Da47I6aX.d.ts} +3 -3
- package/dist/index.cjs +28 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +69 -45
- package/dist/index.js.map +1 -1
- package/dist/transitions/index.cjs.map +1 -1
- package/dist/transitions/index.d.cts +5 -5
- package/dist/transitions/index.d.ts +5 -5
- package/dist/transitions/index.js +1 -1
- package/dist/v2/backends/index.cjs.map +1 -1
- package/dist/v2/backends/index.d.cts +1 -1
- package/dist/v2/backends/index.d.ts +1 -1
- package/dist/v2/backends/index.js +1 -1
- package/dist/v2/contract/index.d.cts +12 -12
- package/dist/v2/contract/index.d.ts +12 -12
- package/dist/videoEffects/index.cjs +1 -6
- package/dist/videoEffects/index.cjs.map +1 -1
- package/dist/videoEffects/index.d.cts +5 -6
- package/dist/videoEffects/index.d.ts +5 -6
- package/dist/videoEffects/index.js +1 -1
- package/package.json +12 -12
- package/LICENSE +0 -9
- package/dist/chunk-4Y7ZSGHJ.js.map +0 -1
- package/dist/chunk-AUMNXFYQ.js.map +0 -1
- package/dist/chunk-LGW5SSLZ.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as TransitionDefinition } from '../TransitionDefinition-
|
|
1
|
+
import { i as TransitionDefinition } from '../TransitionDefinition-CQoSb4ZB.cjs';
|
|
2
2
|
import 'pixi.js';
|
|
3
3
|
|
|
4
4
|
declare const PushTransition: TransitionDefinition;
|
|
@@ -54,7 +54,7 @@ declare function getTransitionEffect(id: string): TransitionDefinition;
|
|
|
54
54
|
* Transition Types
|
|
55
55
|
* Type definitions for transition effects between video clips
|
|
56
56
|
*
|
|
57
|
-
* Part of @clypra/engine - shared between clypra-studio and clypra app
|
|
57
|
+
* Part of @clypra-studio/engine - shared between clypra-studio and clypra app
|
|
58
58
|
*/
|
|
59
59
|
type TransitionRenderer$1 = "fade" | "dissolve" | "cut" | "canvas" | "zoom_in" | "zoom_out" | "zoom_blur" | "slide_left" | "slide_right" | "slide_up" | "slide_down" | "wipe_left" | "wipe_right" | "wipe_up" | "wipe_down" | "wipe_clockwise" | "wipe_center" | "circle_expand" | "circle_collapse" | "diamond_expand" | "rectangle_expand" | "blur_fade" | "directional_blur" | "glitch" | "rgb_split" | "chromatic" | "film_burn" | "light_leak" | "whip_pan";
|
|
60
60
|
type EasingFunction = "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out" | "ease-in-quad" | "ease-out-quad" | "ease-in-out-quad" | "ease-in-cubic" | "ease-out-cubic" | "ease-in-out-cubic" | "ease-in-quart" | "ease-out-quart" | "ease-in-out-quart" | "spring" | "bounce";
|
|
@@ -108,7 +108,7 @@ interface AppliedTransition {
|
|
|
108
108
|
* - zoom_in: Scale up during fade
|
|
109
109
|
* - wipe_left: Reveal next frame from left
|
|
110
110
|
*
|
|
111
|
-
* Part of @clypra/engine - shared between clypra-studio and clypra app
|
|
111
|
+
* Part of @clypra-studio/engine - shared between clypra-studio and clypra app
|
|
112
112
|
*/
|
|
113
113
|
|
|
114
114
|
declare class TransitionRenderer {
|
|
@@ -162,7 +162,7 @@ declare class TransitionRenderer {
|
|
|
162
162
|
* Transition Presets
|
|
163
163
|
* Professional transition definitions mapped to TransitionRenderer types
|
|
164
164
|
*
|
|
165
|
-
* Part of @clypra/engine - shared between clypra-studio and clypra app
|
|
165
|
+
* Part of @clypra-studio/engine - shared between clypra-studio and clypra app
|
|
166
166
|
*/
|
|
167
167
|
|
|
168
168
|
declare const TRANSITION_CATEGORIES: TransitionCategory[];
|
|
@@ -172,7 +172,7 @@ declare const TRANSITION_PRESETS: TransitionPreset[];
|
|
|
172
172
|
* Transition Helpers
|
|
173
173
|
* Utility functions for working with transition presets
|
|
174
174
|
*
|
|
175
|
-
* Part of @clypra/engine - shared between clypra-studio and clypra app
|
|
175
|
+
* Part of @clypra-studio/engine - shared between clypra-studio and clypra app
|
|
176
176
|
*/
|
|
177
177
|
|
|
178
178
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as TransitionDefinition } from '../TransitionDefinition-
|
|
1
|
+
import { i as TransitionDefinition } from '../TransitionDefinition-CQoSb4ZB.js';
|
|
2
2
|
import 'pixi.js';
|
|
3
3
|
|
|
4
4
|
declare const PushTransition: TransitionDefinition;
|
|
@@ -54,7 +54,7 @@ declare function getTransitionEffect(id: string): TransitionDefinition;
|
|
|
54
54
|
* Transition Types
|
|
55
55
|
* Type definitions for transition effects between video clips
|
|
56
56
|
*
|
|
57
|
-
* Part of @clypra/engine - shared between clypra-studio and clypra app
|
|
57
|
+
* Part of @clypra-studio/engine - shared between clypra-studio and clypra app
|
|
58
58
|
*/
|
|
59
59
|
type TransitionRenderer$1 = "fade" | "dissolve" | "cut" | "canvas" | "zoom_in" | "zoom_out" | "zoom_blur" | "slide_left" | "slide_right" | "slide_up" | "slide_down" | "wipe_left" | "wipe_right" | "wipe_up" | "wipe_down" | "wipe_clockwise" | "wipe_center" | "circle_expand" | "circle_collapse" | "diamond_expand" | "rectangle_expand" | "blur_fade" | "directional_blur" | "glitch" | "rgb_split" | "chromatic" | "film_burn" | "light_leak" | "whip_pan";
|
|
60
60
|
type EasingFunction = "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out" | "ease-in-quad" | "ease-out-quad" | "ease-in-out-quad" | "ease-in-cubic" | "ease-out-cubic" | "ease-in-out-cubic" | "ease-in-quart" | "ease-out-quart" | "ease-in-out-quart" | "spring" | "bounce";
|
|
@@ -108,7 +108,7 @@ interface AppliedTransition {
|
|
|
108
108
|
* - zoom_in: Scale up during fade
|
|
109
109
|
* - wipe_left: Reveal next frame from left
|
|
110
110
|
*
|
|
111
|
-
* Part of @clypra/engine - shared between clypra-studio and clypra app
|
|
111
|
+
* Part of @clypra-studio/engine - shared between clypra-studio and clypra app
|
|
112
112
|
*/
|
|
113
113
|
|
|
114
114
|
declare class TransitionRenderer {
|
|
@@ -162,7 +162,7 @@ declare class TransitionRenderer {
|
|
|
162
162
|
* Transition Presets
|
|
163
163
|
* Professional transition definitions mapped to TransitionRenderer types
|
|
164
164
|
*
|
|
165
|
-
* Part of @clypra/engine - shared between clypra-studio and clypra app
|
|
165
|
+
* Part of @clypra-studio/engine - shared between clypra-studio and clypra app
|
|
166
166
|
*/
|
|
167
167
|
|
|
168
168
|
declare const TRANSITION_CATEGORIES: TransitionCategory[];
|
|
@@ -172,7 +172,7 @@ declare const TRANSITION_PRESETS: TransitionPreset[];
|
|
|
172
172
|
* Transition Helpers
|
|
173
173
|
* Utility functions for working with transition presets
|
|
174
174
|
*
|
|
175
|
-
* Part of @clypra/engine - shared between clypra-studio and clypra app
|
|
175
|
+
* Part of @clypra-studio/engine - shared between clypra-studio and clypra app
|
|
176
176
|
*/
|
|
177
177
|
|
|
178
178
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/v2/backends/index.ts","../../../src/v2/backends/PixiRenderBackend.ts","../../../src/effects/light/ColorAdjustmentsEffect.ts","../../../src/v2/backends/colorAdjustmentsFilter.ts"],"sourcesContent":["/**\n * @deprecated Use @clypra/runtime/renderer instead\n * ```ts\n * import { PixiRenderer } from \"@clypra/runtime/renderer\";\n * ```\n * This file will be removed in v3.0.0\n */\nexport { PixiRenderBackend } from \"./PixiRenderBackend.js\";\n","/**\n * @clypra/engine — Pipeline V2: Pixi Render Backend\n *\n * @deprecated Use @clypra/runtime/renderer instead\n * The runtime version (PixiRenderer) is more complete with better resource management.\n * This file will be removed in v3.0.0\n *\n * RenderBackend implementation using Pixi.js for GPU pass execution.\n */\n\nimport * as PIXI from \"pixi.js\";\nimport { AdjustmentFilter } from \"pixi-filters\";\nimport type { RenderBackend, CommandBuffer } from \"../runtime/types\";\nimport type { RenderPass } from \"../planner/types\";\nimport { createColorAdjustmentsFilter, updateColorAdjustmentsFilter, normalizeColorAdjustmentsUniforms } from \"./colorAdjustmentsFilter.js\";\n\nexport class PixiRenderBackend implements RenderBackend {\n private app: PIXI.Application | null = null;\n private initialized = false;\n private resources = new Map<string, PIXI.Texture>();\n private filters = new Map<string, PIXI.Filter>();\n private canvasElement?: HTMLCanvasElement;\n\n async init(canvasElement?: HTMLCanvasElement, width?: number, height?: number): Promise<void> {\n if (this.initialized) {\n throw new Error(\"PixiRenderBackend already initialized\");\n }\n\n this.canvasElement = canvasElement;\n\n const logicalWidth = width ?? canvasElement?.clientWidth ?? canvasElement?.width ?? 1920;\n const logicalHeight = height ?? canvasElement?.clientHeight ?? canvasElement?.height ?? 1080;\n\n this.app = new PIXI.Application();\n await this.app.init({\n canvas: canvasElement,\n width: logicalWidth,\n height: logicalHeight,\n backgroundColor: 0x0e0e12,\n antialias: true,\n preference: \"webgl\",\n resolution: typeof window !== \"undefined\" ? window.devicePixelRatio || 1 : 1,\n autoDensity: true,\n preserveDrawingBuffer: true,\n });\n\n this.initialized = true;\n }\n\n resize(width: number, height: number): void {\n if (!this.app) return;\n this.app.renderer.resize(width, height);\n }\n\n get logicalWidth(): number {\n return this.app?.renderer.width ?? 0;\n }\n\n get logicalHeight(): number {\n return this.app?.renderer.height ?? 0;\n }\n\n allocateResource(id: string, _type: \"texture\" | \"buffer\", width: number, height: number, _format: string): void {\n if (!this.initialized || !this.app) {\n throw new Error(\"PixiRenderBackend not initialized\");\n }\n if (this.resources.has(id)) {\n throw new Error(`Resource \"${id}\" already allocated`);\n }\n this.resources.set(id, PIXI.RenderTexture.create({ width, height }));\n }\n\n releaseResource(id: string): void {\n if (!this.initialized) {\n throw new Error(\"PixiRenderBackend not initialized\");\n }\n const texture = this.resources.get(id);\n if (!texture) {\n throw new Error(`Resource \"${id}\" not found for release`);\n }\n texture.destroy(true);\n this.resources.delete(id);\n }\n\n compileShader(shaderId: string, _sourceGLSLOrWGSL: string): void {\n if (!this.initialized) {\n throw new Error(\"PixiRenderBackend not initialized\");\n }\n\n if (this.filters.has(shaderId)) return;\n\n let filter: PIXI.Filter;\n switch (shaderId) {\n case \"brightness\":\n filter = new AdjustmentFilter({ brightness: 1.0 });\n break;\n case \"contrast\":\n filter = new AdjustmentFilter({ contrast: 1.0 });\n break;\n case \"gaussian-blur-h\":\n case \"gaussian-blur-v\":\n filter = new PIXI.BlurFilter({ strength: 8, quality: 4 });\n break;\n case \"copy\":\n case \"blit-source\":\n filter = new AdjustmentFilter({ brightness: 1, contrast: 1, saturation: 1 });\n break;\n case \"color-adjustments\":\n // Per-pass instances are created in executePass; no shared cached filter.\n return;\n default:\n filter = new AdjustmentFilter({});\n }\n\n this.filters.set(shaderId, filter);\n }\n\n async submit(commandBuffer: CommandBuffer): Promise<void> {\n if (!this.initialized || !this.app) {\n throw new Error(\"PixiRenderBackend not initialized\");\n }\n\n for (const { pass } of commandBuffer.passes) {\n await this.executePass(pass);\n }\n }\n\n private async executePass(pass: RenderPass): Promise<void> {\n if (!this.app) return;\n\n const inputTexture = pass.inputs.length > 0 ? this.resources.get(pass.inputs[0]) : null;\n const outputTexture = this.resources.get(pass.output);\n if (!outputTexture) {\n throw new Error(`Output resource not found: ${pass.output}`);\n }\n\n if (pass.shaderId === \"copy\" || pass.shaderId === \"blit-source\") {\n if (inputTexture) {\n this.blitTexture(inputTexture, outputTexture as PIXI.RenderTexture);\n }\n return;\n }\n\n if (!inputTexture) return;\n\n const target = outputTexture as PIXI.RenderTexture;\n const sprite = new PIXI.Sprite(inputTexture);\n sprite.width = target.width;\n sprite.height = target.height;\n\n let filter: PIXI.Filter | PIXI.Filter[];\n let disposeFilter = false;\n\n if (pass.shaderId === \"color-adjustments\") {\n filter = createColorAdjustmentsFilter(normalizeColorAdjustmentsUniforms(pass.uniforms));\n disposeFilter = true;\n } else {\n if (!this.filters.has(pass.shaderId)) {\n this.compileShader(pass.shaderId, \"\");\n }\n const cachedFilter = this.filters.get(pass.shaderId);\n if (!cachedFilter) {\n throw new Error(`Filter not compiled for shader: ${pass.shaderId}`);\n }\n filter = cachedFilter;\n this.applyUniforms(cachedFilter, pass.uniforms, pass.shaderId);\n }\n\n const filterArray = Array.isArray(filter) ? filter : [filter];\n sprite.filters = filterArray;\n this.app.renderer.render({ container: sprite, target, clear: true });\n sprite.filters = null;\n\n if (disposeFilter) {\n if (Array.isArray(filter)) {\n filter.forEach((f) => f.destroy());\n } else {\n filter.destroy();\n }\n }\n }\n\n private applyUniforms(filter: PIXI.Filter, uniforms: Readonly<Record<string, unknown>>, shaderId?: string): void {\n if (shaderId === \"color-adjustments\") {\n updateColorAdjustmentsFilter(filter, normalizeColorAdjustmentsUniforms(uniforms));\n return;\n }\n if (filter instanceof AdjustmentFilter) {\n if (uniforms.brightness !== undefined) {\n filter.brightness = 1.0 + Number(uniforms.brightness);\n }\n if (uniforms.contrast !== undefined) {\n filter.contrast = 1.0 + Number(uniforms.contrast);\n }\n } else if (filter instanceof PIXI.BlurFilter && uniforms.uBlurStrength !== undefined) {\n filter.strength = Number(uniforms.uBlurStrength);\n }\n }\n\n private blitTexture(source: PIXI.Texture, target: PIXI.RenderTexture): void {\n if (!this.app) return;\n const sprite = new PIXI.Sprite(source);\n this.app.renderer.render({ container: sprite, target });\n }\n\n /** Upload a source image into track/source render textures (contain-fit). */\n uploadSourceImage(sourceImage: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, resourceIds: readonly string[]): void {\n if (!this.app) return;\n\n const sourceTexture = PIXI.Texture.from(sourceImage);\n for (const resourceId of resourceIds) {\n const texture = this.resources.get(resourceId);\n if (!texture) continue;\n\n const blitSprite = new PIXI.Sprite(sourceTexture);\n const fitScale = Math.min(texture.width / sourceTexture.width, texture.height / sourceTexture.height);\n blitSprite.scale.set(fitScale);\n blitSprite.position.set((texture.width - sourceTexture.width * fitScale) / 2, (texture.height - sourceTexture.height * fitScale) / 2);\n this.app.renderer.render({ container: blitSprite, target: texture as PIXI.RenderTexture });\n }\n }\n\n /** Present a resource texture to the canvas screen. */\n present(resourceId: string): void {\n if (!this.app) return;\n const texture = this.resources.get(resourceId);\n if (!texture) return;\n\n const screenW = this.app.renderer.screen.width;\n const screenH = this.app.renderer.screen.height;\n const scale = Math.min(screenW / texture.width, screenH / texture.height);\n const sprite = new PIXI.Sprite(texture);\n sprite.scale.set(scale);\n sprite.position.set((screenW - texture.width * scale) / 2, (screenH - texture.height * scale) / 2);\n\n this.app.stage.removeChildren();\n this.app.stage.addChild(sprite);\n this.app.renderer.render(this.app.stage);\n }\n\n getResource(id: string): PIXI.Texture | undefined {\n return this.resources.get(id);\n }\n\n async readPixels(resourceId: string): Promise<Uint8Array> {\n if (!this.initialized || !this.app) {\n throw new Error(\"PixiRenderBackend not initialized\");\n }\n const texture = this.resources.get(resourceId);\n if (!texture) {\n throw new Error(`Resource \"${resourceId}\" not found for readPixels`);\n }\n const pixels = this.app.renderer.extract.pixels(texture);\n return new Uint8Array(pixels.pixels);\n }\n\n clearResources(): void {\n for (const id of [...this.resources.keys()]) {\n this.releaseResource(id);\n }\n }\n\n destroy(): void {\n if (!this.initialized) return;\n\n for (const texture of this.resources.values()) {\n texture.destroy(true);\n }\n this.resources.clear();\n\n for (const filter of this.filters.values()) {\n filter.destroy();\n }\n this.filters.clear();\n\n if (this.app) {\n this.app.destroy(true);\n this.app = null;\n }\n\n this.initialized = false;\n this.canvasElement = undefined;\n }\n}\n","import { Filter } from 'pixi.js'\nimport type { PixiEffectDefinition, ParamValues } from '../../videoEffects/EffectDefinition'\n\n/** Pixi v8 default filter vertex — required for correct render-to-texture in MPG. */\nconst ADJUSTMENTS_VERTEX_SHADER = `\n in vec2 aPosition;\n out vec2 vTextureCoord;\n\n uniform vec4 uInputSize;\n uniform vec4 uOutputFrame;\n uniform vec4 uOutputTexture;\n\n vec4 filterVertexPosition( void )\n {\n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;\n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0 * uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;\n return vec4(position, 0.0, 1.0);\n }\n\n vec2 filterTextureCoord( void )\n {\n return aPosition * (uOutputFrame.zw * uInputSize.zw);\n }\n\n void main(void)\n {\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n }\n`;\n\nconst ADJUSTMENTS_FRAGMENT_SHADER = `\n in vec2 vTextureCoord;\n out vec4 finalColor;\n\n uniform sampler2D uTexture;\n\n // ── Existing uniforms ─────────────────────────────────────────────────────\n uniform float uExposure; // -1.0 to 1.0\n uniform float uBrightness; // -1.0 to 1.0\n uniform float uContrast; // -1.0 to 1.0\n uniform float uSaturation; // -1.0 to 1.0\n uniform vec3 uTemperatureColor; // warm or cool color\n uniform float uTemperatureWeight; // 0.0 to 1.0\n uniform vec3 uTintColor; // magenta or green color\n uniform float uTintWeight; // 0.0 to 1.0\n uniform float uSepia; // 0.0 to 1.0\n uniform float uGrayscale; // 0.0 to 1.0\n uniform float uHueRotate; // radians\n uniform float uVignette; // 0.0 to 1.0\n uniform float uInvert; // 0.0 to 1.0\n\n // ── NEW: Lift ─────────────────────────────────────────────────────────────\n uniform float uLift; // -0.2 to 0.2; positive = faded/matte, negative = crushed\n\n // ── NEW: Split-toning ─────────────────────────────────────────────────────\n uniform vec3 uShadowTint; // multiplicative color for shadows (neutral = vec3(1))\n uniform float uShadowTintStrength;\n uniform vec3 uHighlightTint; // multiplicative color for highlights (neutral = vec3(1))\n uniform float uHighlightTintStrength;\n uniform float uSplitBalance; // 0.0-1.0, luma split point\n\n // ── NEW: Film grain ───────────────────────────────────────────────────────\n uniform float uGrainIntensity; // 0.0 to 0.5\n uniform float uGrainSize; // 0.1 to 5.0\n uniform float uTime; // animated, incremented each frame\n\n // ── NEW: Channel-mix B&W ──────────────────────────────────────────────────\n uniform vec3 uChannelMix; // R/G/B weights summing to ~1.0\n uniform float uUseChannelMix; // 1.0 = active, 0.0 = off\n\n // ── NEW: Duotone ──────────────────────────────────────────────────────────\n uniform vec3 uDuotoneDark; // color mapped to black/dark tones\n uniform vec3 uDuotoneLight; // color mapped to white/light tones\n uniform float uUseDuotone; // 1.0 = active, 0.0 = off\n\n // ── NEW: Vibrance ─────────────────────────────────────────────────────────\n uniform float uVibranceAmount; // -1.0 to 1.0\n uniform vec3 uVibranceProtectedHue; // reference color for skin-tone protection\n\n // ── NEW: Cross-process ────────────────────────────────────────────────────\n uniform float uCrossProcessAmount; // 0.0 to 1.0\n\n // ── Helper functions ──────────────────────────────────────────────────────\n vec3 hueRotateColor(vec3 color, float angle) {\n vec3 k = vec3(0.57735, 0.57735, 0.57735);\n float c = cos(angle);\n return color * c + cross(k, color) * sin(angle) + k * dot(k, color) * (1.0 - c);\n }\n\n vec3 rgb2hsv(vec3 c) {\n vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));\n vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));\n float d = q.x - min(q.w, q.y);\n float e = 1.0e-10;\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);\n }\n\n vec3 hsv2rgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n }\n\n void main() {\n vec4 texColor = texture(uTexture, vTextureCoord);\n vec3 rgb = texColor.rgb;\n\n // Invert\n rgb = mix(rgb, 1.0 - rgb, uInvert);\n\n // Exposure\n rgb = rgb * pow(2.0, uExposure);\n\n // Brightness\n rgb = rgb + uBrightness;\n\n // Lift — shift black point; applied before contrast so it interacts correctly with tonal range\n if (uLift != 0.0) {\n rgb = rgb + uLift * (1.0 - rgb);\n }\n\n // Contrast\n rgb = (rgb - 0.5) * (1.0 + uContrast) + 0.5;\n\n // Saturation (flat, distinct from vibrance)\n float luma = dot(rgb, vec3(0.2126, 0.7152, 0.0722));\n rgb = mix(vec3(luma), rgb, 1.0 + uSaturation);\n\n // Grayscale\n float lumaG = dot(rgb, vec3(0.2126, 0.7152, 0.0722));\n rgb = mix(rgb, vec3(lumaG), uGrayscale);\n\n // Sepia\n if (uSepia > 0.0) {\n vec3 sep = vec3(\n dot(rgb, vec3(0.393, 0.769, 0.189)),\n dot(rgb, vec3(0.349, 0.686, 0.168)),\n dot(rgb, vec3(0.272, 0.534, 0.131))\n );\n rgb = mix(rgb, sep, uSepia);\n }\n\n // Hue Rotate\n if (uHueRotate != 0.0) {\n rgb = hueRotateColor(rgb, uHueRotate);\n }\n\n // Temperature — soft-light blend\n if (uTemperatureWeight > 0.0) {\n vec3 t = uTemperatureColor;\n rgb = mix(rgb, (1.0 - 2.0 * t) * rgb * rgb + 2.0 * t * rgb, uTemperatureWeight);\n }\n\n // Tint — soft-light blend\n if (uTintWeight > 0.0) {\n vec3 t = uTintColor;\n rgb = mix(rgb, (1.0 - 2.0 * t) * rgb * rgb + 2.0 * t * rgb, uTintWeight);\n }\n\n // ── NEW: Channel-mixed B&W ─────────────────────────────────────────────\n // Applied before duotone; mutually exclusive (both produce mono, duotone adds color back)\n if (uUseChannelMix > 0.5) {\n float mono = dot(rgb, uChannelMix);\n rgb = vec3(mono);\n }\n\n // ── NEW: Duotone ───────────────────────────────────────────────────────\n // Maps current luminance to a 2-color gradient; applied after channel-mix for correct mono base\n if (uUseDuotone > 0.5) {\n float duoLuma = dot(rgb, vec3(0.299, 0.587, 0.114));\n rgb = mix(uDuotoneDark, uDuotoneLight, duoLuma);\n }\n\n // ── NEW: Split-toning ──────────────────────────────────────────────────\n if (uShadowTintStrength > 0.0 || uHighlightTintStrength > 0.0) {\n float splitLuma = dot(rgb, vec3(0.299, 0.587, 0.114));\n float shadowW = 1.0 - smoothstep(0.0, uSplitBalance, splitLuma);\n float highlightW = smoothstep(uSplitBalance, 1.0, splitLuma);\n rgb = mix(rgb, rgb * uShadowTint, shadowW * uShadowTintStrength);\n rgb = mix(rgb, rgb * uHighlightTint, highlightW * uHighlightTintStrength);\n }\n\n // ── NEW: Vibrance — hue-selective saturation ───────────────────────────\n // Skipped when channel-mix or duotone have flattened color information\n if (uVibranceAmount != 0.0 && uUseChannelMix < 0.5 && uUseDuotone < 0.5) {\n vec3 hsv = rgb2hsv(clamp(rgb, 0.0, 1.0));\n vec3 protHSV = rgb2hsv(uVibranceProtectedHue);\n float hueDist = abs(hsv.x - protHSV.x);\n hueDist = min(hueDist, 1.0 - hueDist); // wrap hue distance\n float protection = smoothstep(0.0, 0.15, hueDist);\n hsv.y = clamp(hsv.y + uVibranceAmount * protection, 0.0, 1.0);\n rgb = hsv2rgb(hsv);\n }\n\n // ── NEW: Cross-process — channel curve swap ────────────────────────────\n if (uCrossProcessAmount > 0.0) {\n float origR = rgb.r;\n float origB = rgb.b;\n rgb.r = mix(rgb.r, pow(max(origB, 0.001), 0.8), uCrossProcessAmount);\n rgb.b = mix(rgb.b, pow(max(origR, 0.001), 1.2), uCrossProcessAmount);\n }\n\n // ── NEW: Film grain — last before vignette ────────────────────────────\n if (uGrainIntensity > 0.0) {\n float grain = fract(sin(dot(vTextureCoord * uGrainSize + uTime, vec2(12.9898, 78.233))) * 43758.5453);\n rgb += (grain - 0.5) * uGrainIntensity;\n }\n\n // Vignette\n vec2 uv = vTextureCoord - 0.5;\n float vignetteVal = smoothstep(0.45, 1.0, length(uv));\n rgb = mix(rgb, vec3(0.0), vignetteVal * uVignette);\n\n finalColor = vec4(rgb, texColor.a);\n }\n`;\n\n/** Convert a hex color string (#RRGGBB) to a normalized [r, g, b] array. */\nexport function hexToRgb(hex: string): [number, number, number] {\n const clean = hex.replace('#', '').padEnd(6, '0')\n const r = parseInt(clean.substring(0, 2), 16) / 255\n const g = parseInt(clean.substring(2, 4), 16) / 255\n const b = parseInt(clean.substring(4, 6), 16) / 255\n return [isNaN(r) ? 1 : r, isNaN(g) ? 1 : g, isNaN(b) ? 1 : b]\n}\n\nexport const ColorAdjustmentsEffect: PixiEffectDefinition = {\n backend: 'pixi',\n subtype: 'filter',\n id: 'color-adjustments',\n name: 'Color Adjustments',\n category: 'light',\n description: 'Adjust exposure, brightness, contrast, saturation, temperature, tint, sepia, grayscale, hue, invert, vignette, lift, split-toning, grain, channel-mix, duotone, vibrance, and cross-process.',\n tags: ['color', 'adjustments', 'brightness', 'contrast', 'saturation', 'temperature', 'tint', 'vignette', 'grain', 'duotone', 'vibrance'],\n thumbnail: '',\n params: [\n // ── Existing ───────────────────────────────────────────────────────────\n { key: 'exposure', label: 'Exposure', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'brightness', label: 'Brightness', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'contrast', label: 'Contrast', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'saturation', label: 'Saturation', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'temperature', label: 'Temperature', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'tint', label: 'Tint', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'sepia', label: 'Sepia', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'grayscale', label: 'Grayscale', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'hueRotate', label: 'Hue Rotate', type: 'range', value: 0.0, min: 0.0, max: 6.28318, step: 0.01 },\n { key: 'vignette', label: 'Vignette', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'invert', label: 'Invert', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n // ── NEW ────────────────────────────────────────────────────────────────\n { key: 'lift', label: 'Lift', type: 'range', value: 0.0, min: -0.5, max: 0.5, step: 0.01 },\n { key: 'shadowTintR', label: 'Shadow Tint R', type: 'range', value: 1.0, min: 0.0, max: 2.0, step: 0.01 },\n { key: 'shadowTintG', label: 'Shadow Tint G', type: 'range', value: 1.0, min: 0.0, max: 2.0, step: 0.01 },\n { key: 'shadowTintB', label: 'Shadow Tint B', type: 'range', value: 1.0, min: 0.0, max: 2.0, step: 0.01 },\n { key: 'shadowTintStrength', label: 'Shadow Strength', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'highlightTintR', label: 'Hi Tint R', type: 'range', value: 1.0, min: 0.0, max: 2.0, step: 0.01 },\n { key: 'highlightTintG', label: 'Hi Tint G', type: 'range', value: 1.0, min: 0.0, max: 2.0, step: 0.01 },\n { key: 'highlightTintB', label: 'Hi Tint B', type: 'range', value: 1.0, min: 0.0, max: 2.0, step: 0.01 },\n { key: 'highlightTintStrength', label: 'Hi Strength', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'splitBalance', label: 'Split Balance', type: 'range', value: 0.5, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'grainIntensity', label: 'Grain Intensity', type: 'range', value: 0.0, min: 0.0, max: 0.5, step: 0.01 },\n { key: 'grainSize', label: 'Grain Size', type: 'range', value: 1.0, min: 0.1, max: 5.0, step: 0.1 },\n { key: 'channelMixR', label: 'Channel Mix R', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'channelMixG', label: 'Channel Mix G', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'channelMixB', label: 'Channel Mix B', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'useChannelMix', label: 'Use Channel Mix', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 1.0 },\n { key: 'duotoneDarkR', label: 'Duo Dark R', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'duotoneDarkG', label: 'Duo Dark G', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'duotoneDarkB', label: 'Duo Dark B', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'duotoneLightR', label: 'Duo Light R', type: 'range', value: 1.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'duotoneLightG', label: 'Duo Light G', type: 'range', value: 1.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'duotoneLightB', label: 'Duo Light B', type: 'range', value: 1.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'useDuotone', label: 'Use Duotone', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 1.0 },\n { key: 'vibranceAmount', label: 'Vibrance', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'vibranceProtectedHueR', label: 'Vib Protect R', type: 'range', value: 0.91, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'vibranceProtectedHueG', label: 'Vib Protect G', type: 'range', value: 0.69, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'vibranceProtectedHueB', label: 'Vib Protect B', type: 'range', value: 0.55, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'crossProcessAmount', label: 'Cross Process', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n ],\n filterSpec: {\n create(params: ParamValues): Filter {\n const temperature = params.temperature as number || 0.0\n const tempWeight = Math.abs(temperature)\n const tempColor = temperature > 0.0 ? [1.0, 0.55, 0.16] : [0.16, 0.47, 1.0]\n const tint = params.tint as number || 0.0\n const tintWeight = Math.abs(tint)\n const tintColor = tint > 0.0 ? [1.0, 0.16, 0.71] : [0.16, 1.0, 0.39]\n\n return Filter.from({\n gl: { vertex: ADJUSTMENTS_VERTEX_SHADER, fragment: ADJUSTMENTS_FRAGMENT_SHADER },\n clipToViewport: false,\n resources: {\n adjustmentsUniforms: {\n // ── Existing ──────────────────────────────────────────────────\n uExposure: { value: params.exposure as number || 0.0, type: 'f32' },\n uBrightness: { value: params.brightness as number || 0.0, type: 'f32' },\n uContrast: { value: params.contrast as number || 0.0, type: 'f32' },\n uSaturation: { value: params.saturation as number || 0.0, type: 'f32' },\n uTemperatureColor: { value: tempColor, type: 'vec3<f32>' },\n uTemperatureWeight: { value: tempWeight, type: 'f32' },\n uTintColor: { value: tintColor, type: 'vec3<f32>' },\n uTintWeight: { value: tintWeight, type: 'f32' },\n uSepia: { value: params.sepia as number || 0.0, type: 'f32' },\n uGrayscale: { value: params.grayscale as number || 0.0, type: 'f32' },\n uHueRotate: { value: params.hueRotate as number || 0.0, type: 'f32' },\n uVignette: { value: params.vignette as number || 0.0, type: 'f32' },\n uInvert: { value: params.invert as number || 0.0, type: 'f32' },\n // ── NEW ───────────────────────────────────────────────────────\n uLift: { value: params.lift as number || 0.0, type: 'f32' },\n uShadowTint: { value: [params.shadowTintR ?? 1.0, params.shadowTintG ?? 1.0, params.shadowTintB ?? 1.0], type: 'vec3<f32>' },\n uShadowTintStrength: { value: params.shadowTintStrength as number || 0.0, type: 'f32' },\n uHighlightTint: { value: [params.highlightTintR ?? 1.0, params.highlightTintG ?? 1.0, params.highlightTintB ?? 1.0], type: 'vec3<f32>' },\n uHighlightTintStrength: { value: params.highlightTintStrength as number|| 0.0, type: 'f32' },\n uSplitBalance: { value: params.splitBalance as number ?? 0.5, type: 'f32' },\n uGrainIntensity: { value: params.grainIntensity as number || 0.0, type: 'f32' },\n uGrainSize: { value: params.grainSize as number ?? 1.0, type: 'f32' },\n uTime: { value: 0.0, type: 'f32' },\n uChannelMix: { value: [params.channelMixR ?? 0.0, params.channelMixG ?? 0.0, params.channelMixB ?? 0.0], type: 'vec3<f32>' },\n uUseChannelMix: { value: params.useChannelMix as number || 0.0, type: 'f32' },\n uDuotoneDark: { value: [params.duotoneDarkR ?? 0.0, params.duotoneDarkG ?? 0.0, params.duotoneDarkB ?? 0.0], type: 'vec3<f32>' },\n uDuotoneLight: { value: [params.duotoneLightR ?? 1.0, params.duotoneLightG ?? 1.0, params.duotoneLightB ?? 1.0], type: 'vec3<f32>' },\n uUseDuotone: { value: params.useDuotone as number || 0.0, type: 'f32' },\n uVibranceAmount: { value: params.vibranceAmount as number || 0.0, type: 'f32' },\n uVibranceProtectedHue: { value: [params.vibranceProtectedHueR ?? 0.91, params.vibranceProtectedHueG ?? 0.69, params.vibranceProtectedHueB ?? 0.55], type: 'vec3<f32>' },\n uCrossProcessAmount: { value: params.crossProcessAmount as number || 0.0, type: 'f32' },\n }\n }\n })\n },\n\n updateUniforms(filter: Filter, params: ParamValues): void {\n type UniformGroup = { uniforms?: Record<string, unknown>; update?: () => void }\n const group = (filter as Filter & { resources?: { adjustmentsUniforms?: UniformGroup } }).resources?.adjustmentsUniforms\n const uniforms = group?.uniforms\n if (!uniforms) return\n\n const temperature = params.temperature as number || 0.0\n const tempWeight = Math.abs(temperature)\n const tempColor = temperature > 0.0 ? [1.0, 0.55, 0.16] : [0.16, 0.47, 1.0]\n const tint = params.tint as number || 0.0\n const tintWeight = Math.abs(tint)\n const tintColor = tint > 0.0 ? [1.0, 0.16, 0.71] : [0.16, 1.0, 0.39]\n\n // ── Existing ────────────────────────────────────────────────────────\n uniforms.uExposure = params.exposure as number || 0.0\n uniforms.uBrightness = params.brightness as number || 0.0\n uniforms.uContrast = params.contrast as number || 0.0\n uniforms.uSaturation = params.saturation as number || 0.0\n uniforms.uTemperatureColor = tempColor\n uniforms.uTemperatureWeight = tempWeight\n uniforms.uTintColor = tintColor\n uniforms.uTintWeight = tintWeight\n uniforms.uSepia = params.sepia as number || 0.0\n uniforms.uGrayscale = params.grayscale as number || 0.0\n uniforms.uHueRotate = params.hueRotate as number || 0.0\n uniforms.uVignette = params.vignette as number || 0.0\n uniforms.uInvert = params.invert as number || 0.0\n // ── NEW ──────────────────────────────────────────────────────────\n uniforms.uLift = params.lift as number || 0.0\n uniforms.uShadowTint = [params.shadowTintR ?? 1.0, params.shadowTintG ?? 1.0, params.shadowTintB ?? 1.0]\n uniforms.uShadowTintStrength = params.shadowTintStrength as number || 0.0\n uniforms.uHighlightTint = [params.highlightTintR ?? 1.0, params.highlightTintG ?? 1.0, params.highlightTintB ?? 1.0]\n uniforms.uHighlightTintStrength = params.highlightTintStrength as number || 0.0\n uniforms.uSplitBalance = params.splitBalance as number ?? 0.5\n uniforms.uGrainIntensity = params.grainIntensity as number || 0.0\n uniforms.uGrainSize = params.grainSize as number ?? 1.0\n uniforms.uTime = ((uniforms.uTime as number || 0.0) + 0.016) % 100.0\n uniforms.uChannelMix = [params.channelMixR ?? 0.0, params.channelMixG ?? 0.0, params.channelMixB ?? 0.0]\n uniforms.uUseChannelMix = params.useChannelMix as number || 0.0\n uniforms.uDuotoneDark = [params.duotoneDarkR ?? 0.0, params.duotoneDarkG ?? 0.0, params.duotoneDarkB ?? 0.0]\n uniforms.uDuotoneLight = [params.duotoneLightR ?? 1.0, params.duotoneLightG ?? 1.0, params.duotoneLightB ?? 1.0]\n uniforms.uUseDuotone = params.useDuotone as number || 0.0\n uniforms.uVibranceAmount = params.vibranceAmount as number || 0.0\n uniforms.uVibranceProtectedHue = [params.vibranceProtectedHueR ?? 0.91, params.vibranceProtectedHueG ?? 0.69, params.vibranceProtectedHueB ?? 0.55]\n uniforms.uCrossProcessAmount = params.crossProcessAmount as number || 0.0\n group?.update?.()\n }\n }\n}\n","/**\n * V2 MPG — shared Color Adjustments filter factory (used by PixiRenderBackend).\n */\n\nimport type { Filter } from \"pixi.js\";\nimport type { ParamValues } from \"../../videoEffects/EffectDefinition.js\";\nimport { ColorAdjustmentsEffect } from \"../../effects/light/ColorAdjustmentsEffect.js\";\n\nconst spec = ColorAdjustmentsEffect.filterSpec!;\n\nexport function createColorAdjustmentsFilter(params: Record<string, unknown> = {}): Filter | Filter[] {\n return spec.create(params as ParamValues);\n}\n\nexport function updateColorAdjustmentsFilter(filter: Filter, params: Record<string, unknown>): void {\n spec.updateUniforms(filter, params as ParamValues, 0);\n}\n\n/** Normalize partial uniforms into full ColorAdjustments param set */\nexport function normalizeColorAdjustmentsUniforms(uniforms: Readonly<Record<string, unknown>>): Record<string, unknown> {\n return {\n // ── Existing ────────────────────────────────────────────────────────────\n exposure: uniforms.exposure ?? 0,\n brightness: uniforms.brightness ?? 0,\n contrast: uniforms.contrast ?? 0,\n saturation: uniforms.saturation ?? 0,\n temperature: uniforms.temperature ?? 0,\n tint: uniforms.tint ?? 0,\n sepia: uniforms.sepia ?? 0,\n grayscale: uniforms.grayscale ?? 0,\n hueRotate: uniforms.hueRotate ?? 0,\n vignette: uniforms.vignette ?? 0,\n invert: uniforms.invert ?? 0,\n // ── NEW: Lift ────────────────────────────────────────────────────────────\n lift: uniforms.lift ?? 0,\n // ── NEW: Split-toning ────────────────────────────────────────────────────\n shadowTintR: uniforms.shadowTintR ?? 1.0,\n shadowTintG: uniforms.shadowTintG ?? 1.0,\n shadowTintB: uniforms.shadowTintB ?? 1.0,\n shadowTintStrength: uniforms.shadowTintStrength ?? 0,\n highlightTintR: uniforms.highlightTintR ?? 1.0,\n highlightTintG: uniforms.highlightTintG ?? 1.0,\n highlightTintB: uniforms.highlightTintB ?? 1.0,\n highlightTintStrength: uniforms.highlightTintStrength ?? 0,\n splitBalance: uniforms.splitBalance ?? 0.5,\n // ── NEW: Film grain ──────────────────────────────────────────────────────\n grainIntensity: uniforms.grainIntensity ?? 0,\n grainSize: uniforms.grainSize ?? 1.0,\n // ── NEW: Channel-mix B&W ─────────────────────────────────────────────────\n channelMixR: uniforms.channelMixR ?? 0,\n channelMixG: uniforms.channelMixG ?? 0,\n channelMixB: uniforms.channelMixB ?? 0,\n useChannelMix: uniforms.useChannelMix ?? 0,\n // ── NEW: Duotone ─────────────────────────────────────────────────────────\n duotoneDarkR: uniforms.duotoneDarkR ?? 0,\n duotoneDarkG: uniforms.duotoneDarkG ?? 0,\n duotoneDarkB: uniforms.duotoneDarkB ?? 0,\n duotoneLightR: uniforms.duotoneLightR ?? 1.0,\n duotoneLightG: uniforms.duotoneLightG ?? 1.0,\n duotoneLightB: uniforms.duotoneLightB ?? 1.0,\n useDuotone: uniforms.useDuotone ?? 0,\n // ── NEW: Vibrance ────────────────────────────────────────────────────────\n vibranceAmount: uniforms.vibranceAmount ?? 0,\n vibranceProtectedHueR: uniforms.vibranceProtectedHueR ?? 0.91,\n vibranceProtectedHueG: uniforms.vibranceProtectedHueG ?? 0.69,\n vibranceProtectedHueB: uniforms.vibranceProtectedHueB ?? 0.55,\n // ── NEW: Cross-process ───────────────────────────────────────────────────\n crossProcessAmount: uniforms.crossProcessAmount ?? 0,\n };\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACUA,WAAsB;AACtB,0BAAiC;;;ACXjC,kBAAuB;AAIvB,IAAM,4BAA4B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BlC,IAAM,8BAA8B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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,YAAM,IAAI,MAAM,aAAa,UAAU,4BAA4B;AAAA,IACrE;AACA,UAAM,SAAS,KAAK,IAAI,SAAS,QAAQ,OAAO,OAAO;AACvD,WAAO,IAAI,WAAW,OAAO,MAAM;AAAA,EACrC;AAAA,EAEA,iBAAuB;AACrB,eAAW,MAAM,CAAC,GAAG,KAAK,UAAU,KAAK,CAAC,GAAG;AAC3C,WAAK,gBAAgB,EAAE;AAAA,IACzB;AAAA,EACF;AAAA,EAEA,UAAgB;AACd,QAAI,CAAC,KAAK,YAAa;AAEvB,eAAW,WAAW,KAAK,UAAU,OAAO,GAAG;AAC7C,cAAQ,QAAQ,IAAI;AAAA,IACtB;AACA,SAAK,UAAU,MAAM;AAErB,eAAW,UAAU,KAAK,QAAQ,OAAO,GAAG;AAC1C,aAAO,QAAQ;AAAA,IACjB;AACA,SAAK,QAAQ,MAAM;AAEnB,QAAI,KAAK,KAAK;AACZ,WAAK,IAAI,QAAQ,IAAI;AACrB,WAAK,MAAM;AAAA,IACb;AAEA,SAAK,cAAc;AACnB,SAAK,gBAAgB;AAAA,EACvB;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/v2/backends/index.ts","../../../src/v2/backends/PixiRenderBackend.ts","../../../src/effects/light/ColorAdjustmentsEffect.ts","../../../src/v2/backends/colorAdjustmentsFilter.ts"],"sourcesContent":["/**\n * @deprecated Use @clypra/runtime/renderer instead\n * ```ts\n * import { PixiRenderer } from \"@clypra/runtime/renderer\";\n * ```\n * This file will be removed in v3.0.0\n */\nexport { PixiRenderBackend } from \"./PixiRenderBackend.js\";\n","/**\n * @clypra-studio/engine — Pipeline V2: Pixi Render Backend\n *\n * @deprecated Use @clypra/runtime/renderer instead\n * The runtime version (PixiRenderer) is more complete with better resource management.\n * This file will be removed in v3.0.0\n *\n * RenderBackend implementation using Pixi.js for GPU pass execution.\n */\n\nimport * as PIXI from \"pixi.js\";\nimport { AdjustmentFilter } from \"pixi-filters\";\nimport type { RenderBackend, CommandBuffer } from \"../runtime/types\";\nimport type { RenderPass } from \"../planner/types\";\nimport { createColorAdjustmentsFilter, updateColorAdjustmentsFilter, normalizeColorAdjustmentsUniforms } from \"./colorAdjustmentsFilter.js\";\n\nexport class PixiRenderBackend implements RenderBackend {\n private app: PIXI.Application | null = null;\n private initialized = false;\n private resources = new Map<string, PIXI.Texture>();\n private filters = new Map<string, PIXI.Filter>();\n private canvasElement?: HTMLCanvasElement;\n\n async init(canvasElement?: HTMLCanvasElement, width?: number, height?: number): Promise<void> {\n if (this.initialized) {\n throw new Error(\"PixiRenderBackend already initialized\");\n }\n\n this.canvasElement = canvasElement;\n\n const logicalWidth = width ?? canvasElement?.clientWidth ?? canvasElement?.width ?? 1920;\n const logicalHeight = height ?? canvasElement?.clientHeight ?? canvasElement?.height ?? 1080;\n\n this.app = new PIXI.Application();\n await this.app.init({\n canvas: canvasElement,\n width: logicalWidth,\n height: logicalHeight,\n backgroundColor: 0x0e0e12,\n antialias: true,\n preference: \"webgl\",\n resolution: typeof window !== \"undefined\" ? window.devicePixelRatio || 1 : 1,\n autoDensity: true,\n preserveDrawingBuffer: true,\n });\n\n this.initialized = true;\n }\n\n resize(width: number, height: number): void {\n if (!this.app) return;\n this.app.renderer.resize(width, height);\n }\n\n get logicalWidth(): number {\n return this.app?.renderer.width ?? 0;\n }\n\n get logicalHeight(): number {\n return this.app?.renderer.height ?? 0;\n }\n\n allocateResource(id: string, _type: \"texture\" | \"buffer\", width: number, height: number, _format: string): void {\n if (!this.initialized || !this.app) {\n throw new Error(\"PixiRenderBackend not initialized\");\n }\n if (this.resources.has(id)) {\n throw new Error(`Resource \"${id}\" already allocated`);\n }\n this.resources.set(id, PIXI.RenderTexture.create({ width, height }));\n }\n\n releaseResource(id: string): void {\n if (!this.initialized) {\n throw new Error(\"PixiRenderBackend not initialized\");\n }\n const texture = this.resources.get(id);\n if (!texture) {\n throw new Error(`Resource \"${id}\" not found for release`);\n }\n texture.destroy(true);\n this.resources.delete(id);\n }\n\n compileShader(shaderId: string, _sourceGLSLOrWGSL: string): void {\n if (!this.initialized) {\n throw new Error(\"PixiRenderBackend not initialized\");\n }\n\n if (this.filters.has(shaderId)) return;\n\n let filter: PIXI.Filter;\n switch (shaderId) {\n case \"brightness\":\n filter = new AdjustmentFilter({ brightness: 1.0 });\n break;\n case \"contrast\":\n filter = new AdjustmentFilter({ contrast: 1.0 });\n break;\n case \"gaussian-blur-h\":\n case \"gaussian-blur-v\":\n filter = new PIXI.BlurFilter({ strength: 8, quality: 4 });\n break;\n case \"copy\":\n case \"blit-source\":\n filter = new AdjustmentFilter({ brightness: 1, contrast: 1, saturation: 1 });\n break;\n case \"color-adjustments\":\n // Per-pass instances are created in executePass; no shared cached filter.\n return;\n default:\n filter = new AdjustmentFilter({});\n }\n\n this.filters.set(shaderId, filter);\n }\n\n async submit(commandBuffer: CommandBuffer): Promise<void> {\n if (!this.initialized || !this.app) {\n throw new Error(\"PixiRenderBackend not initialized\");\n }\n\n for (const { pass } of commandBuffer.passes) {\n await this.executePass(pass);\n }\n }\n\n private async executePass(pass: RenderPass): Promise<void> {\n if (!this.app) return;\n\n const inputTexture = pass.inputs.length > 0 ? this.resources.get(pass.inputs[0]) : null;\n const outputTexture = this.resources.get(pass.output);\n if (!outputTexture) {\n throw new Error(`Output resource not found: ${pass.output}`);\n }\n\n if (pass.shaderId === \"copy\" || pass.shaderId === \"blit-source\") {\n if (inputTexture) {\n this.blitTexture(inputTexture, outputTexture as PIXI.RenderTexture);\n }\n return;\n }\n\n if (!inputTexture) return;\n\n const target = outputTexture as PIXI.RenderTexture;\n const sprite = new PIXI.Sprite(inputTexture);\n sprite.width = target.width;\n sprite.height = target.height;\n\n let filter: PIXI.Filter | PIXI.Filter[];\n let disposeFilter = false;\n\n if (pass.shaderId === \"color-adjustments\") {\n filter = createColorAdjustmentsFilter(normalizeColorAdjustmentsUniforms(pass.uniforms));\n disposeFilter = true;\n } else {\n if (!this.filters.has(pass.shaderId)) {\n this.compileShader(pass.shaderId, \"\");\n }\n const cachedFilter = this.filters.get(pass.shaderId);\n if (!cachedFilter) {\n throw new Error(`Filter not compiled for shader: ${pass.shaderId}`);\n }\n filter = cachedFilter;\n this.applyUniforms(cachedFilter, pass.uniforms, pass.shaderId);\n }\n\n const filterArray = Array.isArray(filter) ? filter : [filter];\n sprite.filters = filterArray;\n this.app.renderer.render({ container: sprite, target, clear: true });\n sprite.filters = null;\n\n if (disposeFilter) {\n if (Array.isArray(filter)) {\n filter.forEach((f) => f.destroy());\n } else {\n filter.destroy();\n }\n }\n }\n\n private applyUniforms(filter: PIXI.Filter, uniforms: Readonly<Record<string, unknown>>, shaderId?: string): void {\n if (shaderId === \"color-adjustments\") {\n updateColorAdjustmentsFilter(filter, normalizeColorAdjustmentsUniforms(uniforms));\n return;\n }\n if (filter instanceof AdjustmentFilter) {\n if (uniforms.brightness !== undefined) {\n filter.brightness = 1.0 + Number(uniforms.brightness);\n }\n if (uniforms.contrast !== undefined) {\n filter.contrast = 1.0 + Number(uniforms.contrast);\n }\n } else if (filter instanceof PIXI.BlurFilter && uniforms.uBlurStrength !== undefined) {\n filter.strength = Number(uniforms.uBlurStrength);\n }\n }\n\n private blitTexture(source: PIXI.Texture, target: PIXI.RenderTexture): void {\n if (!this.app) return;\n const sprite = new PIXI.Sprite(source);\n this.app.renderer.render({ container: sprite, target });\n }\n\n /** Upload a source image into track/source render textures (contain-fit). */\n uploadSourceImage(sourceImage: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, resourceIds: readonly string[]): void {\n if (!this.app) return;\n\n const sourceTexture = PIXI.Texture.from(sourceImage);\n for (const resourceId of resourceIds) {\n const texture = this.resources.get(resourceId);\n if (!texture) continue;\n\n const blitSprite = new PIXI.Sprite(sourceTexture);\n const fitScale = Math.min(texture.width / sourceTexture.width, texture.height / sourceTexture.height);\n blitSprite.scale.set(fitScale);\n blitSprite.position.set((texture.width - sourceTexture.width * fitScale) / 2, (texture.height - sourceTexture.height * fitScale) / 2);\n this.app.renderer.render({ container: blitSprite, target: texture as PIXI.RenderTexture });\n }\n }\n\n /** Present a resource texture to the canvas screen. */\n present(resourceId: string): void {\n if (!this.app) return;\n const texture = this.resources.get(resourceId);\n if (!texture) return;\n\n const screenW = this.app.renderer.screen.width;\n const screenH = this.app.renderer.screen.height;\n const scale = Math.min(screenW / texture.width, screenH / texture.height);\n const sprite = new PIXI.Sprite(texture);\n sprite.scale.set(scale);\n sprite.position.set((screenW - texture.width * scale) / 2, (screenH - texture.height * scale) / 2);\n\n this.app.stage.removeChildren();\n this.app.stage.addChild(sprite);\n this.app.renderer.render(this.app.stage);\n }\n\n getResource(id: string): PIXI.Texture | undefined {\n return this.resources.get(id);\n }\n\n async readPixels(resourceId: string): Promise<Uint8Array> {\n if (!this.initialized || !this.app) {\n throw new Error(\"PixiRenderBackend not initialized\");\n }\n const texture = this.resources.get(resourceId);\n if (!texture) {\n throw new Error(`Resource \"${resourceId}\" not found for readPixels`);\n }\n const pixels = this.app.renderer.extract.pixels(texture);\n return new Uint8Array(pixels.pixels);\n }\n\n clearResources(): void {\n for (const id of [...this.resources.keys()]) {\n this.releaseResource(id);\n }\n }\n\n destroy(): void {\n if (!this.initialized) return;\n\n for (const texture of this.resources.values()) {\n texture.destroy(true);\n }\n this.resources.clear();\n\n for (const filter of this.filters.values()) {\n filter.destroy();\n }\n this.filters.clear();\n\n if (this.app) {\n this.app.destroy(true);\n this.app = null;\n }\n\n this.initialized = false;\n this.canvasElement = undefined;\n }\n}\n","import { Filter } from 'pixi.js'\nimport type { PixiEffectDefinition, ParamValues } from '../../videoEffects/EffectDefinition'\n\n/** Pixi v8 default filter vertex — required for correct render-to-texture in MPG. */\nconst ADJUSTMENTS_VERTEX_SHADER = `\n in vec2 aPosition;\n out vec2 vTextureCoord;\n\n uniform vec4 uInputSize;\n uniform vec4 uOutputFrame;\n uniform vec4 uOutputTexture;\n\n vec4 filterVertexPosition( void )\n {\n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;\n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0 * uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;\n return vec4(position, 0.0, 1.0);\n }\n\n vec2 filterTextureCoord( void )\n {\n return aPosition * (uOutputFrame.zw * uInputSize.zw);\n }\n\n void main(void)\n {\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n }\n`;\n\nconst ADJUSTMENTS_FRAGMENT_SHADER = `\n in vec2 vTextureCoord;\n out vec4 finalColor;\n\n uniform sampler2D uTexture;\n\n // ── Existing uniforms ─────────────────────────────────────────────────────\n uniform float uExposure; // -1.0 to 1.0\n uniform float uBrightness; // -1.0 to 1.0\n uniform float uContrast; // -1.0 to 1.0\n uniform float uSaturation; // -1.0 to 1.0\n uniform vec3 uTemperatureColor; // warm or cool color\n uniform float uTemperatureWeight; // 0.0 to 1.0\n uniform vec3 uTintColor; // magenta or green color\n uniform float uTintWeight; // 0.0 to 1.0\n uniform float uSepia; // 0.0 to 1.0\n uniform float uGrayscale; // 0.0 to 1.0\n uniform float uHueRotate; // radians\n uniform float uVignette; // 0.0 to 1.0\n uniform float uInvert; // 0.0 to 1.0\n\n // ── NEW: Lift ─────────────────────────────────────────────────────────────\n uniform float uLift; // -0.2 to 0.2; positive = faded/matte, negative = crushed\n\n // ── NEW: Split-toning ─────────────────────────────────────────────────────\n uniform vec3 uShadowTint; // multiplicative color for shadows (neutral = vec3(1))\n uniform float uShadowTintStrength;\n uniform vec3 uHighlightTint; // multiplicative color for highlights (neutral = vec3(1))\n uniform float uHighlightTintStrength;\n uniform float uSplitBalance; // 0.0-1.0, luma split point\n\n // ── NEW: Film grain ───────────────────────────────────────────────────────\n uniform float uGrainIntensity; // 0.0 to 0.5\n uniform float uGrainSize; // 0.1 to 5.0\n uniform float uTime; // animated, incremented each frame\n\n // ── NEW: Channel-mix B&W ──────────────────────────────────────────────────\n uniform vec3 uChannelMix; // R/G/B weights summing to ~1.0\n uniform float uUseChannelMix; // 1.0 = active, 0.0 = off\n\n // ── NEW: Duotone ──────────────────────────────────────────────────────────\n uniform vec3 uDuotoneDark; // color mapped to black/dark tones\n uniform vec3 uDuotoneLight; // color mapped to white/light tones\n uniform float uUseDuotone; // 1.0 = active, 0.0 = off\n\n // ── NEW: Vibrance ─────────────────────────────────────────────────────────\n uniform float uVibranceAmount; // -1.0 to 1.0\n uniform vec3 uVibranceProtectedHue; // reference color for skin-tone protection\n\n // ── NEW: Cross-process ────────────────────────────────────────────────────\n uniform float uCrossProcessAmount; // 0.0 to 1.0\n\n // ── Helper functions ──────────────────────────────────────────────────────\n vec3 hueRotateColor(vec3 color, float angle) {\n vec3 k = vec3(0.57735, 0.57735, 0.57735);\n float c = cos(angle);\n return color * c + cross(k, color) * sin(angle) + k * dot(k, color) * (1.0 - c);\n }\n\n vec3 rgb2hsv(vec3 c) {\n vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));\n vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));\n float d = q.x - min(q.w, q.y);\n float e = 1.0e-10;\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);\n }\n\n vec3 hsv2rgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n }\n\n void main() {\n vec4 texColor = texture(uTexture, vTextureCoord);\n vec3 rgb = texColor.rgb;\n\n // Invert\n rgb = mix(rgb, 1.0 - rgb, uInvert);\n\n // Exposure\n rgb = rgb * pow(2.0, uExposure);\n\n // Brightness\n rgb = rgb + uBrightness;\n\n // Lift — shift black point; applied before contrast so it interacts correctly with tonal range\n if (uLift != 0.0) {\n rgb = rgb + uLift * (1.0 - rgb);\n }\n\n // Contrast\n rgb = (rgb - 0.5) * (1.0 + uContrast) + 0.5;\n\n // Saturation (flat, distinct from vibrance)\n float luma = dot(rgb, vec3(0.2126, 0.7152, 0.0722));\n rgb = mix(vec3(luma), rgb, 1.0 + uSaturation);\n\n // Grayscale\n float lumaG = dot(rgb, vec3(0.2126, 0.7152, 0.0722));\n rgb = mix(rgb, vec3(lumaG), uGrayscale);\n\n // Sepia\n if (uSepia > 0.0) {\n vec3 sep = vec3(\n dot(rgb, vec3(0.393, 0.769, 0.189)),\n dot(rgb, vec3(0.349, 0.686, 0.168)),\n dot(rgb, vec3(0.272, 0.534, 0.131))\n );\n rgb = mix(rgb, sep, uSepia);\n }\n\n // Hue Rotate\n if (uHueRotate != 0.0) {\n rgb = hueRotateColor(rgb, uHueRotate);\n }\n\n // Temperature — soft-light blend\n if (uTemperatureWeight > 0.0) {\n vec3 t = uTemperatureColor;\n rgb = mix(rgb, (1.0 - 2.0 * t) * rgb * rgb + 2.0 * t * rgb, uTemperatureWeight);\n }\n\n // Tint — soft-light blend\n if (uTintWeight > 0.0) {\n vec3 t = uTintColor;\n rgb = mix(rgb, (1.0 - 2.0 * t) * rgb * rgb + 2.0 * t * rgb, uTintWeight);\n }\n\n // ── NEW: Channel-mixed B&W ─────────────────────────────────────────────\n // Applied before duotone; mutually exclusive (both produce mono, duotone adds color back)\n if (uUseChannelMix > 0.5) {\n float mono = dot(rgb, uChannelMix);\n rgb = vec3(mono);\n }\n\n // ── NEW: Duotone ───────────────────────────────────────────────────────\n // Maps current luminance to a 2-color gradient; applied after channel-mix for correct mono base\n if (uUseDuotone > 0.5) {\n float duoLuma = dot(rgb, vec3(0.299, 0.587, 0.114));\n rgb = mix(uDuotoneDark, uDuotoneLight, duoLuma);\n }\n\n // ── NEW: Split-toning ──────────────────────────────────────────────────\n if (uShadowTintStrength > 0.0 || uHighlightTintStrength > 0.0) {\n float splitLuma = dot(rgb, vec3(0.299, 0.587, 0.114));\n float shadowW = 1.0 - smoothstep(0.0, uSplitBalance, splitLuma);\n float highlightW = smoothstep(uSplitBalance, 1.0, splitLuma);\n rgb = mix(rgb, rgb * uShadowTint, shadowW * uShadowTintStrength);\n rgb = mix(rgb, rgb * uHighlightTint, highlightW * uHighlightTintStrength);\n }\n\n // ── NEW: Vibrance — hue-selective saturation ───────────────────────────\n // Skipped when channel-mix or duotone have flattened color information\n if (uVibranceAmount != 0.0 && uUseChannelMix < 0.5 && uUseDuotone < 0.5) {\n vec3 hsv = rgb2hsv(clamp(rgb, 0.0, 1.0));\n vec3 protHSV = rgb2hsv(uVibranceProtectedHue);\n float hueDist = abs(hsv.x - protHSV.x);\n hueDist = min(hueDist, 1.0 - hueDist); // wrap hue distance\n float protection = smoothstep(0.0, 0.15, hueDist);\n hsv.y = clamp(hsv.y + uVibranceAmount * protection, 0.0, 1.0);\n rgb = hsv2rgb(hsv);\n }\n\n // ── NEW: Cross-process — channel curve swap ────────────────────────────\n if (uCrossProcessAmount > 0.0) {\n float origR = rgb.r;\n float origB = rgb.b;\n rgb.r = mix(rgb.r, pow(max(origB, 0.001), 0.8), uCrossProcessAmount);\n rgb.b = mix(rgb.b, pow(max(origR, 0.001), 1.2), uCrossProcessAmount);\n }\n\n // ── NEW: Film grain — last before vignette ────────────────────────────\n if (uGrainIntensity > 0.0) {\n float grain = fract(sin(dot(vTextureCoord * uGrainSize + uTime, vec2(12.9898, 78.233))) * 43758.5453);\n rgb += (grain - 0.5) * uGrainIntensity;\n }\n\n // Vignette\n vec2 uv = vTextureCoord - 0.5;\n float vignetteVal = smoothstep(0.45, 1.0, length(uv));\n rgb = mix(rgb, vec3(0.0), vignetteVal * uVignette);\n\n finalColor = vec4(rgb, texColor.a);\n }\n`;\n\n/** Convert a hex color string (#RRGGBB) to a normalized [r, g, b] array. */\nexport function hexToRgb(hex: string): [number, number, number] {\n const clean = hex.replace('#', '').padEnd(6, '0')\n const r = parseInt(clean.substring(0, 2), 16) / 255\n const g = parseInt(clean.substring(2, 4), 16) / 255\n const b = parseInt(clean.substring(4, 6), 16) / 255\n return [isNaN(r) ? 1 : r, isNaN(g) ? 1 : g, isNaN(b) ? 1 : b]\n}\n\nexport const ColorAdjustmentsEffect: PixiEffectDefinition = {\n backend: 'pixi',\n subtype: 'filter',\n id: 'color-adjustments',\n name: 'Color Adjustments',\n category: 'light',\n description: 'Adjust exposure, brightness, contrast, saturation, temperature, tint, sepia, grayscale, hue, invert, vignette, lift, split-toning, grain, channel-mix, duotone, vibrance, and cross-process.',\n tags: ['color', 'adjustments', 'brightness', 'contrast', 'saturation', 'temperature', 'tint', 'vignette', 'grain', 'duotone', 'vibrance'],\n thumbnail: '',\n params: [\n // ── Existing ───────────────────────────────────────────────────────────\n { key: 'exposure', label: 'Exposure', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'brightness', label: 'Brightness', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'contrast', label: 'Contrast', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'saturation', label: 'Saturation', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'temperature', label: 'Temperature', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'tint', label: 'Tint', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'sepia', label: 'Sepia', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'grayscale', label: 'Grayscale', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'hueRotate', label: 'Hue Rotate', type: 'range', value: 0.0, min: 0.0, max: 6.28318, step: 0.01 },\n { key: 'vignette', label: 'Vignette', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'invert', label: 'Invert', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n // ── NEW ────────────────────────────────────────────────────────────────\n { key: 'lift', label: 'Lift', type: 'range', value: 0.0, min: -0.5, max: 0.5, step: 0.01 },\n { key: 'shadowTintR', label: 'Shadow Tint R', type: 'range', value: 1.0, min: 0.0, max: 2.0, step: 0.01 },\n { key: 'shadowTintG', label: 'Shadow Tint G', type: 'range', value: 1.0, min: 0.0, max: 2.0, step: 0.01 },\n { key: 'shadowTintB', label: 'Shadow Tint B', type: 'range', value: 1.0, min: 0.0, max: 2.0, step: 0.01 },\n { key: 'shadowTintStrength', label: 'Shadow Strength', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'highlightTintR', label: 'Hi Tint R', type: 'range', value: 1.0, min: 0.0, max: 2.0, step: 0.01 },\n { key: 'highlightTintG', label: 'Hi Tint G', type: 'range', value: 1.0, min: 0.0, max: 2.0, step: 0.01 },\n { key: 'highlightTintB', label: 'Hi Tint B', type: 'range', value: 1.0, min: 0.0, max: 2.0, step: 0.01 },\n { key: 'highlightTintStrength', label: 'Hi Strength', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'splitBalance', label: 'Split Balance', type: 'range', value: 0.5, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'grainIntensity', label: 'Grain Intensity', type: 'range', value: 0.0, min: 0.0, max: 0.5, step: 0.01 },\n { key: 'grainSize', label: 'Grain Size', type: 'range', value: 1.0, min: 0.1, max: 5.0, step: 0.1 },\n { key: 'channelMixR', label: 'Channel Mix R', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'channelMixG', label: 'Channel Mix G', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'channelMixB', label: 'Channel Mix B', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'useChannelMix', label: 'Use Channel Mix', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 1.0 },\n { key: 'duotoneDarkR', label: 'Duo Dark R', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'duotoneDarkG', label: 'Duo Dark G', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'duotoneDarkB', label: 'Duo Dark B', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'duotoneLightR', label: 'Duo Light R', type: 'range', value: 1.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'duotoneLightG', label: 'Duo Light G', type: 'range', value: 1.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'duotoneLightB', label: 'Duo Light B', type: 'range', value: 1.0, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'useDuotone', label: 'Use Duotone', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 1.0 },\n { key: 'vibranceAmount', label: 'Vibrance', type: 'range', value: 0.0, min: -1.0, max: 1.0, step: 0.01 },\n { key: 'vibranceProtectedHueR', label: 'Vib Protect R', type: 'range', value: 0.91, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'vibranceProtectedHueG', label: 'Vib Protect G', type: 'range', value: 0.69, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'vibranceProtectedHueB', label: 'Vib Protect B', type: 'range', value: 0.55, min: 0.0, max: 1.0, step: 0.01 },\n { key: 'crossProcessAmount', label: 'Cross Process', type: 'range', value: 0.0, min: 0.0, max: 1.0, step: 0.01 },\n ],\n filterSpec: {\n create(params: ParamValues): Filter {\n const temperature = params.temperature as number || 0.0\n const tempWeight = Math.abs(temperature)\n const tempColor = temperature > 0.0 ? [1.0, 0.55, 0.16] : [0.16, 0.47, 1.0]\n const tint = params.tint as number || 0.0\n const tintWeight = Math.abs(tint)\n const tintColor = tint > 0.0 ? [1.0, 0.16, 0.71] : [0.16, 1.0, 0.39]\n\n return Filter.from({\n gl: { vertex: ADJUSTMENTS_VERTEX_SHADER, fragment: ADJUSTMENTS_FRAGMENT_SHADER },\n clipToViewport: false,\n resources: {\n adjustmentsUniforms: {\n // ── Existing ──────────────────────────────────────────────────\n uExposure: { value: params.exposure as number || 0.0, type: 'f32' },\n uBrightness: { value: params.brightness as number || 0.0, type: 'f32' },\n uContrast: { value: params.contrast as number || 0.0, type: 'f32' },\n uSaturation: { value: params.saturation as number || 0.0, type: 'f32' },\n uTemperatureColor: { value: tempColor, type: 'vec3<f32>' },\n uTemperatureWeight: { value: tempWeight, type: 'f32' },\n uTintColor: { value: tintColor, type: 'vec3<f32>' },\n uTintWeight: { value: tintWeight, type: 'f32' },\n uSepia: { value: params.sepia as number || 0.0, type: 'f32' },\n uGrayscale: { value: params.grayscale as number || 0.0, type: 'f32' },\n uHueRotate: { value: params.hueRotate as number || 0.0, type: 'f32' },\n uVignette: { value: params.vignette as number || 0.0, type: 'f32' },\n uInvert: { value: params.invert as number || 0.0, type: 'f32' },\n // ── NEW ───────────────────────────────────────────────────────\n uLift: { value: params.lift as number || 0.0, type: 'f32' },\n uShadowTint: { value: [params.shadowTintR ?? 1.0, params.shadowTintG ?? 1.0, params.shadowTintB ?? 1.0], type: 'vec3<f32>' },\n uShadowTintStrength: { value: params.shadowTintStrength as number || 0.0, type: 'f32' },\n uHighlightTint: { value: [params.highlightTintR ?? 1.0, params.highlightTintG ?? 1.0, params.highlightTintB ?? 1.0], type: 'vec3<f32>' },\n uHighlightTintStrength: { value: params.highlightTintStrength as number|| 0.0, type: 'f32' },\n uSplitBalance: { value: params.splitBalance as number ?? 0.5, type: 'f32' },\n uGrainIntensity: { value: params.grainIntensity as number || 0.0, type: 'f32' },\n uGrainSize: { value: params.grainSize as number ?? 1.0, type: 'f32' },\n uTime: { value: 0.0, type: 'f32' },\n uChannelMix: { value: [params.channelMixR ?? 0.0, params.channelMixG ?? 0.0, params.channelMixB ?? 0.0], type: 'vec3<f32>' },\n uUseChannelMix: { value: params.useChannelMix as number || 0.0, type: 'f32' },\n uDuotoneDark: { value: [params.duotoneDarkR ?? 0.0, params.duotoneDarkG ?? 0.0, params.duotoneDarkB ?? 0.0], type: 'vec3<f32>' },\n uDuotoneLight: { value: [params.duotoneLightR ?? 1.0, params.duotoneLightG ?? 1.0, params.duotoneLightB ?? 1.0], type: 'vec3<f32>' },\n uUseDuotone: { value: params.useDuotone as number || 0.0, type: 'f32' },\n uVibranceAmount: { value: params.vibranceAmount as number || 0.0, type: 'f32' },\n uVibranceProtectedHue: { value: [params.vibranceProtectedHueR ?? 0.91, params.vibranceProtectedHueG ?? 0.69, params.vibranceProtectedHueB ?? 0.55], type: 'vec3<f32>' },\n uCrossProcessAmount: { value: params.crossProcessAmount as number || 0.0, type: 'f32' },\n }\n }\n })\n },\n\n updateUniforms(filter: Filter, params: ParamValues): void {\n type UniformGroup = { uniforms?: Record<string, unknown>; update?: () => void }\n const group = (filter as Filter & { resources?: { adjustmentsUniforms?: UniformGroup } }).resources?.adjustmentsUniforms\n const uniforms = group?.uniforms\n if (!uniforms) return\n\n const temperature = params.temperature as number || 0.0\n const tempWeight = Math.abs(temperature)\n const tempColor = temperature > 0.0 ? [1.0, 0.55, 0.16] : [0.16, 0.47, 1.0]\n const tint = params.tint as number || 0.0\n const tintWeight = Math.abs(tint)\n const tintColor = tint > 0.0 ? [1.0, 0.16, 0.71] : [0.16, 1.0, 0.39]\n\n // ── Existing ────────────────────────────────────────────────────────\n uniforms.uExposure = params.exposure as number || 0.0\n uniforms.uBrightness = params.brightness as number || 0.0\n uniforms.uContrast = params.contrast as number || 0.0\n uniforms.uSaturation = params.saturation as number || 0.0\n uniforms.uTemperatureColor = tempColor\n uniforms.uTemperatureWeight = tempWeight\n uniforms.uTintColor = tintColor\n uniforms.uTintWeight = tintWeight\n uniforms.uSepia = params.sepia as number || 0.0\n uniforms.uGrayscale = params.grayscale as number || 0.0\n uniforms.uHueRotate = params.hueRotate as number || 0.0\n uniforms.uVignette = params.vignette as number || 0.0\n uniforms.uInvert = params.invert as number || 0.0\n // ── NEW ──────────────────────────────────────────────────────────\n uniforms.uLift = params.lift as number || 0.0\n uniforms.uShadowTint = [params.shadowTintR ?? 1.0, params.shadowTintG ?? 1.0, params.shadowTintB ?? 1.0]\n uniforms.uShadowTintStrength = params.shadowTintStrength as number || 0.0\n uniforms.uHighlightTint = [params.highlightTintR ?? 1.0, params.highlightTintG ?? 1.0, params.highlightTintB ?? 1.0]\n uniforms.uHighlightTintStrength = params.highlightTintStrength as number || 0.0\n uniforms.uSplitBalance = params.splitBalance as number ?? 0.5\n uniforms.uGrainIntensity = params.grainIntensity as number || 0.0\n uniforms.uGrainSize = params.grainSize as number ?? 1.0\n uniforms.uTime = ((uniforms.uTime as number || 0.0) + 0.016) % 100.0\n uniforms.uChannelMix = [params.channelMixR ?? 0.0, params.channelMixG ?? 0.0, params.channelMixB ?? 0.0]\n uniforms.uUseChannelMix = params.useChannelMix as number || 0.0\n uniforms.uDuotoneDark = [params.duotoneDarkR ?? 0.0, params.duotoneDarkG ?? 0.0, params.duotoneDarkB ?? 0.0]\n uniforms.uDuotoneLight = [params.duotoneLightR ?? 1.0, params.duotoneLightG ?? 1.0, params.duotoneLightB ?? 1.0]\n uniforms.uUseDuotone = params.useDuotone as number || 0.0\n uniforms.uVibranceAmount = params.vibranceAmount as number || 0.0\n uniforms.uVibranceProtectedHue = [params.vibranceProtectedHueR ?? 0.91, params.vibranceProtectedHueG ?? 0.69, params.vibranceProtectedHueB ?? 0.55]\n uniforms.uCrossProcessAmount = params.crossProcessAmount as number || 0.0\n group?.update?.()\n }\n }\n}\n","/**\n * V2 MPG — shared Color Adjustments filter factory (used by PixiRenderBackend).\n */\n\nimport type { Filter } from \"pixi.js\";\nimport type { ParamValues } from \"../../videoEffects/EffectDefinition.js\";\nimport { ColorAdjustmentsEffect } from \"../../effects/light/ColorAdjustmentsEffect.js\";\n\nconst spec = ColorAdjustmentsEffect.filterSpec!;\n\nexport function createColorAdjustmentsFilter(params: Record<string, unknown> = {}): Filter | Filter[] {\n return spec.create(params as ParamValues);\n}\n\nexport function updateColorAdjustmentsFilter(filter: Filter, params: Record<string, unknown>): void {\n spec.updateUniforms(filter, params as ParamValues, 0);\n}\n\n/** Normalize partial uniforms into full ColorAdjustments param set */\nexport function normalizeColorAdjustmentsUniforms(uniforms: Readonly<Record<string, unknown>>): Record<string, unknown> {\n return {\n // ── Existing ────────────────────────────────────────────────────────────\n exposure: uniforms.exposure ?? 0,\n brightness: uniforms.brightness ?? 0,\n contrast: uniforms.contrast ?? 0,\n saturation: uniforms.saturation ?? 0,\n temperature: uniforms.temperature ?? 0,\n tint: uniforms.tint ?? 0,\n sepia: uniforms.sepia ?? 0,\n grayscale: uniforms.grayscale ?? 0,\n hueRotate: uniforms.hueRotate ?? 0,\n vignette: uniforms.vignette ?? 0,\n invert: uniforms.invert ?? 0,\n // ── NEW: Lift ────────────────────────────────────────────────────────────\n lift: uniforms.lift ?? 0,\n // ── NEW: Split-toning ────────────────────────────────────────────────────\n shadowTintR: uniforms.shadowTintR ?? 1.0,\n shadowTintG: uniforms.shadowTintG ?? 1.0,\n shadowTintB: uniforms.shadowTintB ?? 1.0,\n shadowTintStrength: uniforms.shadowTintStrength ?? 0,\n highlightTintR: uniforms.highlightTintR ?? 1.0,\n highlightTintG: uniforms.highlightTintG ?? 1.0,\n highlightTintB: uniforms.highlightTintB ?? 1.0,\n highlightTintStrength: uniforms.highlightTintStrength ?? 0,\n splitBalance: uniforms.splitBalance ?? 0.5,\n // ── NEW: Film grain ──────────────────────────────────────────────────────\n grainIntensity: uniforms.grainIntensity ?? 0,\n grainSize: uniforms.grainSize ?? 1.0,\n // ── NEW: Channel-mix B&W ─────────────────────────────────────────────────\n channelMixR: uniforms.channelMixR ?? 0,\n channelMixG: uniforms.channelMixG ?? 0,\n channelMixB: uniforms.channelMixB ?? 0,\n useChannelMix: uniforms.useChannelMix ?? 0,\n // ── NEW: Duotone ─────────────────────────────────────────────────────────\n duotoneDarkR: uniforms.duotoneDarkR ?? 0,\n duotoneDarkG: uniforms.duotoneDarkG ?? 0,\n duotoneDarkB: uniforms.duotoneDarkB ?? 0,\n duotoneLightR: uniforms.duotoneLightR ?? 1.0,\n duotoneLightG: uniforms.duotoneLightG ?? 1.0,\n duotoneLightB: uniforms.duotoneLightB ?? 1.0,\n useDuotone: uniforms.useDuotone ?? 0,\n // ── NEW: Vibrance ────────────────────────────────────────────────────────\n vibranceAmount: uniforms.vibranceAmount ?? 0,\n vibranceProtectedHueR: uniforms.vibranceProtectedHueR ?? 0.91,\n vibranceProtectedHueG: uniforms.vibranceProtectedHueG ?? 0.69,\n vibranceProtectedHueB: uniforms.vibranceProtectedHueB ?? 0.55,\n // ── NEW: Cross-process ───────────────────────────────────────────────────\n crossProcessAmount: uniforms.crossProcessAmount ?? 0,\n };\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACUA,WAAsB;AACtB,0BAAiC;;;ACXjC,kBAAuB;AAIvB,IAAM,4BAA4B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BlC,IAAM,8BAA8B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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;AAAA,IACtB;AACA,SAAK,UAAU,MAAM;AAErB,eAAW,UAAU,KAAK,QAAQ,OAAO,GAAG;AAC1C,aAAO,QAAQ;AAAA,IACjB;AACA,SAAK,QAAQ,MAAM;AAEnB,QAAI,KAAK,KAAK;AACZ,WAAK,IAAI,QAAQ,IAAI;AACrB,WAAK,MAAM;AAAA,IACb;AAEA,SAAK,cAAc;AACnB,SAAK,gBAAgB;AAAA,EACvB;AACF;","names":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @clypra/engine — NLE Runtime & Pipeline Contract v2 (LEGACY DRAFT)
|
|
2
|
+
* @clypra-studio/engine — NLE Runtime & Pipeline Contract v2 (LEGACY DRAFT)
|
|
3
3
|
*
|
|
4
4
|
* @deprecated Prefer `v2/project`, `v2/graph`, `v2/planner`, and `v2/runtime`.
|
|
5
5
|
* Exported via `@clypra/engine/contract` for Rust/wgpu alignment only.
|
|
6
6
|
*/
|
|
7
|
-
type AssetType =
|
|
7
|
+
type AssetType = "video" | "audio" | "image" | "font" | "lut" | "model" | "generated";
|
|
8
8
|
interface AssetDescriptor {
|
|
9
9
|
id: string;
|
|
10
10
|
name: string;
|
|
@@ -29,7 +29,7 @@ interface MediaResolver {
|
|
|
29
29
|
prewarmAsset(assetId: string): Promise<void>;
|
|
30
30
|
releaseAsset(assetId: string): void;
|
|
31
31
|
}
|
|
32
|
-
type GraphDataType =
|
|
32
|
+
type GraphDataType = "Texture" | "Depth" | "MotionField" | "BoundingBoxes" | "Mask" | "Mesh" | "Particles" | "AudioSpectrum" | "Text" | "Markers";
|
|
33
33
|
interface GraphValue<T = any> {
|
|
34
34
|
type: GraphDataType;
|
|
35
35
|
payload: T;
|
|
@@ -65,23 +65,23 @@ interface GraphNode {
|
|
|
65
65
|
capabilities: EffectCapabilities;
|
|
66
66
|
profile: EffectProfile;
|
|
67
67
|
}
|
|
68
|
-
type ExecutionQuality =
|
|
69
|
-
type PlaybackMode =
|
|
70
|
-
type PlaybackDirection =
|
|
68
|
+
type ExecutionQuality = "draft" | "preview" | "export";
|
|
69
|
+
type PlaybackMode = "play" | "seek";
|
|
70
|
+
type PlaybackDirection = "forward" | "reverse";
|
|
71
71
|
interface ExecutionPolicy {
|
|
72
72
|
quality: ExecutionQuality;
|
|
73
73
|
playbackMode: PlaybackMode;
|
|
74
74
|
direction: PlaybackDirection;
|
|
75
75
|
targetFps: number;
|
|
76
76
|
}
|
|
77
|
-
type RenderIntent =
|
|
77
|
+
type RenderIntent = "thumbnail" | "preview" | "export" | "still" | "analysis";
|
|
78
78
|
interface ResourceRequest {
|
|
79
79
|
id: string;
|
|
80
|
-
type:
|
|
80
|
+
type: "texture" | "buffer";
|
|
81
81
|
width?: number;
|
|
82
82
|
height?: number;
|
|
83
|
-
format:
|
|
84
|
-
usage:
|
|
83
|
+
format: "rgba8" | "rgba16f" | "rgba32f" | "r8";
|
|
84
|
+
usage: "render_target" | "shader_read" | "compute_write";
|
|
85
85
|
}
|
|
86
86
|
/**
|
|
87
87
|
* Single-frame resolved graph to run on the GPU queue.
|
|
@@ -101,7 +101,7 @@ interface FrameGraph {
|
|
|
101
101
|
resourceRequests: ResourceRequest[];
|
|
102
102
|
}
|
|
103
103
|
interface Command {
|
|
104
|
-
op:
|
|
104
|
+
op: "draw" | "compute" | "copy" | "clear" | "resolve";
|
|
105
105
|
shaderId: string;
|
|
106
106
|
inputs: string[];
|
|
107
107
|
outputs: string[];
|
|
@@ -141,7 +141,7 @@ interface ClipSegment {
|
|
|
141
141
|
interface TrackDefinition {
|
|
142
142
|
id: string;
|
|
143
143
|
name: string;
|
|
144
|
-
type:
|
|
144
|
+
type: "video" | "audio";
|
|
145
145
|
enabled: boolean;
|
|
146
146
|
clips: ClipSegment[];
|
|
147
147
|
effectGraph: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @clypra/engine — NLE Runtime & Pipeline Contract v2 (LEGACY DRAFT)
|
|
2
|
+
* @clypra-studio/engine — NLE Runtime & Pipeline Contract v2 (LEGACY DRAFT)
|
|
3
3
|
*
|
|
4
4
|
* @deprecated Prefer `v2/project`, `v2/graph`, `v2/planner`, and `v2/runtime`.
|
|
5
5
|
* Exported via `@clypra/engine/contract` for Rust/wgpu alignment only.
|
|
6
6
|
*/
|
|
7
|
-
type AssetType =
|
|
7
|
+
type AssetType = "video" | "audio" | "image" | "font" | "lut" | "model" | "generated";
|
|
8
8
|
interface AssetDescriptor {
|
|
9
9
|
id: string;
|
|
10
10
|
name: string;
|
|
@@ -29,7 +29,7 @@ interface MediaResolver {
|
|
|
29
29
|
prewarmAsset(assetId: string): Promise<void>;
|
|
30
30
|
releaseAsset(assetId: string): void;
|
|
31
31
|
}
|
|
32
|
-
type GraphDataType =
|
|
32
|
+
type GraphDataType = "Texture" | "Depth" | "MotionField" | "BoundingBoxes" | "Mask" | "Mesh" | "Particles" | "AudioSpectrum" | "Text" | "Markers";
|
|
33
33
|
interface GraphValue<T = any> {
|
|
34
34
|
type: GraphDataType;
|
|
35
35
|
payload: T;
|
|
@@ -65,23 +65,23 @@ interface GraphNode {
|
|
|
65
65
|
capabilities: EffectCapabilities;
|
|
66
66
|
profile: EffectProfile;
|
|
67
67
|
}
|
|
68
|
-
type ExecutionQuality =
|
|
69
|
-
type PlaybackMode =
|
|
70
|
-
type PlaybackDirection =
|
|
68
|
+
type ExecutionQuality = "draft" | "preview" | "export";
|
|
69
|
+
type PlaybackMode = "play" | "seek";
|
|
70
|
+
type PlaybackDirection = "forward" | "reverse";
|
|
71
71
|
interface ExecutionPolicy {
|
|
72
72
|
quality: ExecutionQuality;
|
|
73
73
|
playbackMode: PlaybackMode;
|
|
74
74
|
direction: PlaybackDirection;
|
|
75
75
|
targetFps: number;
|
|
76
76
|
}
|
|
77
|
-
type RenderIntent =
|
|
77
|
+
type RenderIntent = "thumbnail" | "preview" | "export" | "still" | "analysis";
|
|
78
78
|
interface ResourceRequest {
|
|
79
79
|
id: string;
|
|
80
|
-
type:
|
|
80
|
+
type: "texture" | "buffer";
|
|
81
81
|
width?: number;
|
|
82
82
|
height?: number;
|
|
83
|
-
format:
|
|
84
|
-
usage:
|
|
83
|
+
format: "rgba8" | "rgba16f" | "rgba32f" | "r8";
|
|
84
|
+
usage: "render_target" | "shader_read" | "compute_write";
|
|
85
85
|
}
|
|
86
86
|
/**
|
|
87
87
|
* Single-frame resolved graph to run on the GPU queue.
|
|
@@ -101,7 +101,7 @@ interface FrameGraph {
|
|
|
101
101
|
resourceRequests: ResourceRequest[];
|
|
102
102
|
}
|
|
103
103
|
interface Command {
|
|
104
|
-
op:
|
|
104
|
+
op: "draw" | "compute" | "copy" | "clear" | "resolve";
|
|
105
105
|
shaderId: string;
|
|
106
106
|
inputs: string[];
|
|
107
107
|
outputs: string[];
|
|
@@ -141,7 +141,7 @@ interface ClipSegment {
|
|
|
141
141
|
interface TrackDefinition {
|
|
142
142
|
id: string;
|
|
143
143
|
name: string;
|
|
144
|
-
type:
|
|
144
|
+
type: "video" | "audio";
|
|
145
145
|
enabled: boolean;
|
|
146
146
|
clips: ClipSegment[];
|
|
147
147
|
effectGraph: {
|
|
@@ -2516,10 +2516,7 @@ var PixiRenderer = class {
|
|
|
2516
2516
|
const scale = fitMode === "fit" ? Math.min(scaleX, scaleY) : Math.max(scaleX, scaleY);
|
|
2517
2517
|
sprite.width = texWidth * scale;
|
|
2518
2518
|
sprite.height = texHeight * scale;
|
|
2519
|
-
sprite.position.set(
|
|
2520
|
-
(canvasWidth - sprite.width) / 2,
|
|
2521
|
-
(canvasHeight - sprite.height) / 2
|
|
2522
|
-
);
|
|
2519
|
+
sprite.position.set((canvasWidth - sprite.width) / 2, (canvasHeight - sprite.height) / 2);
|
|
2523
2520
|
}
|
|
2524
2521
|
}
|
|
2525
2522
|
/**
|
|
@@ -2844,7 +2841,6 @@ var ParticleBurstEffect = {
|
|
|
2844
2841
|
{ key: "fade", label: "Fade out", type: "toggle", value: true }
|
|
2845
2842
|
],
|
|
2846
2843
|
mount(ctx) {
|
|
2847
|
-
;
|
|
2848
2844
|
ctx._particleContainer = new import_pixi2.Container();
|
|
2849
2845
|
ctx.container.addChild(ctx._particleContainer);
|
|
2850
2846
|
const particles = [];
|
|
@@ -3001,7 +2997,6 @@ var VHSCompositeEffect = {
|
|
|
3001
2997
|
draw();
|
|
3002
2998
|
ctx.container.addChild(band);
|
|
3003
2999
|
ctx._tickerFn = (ticker) => {
|
|
3004
|
-
;
|
|
3005
3000
|
ctx._bandY += ctx.params.bandSpeed * ticker.deltaTime;
|
|
3006
3001
|
if (ctx._bandY > ctx.height + 20) ctx._bandY = -20;
|
|
3007
3002
|
draw();
|