openvideo 0.2.16 → 0.2.17

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.
@@ -1,7 +1,9 @@
1
1
  import { IClip, ITransitionInfo } from './clips';
2
+ import { ColorAdjustment } from './utils/color-adjustment';
2
3
  interface BaseClipJSON {
3
4
  id?: string;
4
5
  name?: string;
6
+ metadata?: Record<string, any>;
5
7
  effects?: Array<{
6
8
  id: string;
7
9
  key: string;
@@ -31,6 +33,7 @@ interface BaseClipJSON {
31
33
  transition?: ITransitionInfo;
32
34
  style?: any;
33
35
  locked?: boolean;
36
+ colorAdjustment?: ColorAdjustment;
34
37
  animation?: {
35
38
  keyFrames: Record<string, Partial<{
36
39
  x: number;
@@ -1,6 +1,7 @@
1
1
  import { default as EventEmitter } from '../event-emitter';
2
2
  import { IAnimation, AnimationTransform } from '../animation';
3
3
  import { IChromaKeyOpts } from '../clips/iclip';
4
+ import { ColorAdjustment } from '../utils/color-adjustment';
4
5
  type IRectBaseProps = any;
5
6
  interface IAnimationOpts {
6
7
  duration: number;
@@ -149,6 +150,7 @@ export declare abstract class BaseSprite<T extends BaseSpriteEvents = BaseSprite
149
150
  * Chroma key settings (green screen removal)
150
151
  */
151
152
  chromaKey: IChromaKeyOpts;
153
+ colorAdjustment: ColorAdjustment;
152
154
  /**
153
155
  * Styling properties (e.g., stroke, dropShadow, borderRadius)
154
156
  * This is a generic object to hold visual styles across different clip types
@@ -49,6 +49,7 @@ export declare class PixiSpriteRenderer {
49
49
  private applyBlur;
50
50
  private applyMotionBlur;
51
51
  private applyBrightness;
52
+ private applySelectiveHsl;
52
53
  private applyChromaKey;
53
54
  updateTransforms(): void;
54
55
  getSprite(): Sprite | null;
package/dist/studio.d.ts CHANGED
@@ -333,6 +333,23 @@ export declare class Studio extends EventEmitter<StudioEvents> {
333
333
  * Move to the previous frame
334
334
  */
335
335
  framePrev(): Promise<void>;
336
+ /**
337
+ * Renders the frame at the given time and returns it as a base64-encoded PNG.
338
+ *
339
+ * The artboard is temporarily reset to 1:1 scale during extraction so the
340
+ * output image always matches the project's configured width × height,
341
+ * regardless of the current viewport zoom.
342
+ *
343
+ * @param timeMs Time in milliseconds
344
+ * @returns Base64 data-URL string (e.g. "data:image/png;base64,...")
345
+ *
346
+ * @example
347
+ * await studio.ready;
348
+ * const frame = await studio.renderFrame(1500); // frame at 1.5 s
349
+ * const img = document.createElement('img');
350
+ * img.src = frame;
351
+ */
352
+ renderFrame(timeMs: number): Promise<string>;
336
353
  /**
337
354
  * Get current playback time (in microseconds)
338
355
  */
@@ -0,0 +1,53 @@
1
+ import { ColorMatrixFilter } from 'pixi.js';
2
+ export interface ColorAdjustmentBasic {
3
+ saturation?: number;
4
+ temperature?: number;
5
+ hue?: number;
6
+ brightness?: number;
7
+ contrast?: number;
8
+ shine?: number;
9
+ highlight?: number;
10
+ shadow?: number;
11
+ sharpness?: number;
12
+ vignette?: number;
13
+ fade?: number;
14
+ grain?: number;
15
+ }
16
+ export interface ColorAdjustmentHsl {
17
+ hue?: number;
18
+ saturation?: number;
19
+ lightness?: number;
20
+ selectedColor?: string;
21
+ byColor?: Record<string, {
22
+ hue?: number;
23
+ saturation?: number;
24
+ lightness?: number;
25
+ }>;
26
+ }
27
+ export interface CurvePoint {
28
+ x: number;
29
+ y: number;
30
+ }
31
+ export interface ColorAdjustmentCurves {
32
+ rgb?: CurvePoint[];
33
+ red?: CurvePoint[];
34
+ green?: CurvePoint[];
35
+ blue?: CurvePoint[];
36
+ }
37
+ export interface ColorAdjustment {
38
+ enabled?: boolean;
39
+ type?: "basic" | "hsl" | "curves";
40
+ basic?: ColorAdjustmentBasic;
41
+ hsl?: ColorAdjustmentHsl;
42
+ curves?: ColorAdjustmentCurves;
43
+ }
44
+ export interface ActiveSelectiveHslAdjustment {
45
+ targetColor: string;
46
+ hue: number;
47
+ saturation: number;
48
+ lightness: number;
49
+ }
50
+ export declare function hasColorAdjustment(adjustment?: ColorAdjustment): boolean;
51
+ export declare function getActiveSelectiveHsl(adjustment?: ColorAdjustment): ActiveSelectiveHslAdjustment | null;
52
+ export declare function getAllSelectiveHsl(adjustment?: ColorAdjustment): ActiveSelectiveHslAdjustment[];
53
+ export declare function applyColorAdjustmentToMatrix(matrix: ColorMatrixFilter, adjustment?: ColorAdjustment, animationBrightnessMultiplier?: number): void;
@@ -1,4 +1,4 @@
1
- import { e as a, R as e, T as d, G as i, b as s, M as t, c as p, d as P, f as n, g as r, B as T, H as l, h as c, i as m, N as x, j as S, k as o } from "./index-T-Me9eJ5.js";
1
+ import { e as a, R as e, T as d, G as i, b as s, M as t, c as p, d as P, f as n, g as r, B as T, H as l, h as c, i as m, N as x, j as S, k as o } from "./index-Gj63TxQW.js";
2
2
  a.add(e);
3
3
  a.add(d);
4
4
  a.add(i);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openvideo",
3
- "version": "0.2.16",
3
+ "version": "0.2.17",
4
4
  "description": "Video rendering and processing library",
5
5
  "type": "module",
6
6
  "publishConfig": {