asciify-engine 4.0.0 → 4.2.0

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/studio.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as AmbientMotion } from './ambient-motion-CqF5-eZ2.cjs';
2
- export { M as STUDIO_MOTIONS } from './ambient-motion-CqF5-eZ2.cjs';
1
+ import { S as StudioSettings, a as StudioInput } from './model-CDiABFst.cjs';
2
+ export { B as BLEND_MODES, C as CHARACTER_SETS, D as DEFAULT_STUDIO_SETTINGS, b as DITHER_ALGORITHMS, c as DitherAlgorithm, d as STUDIO_CHARACTER_SETS, e as STUDIO_PALETTES, f as STUDIO_STYLES, g as StudioLight, h as StudioMask, i as StudioStyle, n as normalizeStudioSettings, p as parseStudioSettings, s as serializeStudioSettings, j as studioCrop, k as studioDimensions, l as studioGrid, u as updateStudioSettings } from './model-CDiABFst.cjs';
3
3
  import * as figlet_fonts_Wavy from 'figlet/fonts/Wavy';
4
4
  import * as figlet_fonts_Univers from 'figlet/fonts/Univers';
5
5
  import * as figlet_fonts_3_D from 'figlet/fonts/3-D';
@@ -21,136 +21,7 @@ import * as figlet_fonts_Big from 'figlet/fonts/Big';
21
21
  import * as figlet_fonts_Small from 'figlet/fonts/Small';
22
22
  import * as figlet_fonts_Slant from 'figlet/fonts/Slant';
23
23
  import * as figlet_fonts_Standard from 'figlet/fonts/Standard';
24
- export { C as CHARACTER_SETS, S as STUDIO_CHARACTER_SETS } from './characters-BNTu2oEF.cjs';
25
-
26
- /** Serializable, media-independent editing state. No DOM work at import time. */
27
- declare const STUDIO_STYLES: readonly ["ascii", "blocks", "braille", "dots", "lines", "cross", "diagonal", "diamond", "mixed", "pixel", "mosaic", "lego", "voxel", "disco", "dither"];
28
- type StudioStyle = (typeof STUDIO_STYLES)[number];
29
- declare const DITHER_ALGORITHMS: readonly ["none", "bayer2", "bayer4", "bayer8", "bayer16", "floyd-steinberg", "atkinson", "stucki", "sierra", "sierra-lite", "burkes", "jarvis", "halftone", "lines", "noise"];
30
- type DitherAlgorithm = (typeof DITHER_ALGORITHMS)[number];
31
- declare const BLEND_MODES: readonly ["source-over", "multiply", "screen", "overlay", "soft-light", "hard-light", "color-dodge", "color-burn", "hue", "saturation", "color", "luminosity"];
32
- declare const STUDIO_PALETTES: Record<string, readonly string[]>;
33
- interface StudioMask {
34
- kind: "rectangle" | "ellipse" | "brush";
35
- x: number;
36
- y: number;
37
- width: number;
38
- height: number;
39
- points?: [number, number][];
40
- size?: number;
41
- }
42
- interface StudioLight {
43
- x: number;
44
- y: number;
45
- radius: number;
46
- intensity: number;
47
- color: string;
48
- }
49
- interface StudioSettings {
50
- version: 1;
51
- aspectRatio: "original" | "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9";
52
- style: StudioStyle;
53
- cellSize: number;
54
- charset: string;
55
- colorMode: "accent" | "source" | "gray";
56
- ink: string;
57
- crop: {
58
- x: number;
59
- y: number;
60
- zoom: number;
61
- rotation: number;
62
- };
63
- backdrop: {
64
- mode: "solid" | "transparent" | "source" | "blurred" | "gradient";
65
- color: string;
66
- color2: string;
67
- blur: number;
68
- opacity: number;
69
- };
70
- color: {
71
- brightness: number;
72
- contrast: number;
73
- saturation: number;
74
- grayscale: number;
75
- tint: string;
76
- amount: number;
77
- blend: (typeof BLEND_MODES)[number];
78
- };
79
- dither: {
80
- algorithm: DitherAlgorithm;
81
- palette: string;
82
- colors: string[];
83
- amount: number;
84
- scale: number;
85
- threshold: number;
86
- motion: "none" | "drift" | "shimmer";
87
- speed: number;
88
- };
89
- mask: {
90
- enabled: boolean;
91
- invert: boolean;
92
- shapes: StudioMask[];
93
- };
94
- lights: StudioLight[];
95
- effects: {
96
- bloom: number;
97
- characterBloom: number;
98
- grain: number;
99
- dust: number;
100
- scanlines: number;
101
- crt: number;
102
- prism: number;
103
- vignette: number;
104
- glitch: number;
105
- pixelate: number;
106
- blur: number;
107
- blurType: "gaussian" | "directional" | "radial" | "progressive";
108
- angle: number;
109
- focus: number;
110
- halftone: number;
111
- };
112
- motion: {
113
- type: AmbientMotion;
114
- speed: number;
115
- };
116
- hover: {
117
- effect: "none" | "trail" | "water" | "contour" | "dissolve" | "silk" | "vortex";
118
- strength: number;
119
- radius: number;
120
- edgeSafe: boolean;
121
- };
122
- }
123
- declare const DEFAULT_STUDIO_SETTINGS: StudioSettings;
124
- /** Whitelist external settings; reject future versions instead of misinterpreting them. */
125
- declare function normalizeStudioSettings(input?: unknown): StudioSettings;
126
- declare function serializeStudioSettings(settings: StudioSettings): string;
127
- declare function parseStudioSettings(json: string): StudioSettings;
128
- declare function studioCrop(sw: number, sh: number, w: number, h: number, c: StudioSettings["crop"]): {
129
- width: number;
130
- height: number;
131
- x: number;
132
- y: number;
133
- scale: number;
134
- rotated: boolean;
135
- };
136
- /** Dimensions for the saved canvas ratio, including source rotation. */
137
- declare function studioDimensions(width: number, height: number, settings: StudioSettings): [number, number];
138
- /** Partial configuration for mounting and incremental updates. Arrays replace previous arrays. */
139
- type StudioInput = {
140
- [K in keyof StudioSettings]?: StudioSettings[K] extends readonly unknown[] ? StudioSettings[K] : StudioSettings[K] extends object ? Partial<StudioSettings[K]> : StudioSettings[K];
141
- };
142
- declare function updateStudioSettings(current: StudioSettings, patch: StudioInput): StudioSettings;
143
- /** Effective grid and usable cell-size range at a bounded render resolution.
144
- * pixelRatio preserves preview density when exporting at a larger resolution.
145
- */
146
- declare function studioGrid(width: number, height: number, settings: Pick<StudioSettings, 'style' | 'cellSize' | 'dither'>, maxCells?: number, pixelRatio?: number): {
147
- cell: number;
148
- rowHeight: number;
149
- columns: number;
150
- rows: number;
151
- minimum: number;
152
- limited: boolean;
153
- };
24
+ export { M as STUDIO_MOTIONS } from './ambient-motion-CqF5-eZ2.cjs';
154
25
 
155
26
  declare const STUDIO_LOOKS: {
156
27
  id: string;
@@ -248,6 +119,7 @@ declare function mountStudio(canvas: HTMLCanvasElement, source: File | string, o
248
119
  redraw(): void;
249
120
  readonly time: number;
250
121
  readonly paused: boolean;
122
+ setAdaptive(enabled: boolean): void;
251
123
  setBudget(cells: number): void;
252
124
  readonly pixelRatio: number;
253
125
  readonly maxCells: number;
@@ -267,6 +139,7 @@ declare function mountStudioMedia(canvas: HTMLCanvasElement, media: StudioMedia,
267
139
  redraw(): void;
268
140
  readonly time: number;
269
141
  readonly paused: boolean;
142
+ setAdaptive(enabled: boolean): void;
270
143
  setBudget(cells: number): void;
271
144
  readonly pixelRatio: number;
272
145
  readonly maxCells: number;
@@ -306,4 +179,4 @@ declare function createStudioText(text: string, font?: keyof typeof loaders, ink
306
179
  ascii: string;
307
180
  }>;
308
181
 
309
- export { BLEND_MODES, DEFAULT_STUDIO_SETTINGS, DITHER_ALGORITHMS, type DitherAlgorithm, type MountStudioOptions, STUDIO_LOOKS, STUDIO_PALETTES, STUDIO_STYLES, STUDIO_TEXT_FONTS, type StudioExportFormat, type StudioExportOptions, type StudioExportSource, type StudioInput, type StudioLight, type StudioMask, type StudioMedia, type StudioSettings, type StudioSource, type StudioStyle, createStudioRenderer, createStudioText, exportStudio, loadStudioMedia, mountStudio, mountStudioMedia, normalizeStudioSettings, parseStudioSettings, restyleStudio, serializeStudioSettings, studioCrop, studioDimensions, studioGrid, studioLook, studioSourceSize, updateStudioSettings };
182
+ export { type MountStudioOptions, STUDIO_LOOKS, STUDIO_TEXT_FONTS, type StudioExportFormat, type StudioExportOptions, type StudioExportSource, StudioInput, type StudioMedia, StudioSettings, type StudioSource, createStudioRenderer, createStudioText, exportStudio, loadStudioMedia, mountStudio, mountStudioMedia, restyleStudio, studioLook, studioSourceSize };
package/dist/studio.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as AmbientMotion } from './ambient-motion-CqF5-eZ2.js';
2
- export { M as STUDIO_MOTIONS } from './ambient-motion-CqF5-eZ2.js';
1
+ import { S as StudioSettings, a as StudioInput } from './model-BbKQNvhk.js';
2
+ export { B as BLEND_MODES, C as CHARACTER_SETS, D as DEFAULT_STUDIO_SETTINGS, b as DITHER_ALGORITHMS, c as DitherAlgorithm, d as STUDIO_CHARACTER_SETS, e as STUDIO_PALETTES, f as STUDIO_STYLES, g as StudioLight, h as StudioMask, i as StudioStyle, n as normalizeStudioSettings, p as parseStudioSettings, s as serializeStudioSettings, j as studioCrop, k as studioDimensions, l as studioGrid, u as updateStudioSettings } from './model-BbKQNvhk.js';
3
3
  import * as figlet_fonts_Wavy from 'figlet/fonts/Wavy';
4
4
  import * as figlet_fonts_Univers from 'figlet/fonts/Univers';
5
5
  import * as figlet_fonts_3_D from 'figlet/fonts/3-D';
@@ -21,136 +21,7 @@ import * as figlet_fonts_Big from 'figlet/fonts/Big';
21
21
  import * as figlet_fonts_Small from 'figlet/fonts/Small';
22
22
  import * as figlet_fonts_Slant from 'figlet/fonts/Slant';
23
23
  import * as figlet_fonts_Standard from 'figlet/fonts/Standard';
24
- export { C as CHARACTER_SETS, S as STUDIO_CHARACTER_SETS } from './characters-BNTu2oEF.js';
25
-
26
- /** Serializable, media-independent editing state. No DOM work at import time. */
27
- declare const STUDIO_STYLES: readonly ["ascii", "blocks", "braille", "dots", "lines", "cross", "diagonal", "diamond", "mixed", "pixel", "mosaic", "lego", "voxel", "disco", "dither"];
28
- type StudioStyle = (typeof STUDIO_STYLES)[number];
29
- declare const DITHER_ALGORITHMS: readonly ["none", "bayer2", "bayer4", "bayer8", "bayer16", "floyd-steinberg", "atkinson", "stucki", "sierra", "sierra-lite", "burkes", "jarvis", "halftone", "lines", "noise"];
30
- type DitherAlgorithm = (typeof DITHER_ALGORITHMS)[number];
31
- declare const BLEND_MODES: readonly ["source-over", "multiply", "screen", "overlay", "soft-light", "hard-light", "color-dodge", "color-burn", "hue", "saturation", "color", "luminosity"];
32
- declare const STUDIO_PALETTES: Record<string, readonly string[]>;
33
- interface StudioMask {
34
- kind: "rectangle" | "ellipse" | "brush";
35
- x: number;
36
- y: number;
37
- width: number;
38
- height: number;
39
- points?: [number, number][];
40
- size?: number;
41
- }
42
- interface StudioLight {
43
- x: number;
44
- y: number;
45
- radius: number;
46
- intensity: number;
47
- color: string;
48
- }
49
- interface StudioSettings {
50
- version: 1;
51
- aspectRatio: "original" | "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9";
52
- style: StudioStyle;
53
- cellSize: number;
54
- charset: string;
55
- colorMode: "accent" | "source" | "gray";
56
- ink: string;
57
- crop: {
58
- x: number;
59
- y: number;
60
- zoom: number;
61
- rotation: number;
62
- };
63
- backdrop: {
64
- mode: "solid" | "transparent" | "source" | "blurred" | "gradient";
65
- color: string;
66
- color2: string;
67
- blur: number;
68
- opacity: number;
69
- };
70
- color: {
71
- brightness: number;
72
- contrast: number;
73
- saturation: number;
74
- grayscale: number;
75
- tint: string;
76
- amount: number;
77
- blend: (typeof BLEND_MODES)[number];
78
- };
79
- dither: {
80
- algorithm: DitherAlgorithm;
81
- palette: string;
82
- colors: string[];
83
- amount: number;
84
- scale: number;
85
- threshold: number;
86
- motion: "none" | "drift" | "shimmer";
87
- speed: number;
88
- };
89
- mask: {
90
- enabled: boolean;
91
- invert: boolean;
92
- shapes: StudioMask[];
93
- };
94
- lights: StudioLight[];
95
- effects: {
96
- bloom: number;
97
- characterBloom: number;
98
- grain: number;
99
- dust: number;
100
- scanlines: number;
101
- crt: number;
102
- prism: number;
103
- vignette: number;
104
- glitch: number;
105
- pixelate: number;
106
- blur: number;
107
- blurType: "gaussian" | "directional" | "radial" | "progressive";
108
- angle: number;
109
- focus: number;
110
- halftone: number;
111
- };
112
- motion: {
113
- type: AmbientMotion;
114
- speed: number;
115
- };
116
- hover: {
117
- effect: "none" | "trail" | "water" | "contour" | "dissolve" | "silk" | "vortex";
118
- strength: number;
119
- radius: number;
120
- edgeSafe: boolean;
121
- };
122
- }
123
- declare const DEFAULT_STUDIO_SETTINGS: StudioSettings;
124
- /** Whitelist external settings; reject future versions instead of misinterpreting them. */
125
- declare function normalizeStudioSettings(input?: unknown): StudioSettings;
126
- declare function serializeStudioSettings(settings: StudioSettings): string;
127
- declare function parseStudioSettings(json: string): StudioSettings;
128
- declare function studioCrop(sw: number, sh: number, w: number, h: number, c: StudioSettings["crop"]): {
129
- width: number;
130
- height: number;
131
- x: number;
132
- y: number;
133
- scale: number;
134
- rotated: boolean;
135
- };
136
- /** Dimensions for the saved canvas ratio, including source rotation. */
137
- declare function studioDimensions(width: number, height: number, settings: StudioSettings): [number, number];
138
- /** Partial configuration for mounting and incremental updates. Arrays replace previous arrays. */
139
- type StudioInput = {
140
- [K in keyof StudioSettings]?: StudioSettings[K] extends readonly unknown[] ? StudioSettings[K] : StudioSettings[K] extends object ? Partial<StudioSettings[K]> : StudioSettings[K];
141
- };
142
- declare function updateStudioSettings(current: StudioSettings, patch: StudioInput): StudioSettings;
143
- /** Effective grid and usable cell-size range at a bounded render resolution.
144
- * pixelRatio preserves preview density when exporting at a larger resolution.
145
- */
146
- declare function studioGrid(width: number, height: number, settings: Pick<StudioSettings, 'style' | 'cellSize' | 'dither'>, maxCells?: number, pixelRatio?: number): {
147
- cell: number;
148
- rowHeight: number;
149
- columns: number;
150
- rows: number;
151
- minimum: number;
152
- limited: boolean;
153
- };
24
+ export { M as STUDIO_MOTIONS } from './ambient-motion-CqF5-eZ2.js';
154
25
 
155
26
  declare const STUDIO_LOOKS: {
156
27
  id: string;
@@ -248,6 +119,7 @@ declare function mountStudio(canvas: HTMLCanvasElement, source: File | string, o
248
119
  redraw(): void;
249
120
  readonly time: number;
250
121
  readonly paused: boolean;
122
+ setAdaptive(enabled: boolean): void;
251
123
  setBudget(cells: number): void;
252
124
  readonly pixelRatio: number;
253
125
  readonly maxCells: number;
@@ -267,6 +139,7 @@ declare function mountStudioMedia(canvas: HTMLCanvasElement, media: StudioMedia,
267
139
  redraw(): void;
268
140
  readonly time: number;
269
141
  readonly paused: boolean;
142
+ setAdaptive(enabled: boolean): void;
270
143
  setBudget(cells: number): void;
271
144
  readonly pixelRatio: number;
272
145
  readonly maxCells: number;
@@ -306,4 +179,4 @@ declare function createStudioText(text: string, font?: keyof typeof loaders, ink
306
179
  ascii: string;
307
180
  }>;
308
181
 
309
- export { BLEND_MODES, DEFAULT_STUDIO_SETTINGS, DITHER_ALGORITHMS, type DitherAlgorithm, type MountStudioOptions, STUDIO_LOOKS, STUDIO_PALETTES, STUDIO_STYLES, STUDIO_TEXT_FONTS, type StudioExportFormat, type StudioExportOptions, type StudioExportSource, type StudioInput, type StudioLight, type StudioMask, type StudioMedia, type StudioSettings, type StudioSource, type StudioStyle, createStudioRenderer, createStudioText, exportStudio, loadStudioMedia, mountStudio, mountStudioMedia, normalizeStudioSettings, parseStudioSettings, restyleStudio, serializeStudioSettings, studioCrop, studioDimensions, studioGrid, studioLook, studioSourceSize, updateStudioSettings };
182
+ export { type MountStudioOptions, STUDIO_LOOKS, STUDIO_TEXT_FONTS, type StudioExportFormat, type StudioExportOptions, type StudioExportSource, StudioInput, type StudioMedia, StudioSettings, type StudioSource, createStudioRenderer, createStudioText, exportStudio, loadStudioMedia, mountStudio, mountStudioMedia, restyleStudio, studioLook, studioSourceSize };