mulmocast 2.0.9 → 2.1.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.
@@ -3,13 +3,14 @@
3
3
  * (No Node.js built-ins like fs, path, dotenv, etc.)
4
4
  * Works in both Node.js and modern browsers.
5
5
  */
6
- import { MulmoCanvasDimension, MulmoBeat, Text2SpeechProvider, Text2ImageAgentInfo, Text2HtmlAgentInfo, BeatMediaType, MulmoPresentationStyle, SpeakerData, Text2ImageProvider, MulmoStudioContext } from "../types/index.js";
6
+ import { MulmoCanvasDimension, MulmoBeat, Text2SpeechProvider, Text2ImageAgentInfo, Text2HtmlAgentInfo, BeatMediaType, MulmoPresentationStyle, SpeakerData, Text2ImageProvider, MulmoStudioContext, MulmoTransition } from "../types/index.js";
7
7
  export declare const MulmoPresentationStyleMethods: {
8
8
  getCanvasSize(presentationStyle: MulmoPresentationStyle): MulmoCanvasDimension;
9
9
  getAllSpeechProviders(presentationStyle: MulmoPresentationStyle): Set<Text2SpeechProvider>;
10
10
  getTextSlideStyle(presentationStyle: MulmoPresentationStyle, beat: MulmoBeat): string;
11
11
  getDefaultSpeaker(presentationStyle: MulmoPresentationStyle): string;
12
12
  getSpeaker(context: MulmoStudioContext, beat: MulmoBeat, targetLang: string | undefined): SpeakerData;
13
+ getMovieTransition(context: MulmoStudioContext, beat: MulmoBeat): MulmoTransition | null;
13
14
  getText2ImageProvider(provider: Text2ImageProvider | undefined): Text2ImageProvider;
14
15
  getImageAgentInfo(presentationStyle: MulmoPresentationStyle, beat?: MulmoBeat): Text2ImageAgentInfo;
15
16
  getMovieAgentInfo(presentationStyle: MulmoPresentationStyle, beat?: MulmoBeat): {
@@ -20,11 +21,157 @@ export declare const MulmoPresentationStyleMethods: {
20
21
  fillOption?: {
21
22
  style: "aspectFit" | "aspectFill";
22
23
  } | undefined;
23
- speed?: number | undefined;
24
24
  transition?: {
25
- type: "fade" | "slideout_left";
25
+ type: "fade" | "slideout_left" | "slideout_right" | "slideout_up" | "slideout_down" | "slidein_left" | "slidein_right" | "slidein_up" | "slidein_down" | "wipeleft" | "wiperight" | "wipeup" | "wipedown" | "wipetl" | "wipetr" | "wipebl" | "wipebr";
26
26
  duration: number;
27
27
  } | undefined;
28
+ filters?: ({
29
+ type: "mono";
30
+ } | {
31
+ type: "sepia";
32
+ } | {
33
+ type: "brightness_contrast";
34
+ brightness: number;
35
+ contrast: number;
36
+ } | {
37
+ type: "hue";
38
+ hue: number;
39
+ saturation: number;
40
+ brightness: number;
41
+ } | {
42
+ type: "colorbalance";
43
+ rs: number;
44
+ gs: number;
45
+ bs: number;
46
+ rm: number;
47
+ gm: number;
48
+ bm: number;
49
+ rh: number;
50
+ gh: number;
51
+ bh: number;
52
+ } | {
53
+ type: "vibrance";
54
+ intensity: number;
55
+ } | {
56
+ type: "negate";
57
+ negate_alpha: boolean;
58
+ } | {
59
+ type: "colorhold";
60
+ color: string;
61
+ similarity: number;
62
+ blend: number;
63
+ } | {
64
+ type: "colorkey";
65
+ color: string;
66
+ similarity: number;
67
+ blend: number;
68
+ } | {
69
+ type: "blur";
70
+ radius: number;
71
+ power: number;
72
+ } | {
73
+ type: "gblur";
74
+ sigma: number;
75
+ } | {
76
+ type: "avgblur";
77
+ sizeX: number;
78
+ sizeY: number;
79
+ } | {
80
+ type: "unsharp";
81
+ luma_msize_x: number;
82
+ luma_msize_y: number;
83
+ luma_amount: number;
84
+ chroma_msize_x: number;
85
+ chroma_msize_y: number;
86
+ chroma_amount: number;
87
+ } | {
88
+ type: "edgedetect";
89
+ low: number;
90
+ high: number;
91
+ mode: "wires" | "colormix" | "canny";
92
+ } | {
93
+ type: "sobel";
94
+ planes: number;
95
+ scale: number;
96
+ delta: number;
97
+ } | {
98
+ type: "emboss";
99
+ } | {
100
+ type: "glitch";
101
+ intensity: number;
102
+ style: "blend" | "noise";
103
+ } | {
104
+ type: "grain";
105
+ intensity: number;
106
+ } | {
107
+ type: "hflip";
108
+ } | {
109
+ type: "vflip";
110
+ } | {
111
+ type: "rotate";
112
+ angle: number;
113
+ fillcolor: string;
114
+ } | {
115
+ type: "transpose";
116
+ dir: "cclock" | "clock" | "cclock_flip" | "clock_flip";
117
+ } | {
118
+ type: "vignette";
119
+ angle: number;
120
+ mode: "forward" | "backward";
121
+ x0?: number | undefined;
122
+ y0?: number | undefined;
123
+ } | {
124
+ type: "fade";
125
+ mode: "in" | "out";
126
+ start_frame: number;
127
+ nb_frames: number;
128
+ alpha: boolean;
129
+ color: string;
130
+ } | {
131
+ type: "pixelize";
132
+ width: number;
133
+ height: number;
134
+ mode: "avg" | "min" | "max";
135
+ } | {
136
+ type: "pseudocolor";
137
+ preset: "magma" | "inferno" | "plasma" | "viridis" | "turbo" | "cividis" | "range1" | "range2" | "shadows" | "highlights" | "solar" | "nominal" | "preferred" | "total";
138
+ } | {
139
+ type: "tmix";
140
+ frames: number;
141
+ weights?: string | undefined;
142
+ } | {
143
+ type: "lagfun";
144
+ decay: number;
145
+ planes: number;
146
+ } | {
147
+ type: "threshold";
148
+ planes: number;
149
+ } | {
150
+ type: "elbg";
151
+ codebook_length: number;
152
+ } | {
153
+ type: "lensdistortion";
154
+ k1: number;
155
+ k2: number;
156
+ } | {
157
+ type: "chromashift";
158
+ cbh: number;
159
+ cbv: number;
160
+ crh: number;
161
+ crv: number;
162
+ edge: "smear" | "wrap";
163
+ } | {
164
+ type: "deflicker";
165
+ size: number;
166
+ mode: "gm" | "am" | "hm" | "qm" | "cm" | "pm" | "median";
167
+ } | {
168
+ type: "dctdnoiz";
169
+ sigma: number;
170
+ } | {
171
+ type: "custom";
172
+ filter: string;
173
+ })[] | undefined;
174
+ speed?: number | undefined;
28
175
  };
29
176
  keyName: string;
30
177
  };
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { isNull } from "graphai";
7
7
  import { userAssert } from "../utils/utils.js";
8
- import { text2ImageProviderSchema, text2HtmlImageProviderSchema, text2MovieProviderSchema, text2SpeechProviderSchema, mulmoCanvasDimensionSchema, } from "../types/schema.js";
8
+ import { text2ImageProviderSchema, text2HtmlImageProviderSchema, text2MovieProviderSchema, text2SpeechProviderSchema, mulmoCanvasDimensionSchema, mulmoTransitionSchema, } from "../types/schema.js";
9
9
  import { provider2ImageAgent, provider2MovieAgent, provider2LLMAgent, provider2SoundEffectAgent, provider2LipSyncAgent, defaultProviders, } from "../utils/provider2agent.js";
10
10
  const defaultTextSlideStyles = [
11
11
  '*,*::before,*::after{box-sizing:border-box}body,h1,h2,h3,h4,p,figure,blockquote,dl,dd{margin:0}ul[role="list"],ol[role="list"]{list-style:none}html:focus-within{scroll-behavior:smooth}body{min-height:100vh;text-rendering:optimizeSpeed;line-height:1.5}a:not([class]){text-decoration-skip-ink:auto}img,picture{max-width:100%;display:block}input,button,textarea,select{font:inherit}@media(prefers-reduced-motion:reduce){html:focus-within{scroll-behavior:auto}*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}',
@@ -63,6 +63,12 @@ export const MulmoPresentationStyleMethods = {
63
63
  }
64
64
  return speaker;
65
65
  },
66
+ getMovieTransition(context, beat) {
67
+ const transitionData = beat.movieParams?.transition ?? context.presentationStyle.movieParams?.transition;
68
+ if (!transitionData)
69
+ return null;
70
+ return mulmoTransitionSchema.parse(transitionData);
71
+ },
66
72
  /* NOTE: This method is not used.
67
73
  getTTSModel(context: MulmoStudioContext, beat: MulmoBeat): string | undefined {
68
74
  const speaker = MulmoPresentationStyleMethods.getSpeaker(context, beat);