@pixagram/renderart 0.1.2 → 0.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/README.md CHANGED
@@ -12,7 +12,7 @@ All engines support:
12
12
  - ⚡ **GPU acceleration** via WebGL2 (CRT, HEX)
13
13
  - 🦀 **CPU fallback** via Rust/WASM (all engines)
14
14
  - 🎨 **Customizable presets** and fine-grained options
15
- - 📦 **Zero dependencies** - everything bundled
15
+ - 📦 **Zero dependencies** in core bundle
16
16
 
17
17
  ## Installation
18
18
 
@@ -22,42 +22,76 @@ npm install @pixagram/renderart
22
22
 
23
23
  ## Quick Start
24
24
 
25
+ ### GPU-Only Mode (Simplest - No WASM)
26
+
25
27
  ```typescript
26
28
  import { RenderArt } from '@pixagram/renderart';
27
29
 
28
- // Initialize (loads WASM if needed)
29
- const renderer = await RenderArt.create();
30
+ // Create GPU-only renderer (no WASM loading required)
31
+ const renderer = RenderArt.createGpuOnly();
30
32
 
31
33
  // Get your image data
32
34
  const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
33
35
 
34
- // Apply CRT effect
35
- const crtResult = await renderer.crt.render(imageData, { scale: 3 });
36
-
37
- // Apply hexagonal transformation
38
- const hexResult = await renderer.hex.render(imageData, { scale: 16 });
36
+ // Apply CRT effect (GPU)
37
+ const crtResult = renderer.crt.renderSync(imageData, { scale: 3 });
39
38
 
40
- // Apply xBRZ scaling
41
- const xbrzResult = await renderer.xbrz.render(imageData, { scale: 4 });
39
+ // Apply HEX effect (GPU)
40
+ const hexResult = renderer.hex.renderSync(imageData, { scale: 16 });
42
41
 
43
42
  // Use the result
44
43
  ctx.putImageData(new ImageData(crtResult.data, crtResult.width, crtResult.height), 0, 0);
45
44
  ```
46
45
 
47
- ## API Reference
46
+ ### With CPU Fallback (Requires WASM)
47
+
48
+ ```typescript
49
+ import { RenderArt, initWasm } from '@pixagram/renderart';
50
+ import init, * as wasm from '@pixagram/renderart/pkg/renderart_wasm.js';
51
+
52
+ // Initialize WASM module first
53
+ await initWasm(() => init(), wasm);
54
+
55
+ // Create renderer with CPU fallback
56
+ const renderer = RenderArt.create();
48
57
 
49
- ### RenderArt
58
+ // Now all engines work, including XBRZ (CPU-only)
59
+ const xbrzResult = renderer.xbrz.render(imageData, { scale: 4 });
60
+ ```
50
61
 
51
- Main class providing access to all rendering engines.
62
+ ### Direct GPU Renderer Usage
52
63
 
53
64
  ```typescript
54
- const renderer = await RenderArt.create();
65
+ import { CrtGpuRenderer, HexGpuRenderer } from '@pixagram/renderart';
66
+
67
+ // Use GPU renderers directly (no WASM needed)
68
+ const crt = CrtGpuRenderer.create();
69
+ const result = crt.render(imageData, {
70
+ scale: 3,
71
+ warpX: 0.02,
72
+ scanOpacity: 0.6,
73
+ });
74
+
75
+ // Clean up
76
+ crt.dispose();
77
+ ```
78
+
79
+ ## API Reference
80
+
81
+ ### RenderArt (Unified API)
82
+
83
+ ```typescript
84
+ // GPU-only mode
85
+ const renderer = RenderArt.createGpuOnly();
86
+
87
+ // With CPU fallback (requires WASM init first)
88
+ const renderer = RenderArt.create();
55
89
 
56
90
  // Access capabilities
57
91
  console.log(renderer.capabilities);
58
92
  // { gpu: true, cpu: true, maxTextureSize: 16384, recommendedBackend: 'gpu' }
59
93
 
60
- // Cleanup when done
94
+ // Cleanup
61
95
  renderer.dispose();
62
96
  ```
63
97
 
@@ -65,13 +99,13 @@ renderer.dispose();
65
99
 
66
100
  ```typescript
67
101
  // With options
68
- const result = await renderer.crt.render(imageData, {
102
+ const result = renderer.crt.render(imageData, {
69
103
  scale: 3, // 2-32 (default: 3)
70
- warpX: 0.015, // Horizontal curvature (default: 0.015)
71
- warpY: 0.02, // Vertical curvature (default: 0.02)
72
- scanHardness: -4.0, // Scanline sharpness (default: -4.0)
73
- scanOpacity: 0.5, // Scanline intensity (default: 0.5)
74
- maskOpacity: 0.3, // Shadow mask intensity (default: 0.3)
104
+ warpX: 0.015, // Horizontal curvature
105
+ warpY: 0.02, // Vertical curvature
106
+ scanHardness: -4.0, // Scanline sharpness
107
+ scanOpacity: 0.5, // Scanline intensity
108
+ maskOpacity: 0.3, // Shadow mask intensity
75
109
  enableWarp: true, // Enable barrel distortion
76
110
  enableScanlines: true, // Enable scanlines
77
111
  enableMask: true, // Enable shadow mask
@@ -79,7 +113,7 @@ const result = await renderer.crt.render(imageData, {
79
113
  });
80
114
 
81
115
  // With preset
82
- const result = await renderer.crt.render(imageData, 'authentic');
116
+ const result = renderer.crt.render(imageData, 'authentic');
83
117
  // Presets: 'default', 'authentic', 'subtle', 'flat'
84
118
 
85
119
  // Synchronous GPU-only rendering
@@ -90,63 +124,60 @@ const result = renderer.crt.renderSync(imageData, { scale: 3 });
90
124
 
91
125
  ```typescript
92
126
  // With options
93
- const result = await renderer.hex.render(imageData, {
127
+ const result = renderer.hex.render(imageData, {
94
128
  scale: 16, // 2-32 (default: 16)
95
129
  orientation: 'flat-top', // 'flat-top' or 'pointy-top'
96
130
  drawBorders: true, // Draw hexagon borders
97
- borderColor: '#282828', // Border color (CSS or 0xRRGGBBAA)
98
- borderThickness: 1, // Border thickness in pixels
99
- backgroundColor: 'transparent', // Background color
131
+ borderColor: '#282828', // Border color
132
+ borderThickness: 1, // Border thickness
133
+ backgroundColor: 'transparent',
100
134
  backend: 'auto',
101
135
  });
102
136
 
103
137
  // With preset
104
- const result = await renderer.hex.render(imageData, 'bordered');
138
+ const result = renderer.hex.render(imageData, 'bordered');
105
139
  // Presets: 'default', 'bordered', 'pointy'
106
140
 
107
141
  // Get output dimensions
108
142
  const dims = renderer.hex.getDimensions(64, 64, { scale: 16 });
109
- // { width: 123, height: 134 }
110
143
  ```
111
144
 
112
- ### XBRZ Engine
145
+ ### XBRZ Engine (CPU Only)
113
146
 
114
147
  ```typescript
115
- // With options
116
- const result = await renderer.xbrz.render(imageData, {
148
+ // Requires WASM initialization
149
+ const result = renderer.xbrz.render(imageData, {
117
150
  scale: 4, // 2-6 (default: 2)
118
- luminanceWeight: 1.0, // Edge detection weight
119
- equalColorTolerance: 30, // Color matching tolerance
120
- dominantDirectionThreshold: 4.4, // Edge direction threshold
121
- steepDirectionThreshold: 2.2, // Steep edge threshold
151
+ luminanceWeight: 1.0,
152
+ equalColorTolerance: 30,
153
+ dominantDirectionThreshold: 4.4,
154
+ steepDirectionThreshold: 2.2,
122
155
  });
123
156
 
124
157
  // With preset
125
- const result = await renderer.xbrz.render(imageData, 'sharp');
158
+ const result = renderer.xbrz.render(imageData, 'sharp');
126
159
  // Presets: 'default', 'sharp', 'smooth'
127
-
128
- // Get output dimensions
129
- const dims = renderer.xbrz.getDimensions(64, 64, 4);
130
- // { width: 256, height: 256 }
131
160
  ```
132
161
 
133
162
  ## Backend Selection
134
163
 
135
- Each engine automatically selects the best available backend:
136
-
137
164
  | Engine | GPU (WebGL2) | CPU (WASM) |
138
165
  |--------|--------------|------------|
139
166
  | CRT | ✅ Primary | ✅ Fallback |
140
167
  | HEX | ✅ Primary | ✅ Fallback |
141
168
  | XBRZ | ❌ N/A | ✅ Only |
142
169
 
143
- Force a specific backend:
144
- ```typescript
145
- // Force GPU
146
- const result = await renderer.crt.render(imageData, { backend: 'gpu' });
170
+ ## WASM Loading with Custom Path
147
171
 
148
- // Force CPU
149
- const result = await renderer.crt.render(imageData, { backend: 'cpu' });
172
+ ```typescript
173
+ import { initWasm } from '@pixagram/renderart';
174
+ import init, * as wasm from '@pixagram/renderart/pkg/renderart_wasm.js';
175
+
176
+ // Load WASM from custom URL
177
+ await initWasm(
178
+ () => init('/static/wasm/renderart_wasm_bg.wasm'),
179
+ wasm
180
+ );
150
181
  ```
151
182
 
152
183
  ## Browser Support
@@ -160,20 +191,13 @@ Requires:
160
191
  - WebGL2 for GPU rendering
161
192
  - WebAssembly for CPU rendering
162
193
 
163
- ## Performance Tips
164
-
165
- 1. **Reuse the renderer instance** - initialization is expensive
166
- 2. **Use GPU when available** - significantly faster for CRT and HEX
167
- 3. **Choose appropriate scale** - larger scales need more GPU memory
168
- 4. **Consider XBRZ scale limits** - 2-6x only, higher factors use more CPU
169
-
170
194
  ## Building from Source
171
195
 
172
196
  ```bash
173
197
  # Install dependencies
174
198
  npm install
175
199
 
176
- # Build WASM module
200
+ # Build WASM module (requires Rust + wasm-pack)
177
201
  npm run build:wasm
178
202
 
179
203
  # Build TypeScript
@@ -181,16 +205,8 @@ npm run build:ts
181
205
 
182
206
  # Full build
183
207
  npm run build
184
-
185
- # Run tests
186
- npm test
187
208
  ```
188
209
 
189
- Requirements:
190
- - Node.js 16+
191
- - Rust toolchain
192
- - wasm-pack
193
-
194
210
  ## License
195
211
 
196
212
  MIT © Pixagram SA
package/dist/index.d.mts CHANGED
@@ -191,18 +191,45 @@ declare const HEX_PRESETS: Record<string, Partial<HexOptions>>;
191
191
  * WASM Module Loader
192
192
  *
193
193
  * Handles loading and initialization of the Rust WASM module.
194
+ * Requires explicit initialization - does NOT auto-import WASM.
195
+ *
196
+ * @example
197
+ * ```typescript
198
+ * import { initWasm } from '@pixagram/renderart';
199
+ * import init from '@pixagram/renderart/pkg/renderart_wasm.js';
200
+ *
201
+ * // Initialize with the WASM module
202
+ * await initWasm(init);
203
+ * ```
194
204
  */
195
205
 
196
- /** Load WASM module */
197
- declare function loadWasm(): Promise<any>;
206
+ /**
207
+ * Initialize WASM module
208
+ *
209
+ * @param wasmInit - The init function from renderart_wasm.js
210
+ * @param wasmUrl - Optional URL to the .wasm file (for custom loading)
211
+ *
212
+ * @example
213
+ * ```typescript
214
+ * // Option 1: Let wasm-pack handle loading
215
+ * import init, * as wasm from '@pixagram/renderart/pkg/renderart_wasm.js';
216
+ * await initWasm(init, wasm);
217
+ *
218
+ * // Option 2: With custom WASM URL
219
+ * import init, * as wasm from '@pixagram/renderart/pkg/renderart_wasm.js';
220
+ * await initWasm(() => init('/path/to/renderart_wasm_bg.wasm'), wasm);
221
+ * ```
222
+ */
223
+ declare function initWasm(wasmInit: () => Promise<void>, wasm: any): Promise<void>;
198
224
  /** Check if WASM is loaded */
199
225
  declare function isWasmLoaded(): boolean;
226
+ /** Get the WASM module (throws if not initialized) */
227
+ declare function getWasmModule(): any;
200
228
  /** CRT CPU Renderer using WASM */
201
229
  declare class CrtCpuRenderer {
202
230
  private ready;
203
- /** Create and initialize renderer */
204
- static create(): Promise<CrtCpuRenderer>;
205
- private init;
231
+ /** Create renderer (WASM must be initialized first via initWasm) */
232
+ static create(): CrtCpuRenderer;
206
233
  /** Check if renderer is ready */
207
234
  isReady(): boolean;
208
235
  /** Render CRT effect */
@@ -213,9 +240,8 @@ declare class CrtCpuRenderer {
213
240
  /** HEX CPU Renderer using WASM */
214
241
  declare class HexCpuRenderer {
215
242
  private ready;
216
- /** Create and initialize renderer */
217
- static create(): Promise<HexCpuRenderer>;
218
- private init;
243
+ /** Create renderer (WASM must be initialized first via initWasm) */
244
+ static create(): HexCpuRenderer;
219
245
  /** Check if renderer is ready */
220
246
  isReady(): boolean;
221
247
  /** Render hexagonal effect */
@@ -231,9 +257,8 @@ declare class HexCpuRenderer {
231
257
  /** XBRZ CPU Renderer using WASM */
232
258
  declare class XbrzCpuRenderer {
233
259
  private ready;
234
- /** Create and initialize renderer */
235
- static create(): Promise<XbrzCpuRenderer>;
236
- private init;
260
+ /** Create renderer (WASM must be initialized first via initWasm) */
261
+ static create(): XbrzCpuRenderer;
237
262
  /** Check if renderer is ready */
238
263
  isReady(): boolean;
239
264
  /** Render xBRZ scaling */
@@ -249,6 +274,20 @@ declare const XBRZ_PRESETS: Record<string, Partial<XbrzOptions>>;
249
274
  *
250
275
  * Provides a unified API for all rendering engines (CRT, HEX, XBRZ)
251
276
  * with automatic backend selection (GPU/CPU).
277
+ *
278
+ * GPU renderers work standalone. CPU renderers require WASM initialization.
279
+ *
280
+ * @example
281
+ * ```typescript
282
+ * // GPU-only (no WASM needed)
283
+ * const renderer = RenderArt.createGpuOnly();
284
+ * const result = renderer.crt.renderSync(imageData, { scale: 3 });
285
+ *
286
+ * // With CPU fallback (requires WASM init)
287
+ * import init, * as wasm from '@pixagram/renderart/pkg/renderart_wasm.js';
288
+ * await initWasm(init, wasm);
289
+ * const renderer = RenderArt.create();
290
+ * ```
252
291
  */
253
292
 
254
293
  /** CRT rendering engine with GPU/CPU backend support */
@@ -263,9 +302,9 @@ declare class CrtEngine {
263
302
  /** Initialize CPU renderer */
264
303
  private ensureCpu;
265
304
  /** Render with automatic backend selection */
266
- render(input: ImageInput | ImageData, options?: CrtOptions): Promise<ImageOutput>;
305
+ render(input: ImageInput | ImageData, options?: CrtOptions): ImageOutput;
267
306
  /** Render with preset */
268
- render(input: ImageInput | ImageData, preset: CrtPreset, overrides?: Partial<CrtOptions>): Promise<ImageOutput>;
307
+ render(input: ImageInput | ImageData, preset: CrtPreset, overrides?: Partial<CrtOptions>): ImageOutput;
269
308
  /** Render synchronously (GPU only) */
270
309
  renderSync(input: ImageInput | ImageData, options?: CrtOptions): ImageOutput;
271
310
  /** Dispose resources */
@@ -281,9 +320,9 @@ declare class HexEngine {
281
320
  private ensureGpu;
282
321
  private ensureCpu;
283
322
  /** Render with automatic backend selection */
284
- render(input: ImageInput | ImageData, options?: HexOptions): Promise<ImageOutput>;
323
+ render(input: ImageInput | ImageData, options?: HexOptions): ImageOutput;
285
324
  /** Render with preset */
286
- render(input: ImageInput | ImageData, preset: HexPreset, overrides?: Partial<HexOptions>): Promise<ImageOutput>;
325
+ render(input: ImageInput | ImageData, preset: HexPreset, overrides?: Partial<HexOptions>): ImageOutput;
287
326
  /** Render synchronously (GPU only) */
288
327
  renderSync(input: ImageInput | ImageData, options?: HexOptions): ImageOutput;
289
328
  /** Get output dimensions */
@@ -300,9 +339,9 @@ declare class XbrzEngine {
300
339
  constructor(cpuAvailable: boolean);
301
340
  private ensureCpu;
302
341
  /** Render xBRZ scaling */
303
- render(input: ImageInput | ImageData, options?: XbrzOptions): Promise<ImageOutput>;
342
+ render(input: ImageInput | ImageData, options?: XbrzOptions): ImageOutput;
304
343
  /** Render with preset */
305
- render(input: ImageInput | ImageData, preset: XbrzPreset, overrides?: Partial<XbrzOptions>): Promise<ImageOutput>;
344
+ render(input: ImageInput | ImageData, preset: XbrzPreset, overrides?: Partial<XbrzOptions>): ImageOutput;
306
345
  /** Get output dimensions */
307
346
  getDimensions(srcWidth: number, srcHeight: number, scale?: number): {
308
347
  width: number;
@@ -320,12 +359,21 @@ declare class RenderArt {
320
359
  readonly xbrz: XbrzEngine;
321
360
  private _capabilities;
322
361
  private constructor();
323
- /** Create and initialize RenderArt instance */
324
- static create(): Promise<RenderArt>;
362
+ /**
363
+ * Create RenderArt instance
364
+ * GPU renderers always available if WebGL2 supported.
365
+ * CPU renderers require WASM to be initialized via initWasm() first.
366
+ */
367
+ static create(): RenderArt;
368
+ /**
369
+ * Create GPU-only RenderArt instance (no WASM required)
370
+ * CPU fallback will not be available.
371
+ */
372
+ static createGpuOnly(): RenderArt;
325
373
  /** Get renderer capabilities */
326
374
  get capabilities(): RendererCapabilities;
327
375
  /** Dispose all resources */
328
376
  dispose(): void;
329
377
  }
330
378
 
331
- export { type Backend, CRT_PRESETS, CrtCpuRenderer, CrtGpuRenderer, type CrtOptions, type CrtPreset, HEX_PRESETS, HexCpuRenderer, HexGpuRenderer, type HexOptions, type HexOrientation, type HexPreset, type ImageInput, type ImageOutput, type PixelData, RenderArt, type RenderStats, type Renderer, type RendererCapabilities, XBRZ_PRESETS, XbrzCpuRenderer, type XbrzOptions, type XbrzPreset, hexGetDimensions, isWasmLoaded, loadWasm };
379
+ export { type Backend, CRT_PRESETS, CrtCpuRenderer, CrtEngine, CrtGpuRenderer, type CrtOptions, type CrtPreset, HEX_PRESETS, HexCpuRenderer, HexEngine, HexGpuRenderer, type HexOptions, type HexOrientation, type HexPreset, type ImageInput, type ImageOutput, type PixelData, RenderArt, type RenderStats, type Renderer, type RendererCapabilities, XBRZ_PRESETS, XbrzCpuRenderer, XbrzEngine, type XbrzOptions, type XbrzPreset, getWasmModule, hexGetDimensions, initWasm, isWasmLoaded };
package/dist/index.d.ts CHANGED
@@ -191,18 +191,45 @@ declare const HEX_PRESETS: Record<string, Partial<HexOptions>>;
191
191
  * WASM Module Loader
192
192
  *
193
193
  * Handles loading and initialization of the Rust WASM module.
194
+ * Requires explicit initialization - does NOT auto-import WASM.
195
+ *
196
+ * @example
197
+ * ```typescript
198
+ * import { initWasm } from '@pixagram/renderart';
199
+ * import init from '@pixagram/renderart/pkg/renderart_wasm.js';
200
+ *
201
+ * // Initialize with the WASM module
202
+ * await initWasm(init);
203
+ * ```
194
204
  */
195
205
 
196
- /** Load WASM module */
197
- declare function loadWasm(): Promise<any>;
206
+ /**
207
+ * Initialize WASM module
208
+ *
209
+ * @param wasmInit - The init function from renderart_wasm.js
210
+ * @param wasmUrl - Optional URL to the .wasm file (for custom loading)
211
+ *
212
+ * @example
213
+ * ```typescript
214
+ * // Option 1: Let wasm-pack handle loading
215
+ * import init, * as wasm from '@pixagram/renderart/pkg/renderart_wasm.js';
216
+ * await initWasm(init, wasm);
217
+ *
218
+ * // Option 2: With custom WASM URL
219
+ * import init, * as wasm from '@pixagram/renderart/pkg/renderart_wasm.js';
220
+ * await initWasm(() => init('/path/to/renderart_wasm_bg.wasm'), wasm);
221
+ * ```
222
+ */
223
+ declare function initWasm(wasmInit: () => Promise<void>, wasm: any): Promise<void>;
198
224
  /** Check if WASM is loaded */
199
225
  declare function isWasmLoaded(): boolean;
226
+ /** Get the WASM module (throws if not initialized) */
227
+ declare function getWasmModule(): any;
200
228
  /** CRT CPU Renderer using WASM */
201
229
  declare class CrtCpuRenderer {
202
230
  private ready;
203
- /** Create and initialize renderer */
204
- static create(): Promise<CrtCpuRenderer>;
205
- private init;
231
+ /** Create renderer (WASM must be initialized first via initWasm) */
232
+ static create(): CrtCpuRenderer;
206
233
  /** Check if renderer is ready */
207
234
  isReady(): boolean;
208
235
  /** Render CRT effect */
@@ -213,9 +240,8 @@ declare class CrtCpuRenderer {
213
240
  /** HEX CPU Renderer using WASM */
214
241
  declare class HexCpuRenderer {
215
242
  private ready;
216
- /** Create and initialize renderer */
217
- static create(): Promise<HexCpuRenderer>;
218
- private init;
243
+ /** Create renderer (WASM must be initialized first via initWasm) */
244
+ static create(): HexCpuRenderer;
219
245
  /** Check if renderer is ready */
220
246
  isReady(): boolean;
221
247
  /** Render hexagonal effect */
@@ -231,9 +257,8 @@ declare class HexCpuRenderer {
231
257
  /** XBRZ CPU Renderer using WASM */
232
258
  declare class XbrzCpuRenderer {
233
259
  private ready;
234
- /** Create and initialize renderer */
235
- static create(): Promise<XbrzCpuRenderer>;
236
- private init;
260
+ /** Create renderer (WASM must be initialized first via initWasm) */
261
+ static create(): XbrzCpuRenderer;
237
262
  /** Check if renderer is ready */
238
263
  isReady(): boolean;
239
264
  /** Render xBRZ scaling */
@@ -249,6 +274,20 @@ declare const XBRZ_PRESETS: Record<string, Partial<XbrzOptions>>;
249
274
  *
250
275
  * Provides a unified API for all rendering engines (CRT, HEX, XBRZ)
251
276
  * with automatic backend selection (GPU/CPU).
277
+ *
278
+ * GPU renderers work standalone. CPU renderers require WASM initialization.
279
+ *
280
+ * @example
281
+ * ```typescript
282
+ * // GPU-only (no WASM needed)
283
+ * const renderer = RenderArt.createGpuOnly();
284
+ * const result = renderer.crt.renderSync(imageData, { scale: 3 });
285
+ *
286
+ * // With CPU fallback (requires WASM init)
287
+ * import init, * as wasm from '@pixagram/renderart/pkg/renderart_wasm.js';
288
+ * await initWasm(init, wasm);
289
+ * const renderer = RenderArt.create();
290
+ * ```
252
291
  */
253
292
 
254
293
  /** CRT rendering engine with GPU/CPU backend support */
@@ -263,9 +302,9 @@ declare class CrtEngine {
263
302
  /** Initialize CPU renderer */
264
303
  private ensureCpu;
265
304
  /** Render with automatic backend selection */
266
- render(input: ImageInput | ImageData, options?: CrtOptions): Promise<ImageOutput>;
305
+ render(input: ImageInput | ImageData, options?: CrtOptions): ImageOutput;
267
306
  /** Render with preset */
268
- render(input: ImageInput | ImageData, preset: CrtPreset, overrides?: Partial<CrtOptions>): Promise<ImageOutput>;
307
+ render(input: ImageInput | ImageData, preset: CrtPreset, overrides?: Partial<CrtOptions>): ImageOutput;
269
308
  /** Render synchronously (GPU only) */
270
309
  renderSync(input: ImageInput | ImageData, options?: CrtOptions): ImageOutput;
271
310
  /** Dispose resources */
@@ -281,9 +320,9 @@ declare class HexEngine {
281
320
  private ensureGpu;
282
321
  private ensureCpu;
283
322
  /** Render with automatic backend selection */
284
- render(input: ImageInput | ImageData, options?: HexOptions): Promise<ImageOutput>;
323
+ render(input: ImageInput | ImageData, options?: HexOptions): ImageOutput;
285
324
  /** Render with preset */
286
- render(input: ImageInput | ImageData, preset: HexPreset, overrides?: Partial<HexOptions>): Promise<ImageOutput>;
325
+ render(input: ImageInput | ImageData, preset: HexPreset, overrides?: Partial<HexOptions>): ImageOutput;
287
326
  /** Render synchronously (GPU only) */
288
327
  renderSync(input: ImageInput | ImageData, options?: HexOptions): ImageOutput;
289
328
  /** Get output dimensions */
@@ -300,9 +339,9 @@ declare class XbrzEngine {
300
339
  constructor(cpuAvailable: boolean);
301
340
  private ensureCpu;
302
341
  /** Render xBRZ scaling */
303
- render(input: ImageInput | ImageData, options?: XbrzOptions): Promise<ImageOutput>;
342
+ render(input: ImageInput | ImageData, options?: XbrzOptions): ImageOutput;
304
343
  /** Render with preset */
305
- render(input: ImageInput | ImageData, preset: XbrzPreset, overrides?: Partial<XbrzOptions>): Promise<ImageOutput>;
344
+ render(input: ImageInput | ImageData, preset: XbrzPreset, overrides?: Partial<XbrzOptions>): ImageOutput;
306
345
  /** Get output dimensions */
307
346
  getDimensions(srcWidth: number, srcHeight: number, scale?: number): {
308
347
  width: number;
@@ -320,12 +359,21 @@ declare class RenderArt {
320
359
  readonly xbrz: XbrzEngine;
321
360
  private _capabilities;
322
361
  private constructor();
323
- /** Create and initialize RenderArt instance */
324
- static create(): Promise<RenderArt>;
362
+ /**
363
+ * Create RenderArt instance
364
+ * GPU renderers always available if WebGL2 supported.
365
+ * CPU renderers require WASM to be initialized via initWasm() first.
366
+ */
367
+ static create(): RenderArt;
368
+ /**
369
+ * Create GPU-only RenderArt instance (no WASM required)
370
+ * CPU fallback will not be available.
371
+ */
372
+ static createGpuOnly(): RenderArt;
325
373
  /** Get renderer capabilities */
326
374
  get capabilities(): RendererCapabilities;
327
375
  /** Dispose all resources */
328
376
  dispose(): void;
329
377
  }
330
378
 
331
- export { type Backend, CRT_PRESETS, CrtCpuRenderer, CrtGpuRenderer, type CrtOptions, type CrtPreset, HEX_PRESETS, HexCpuRenderer, HexGpuRenderer, type HexOptions, type HexOrientation, type HexPreset, type ImageInput, type ImageOutput, type PixelData, RenderArt, type RenderStats, type Renderer, type RendererCapabilities, XBRZ_PRESETS, XbrzCpuRenderer, type XbrzOptions, type XbrzPreset, hexGetDimensions, isWasmLoaded, loadWasm };
379
+ export { type Backend, CRT_PRESETS, CrtCpuRenderer, CrtEngine, CrtGpuRenderer, type CrtOptions, type CrtPreset, HEX_PRESETS, HexCpuRenderer, HexEngine, HexGpuRenderer, type HexOptions, type HexOrientation, type HexPreset, type ImageInput, type ImageOutput, type PixelData, RenderArt, type RenderStats, type Renderer, type RendererCapabilities, XBRZ_PRESETS, XbrzCpuRenderer, XbrzEngine, type XbrzOptions, type XbrzPreset, getWasmModule, hexGetDimensions, initWasm, isWasmLoaded };