@nice2dev/ui-graphics 1.3.12 → 1.3.14

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +3 -3
  3. package/dist/types/core/useGamepad.d.ts +0 -16
  4. package/dist/types/core/usePointerPressure.d.ts +0 -88
  5. package/dist/types/game/AnimationPreviewPlayer.d.ts +0 -30
  6. package/dist/types/game/CollisionEditor.d.ts +0 -102
  7. package/dist/types/game/GameAssetExportPanel.d.ts +0 -20
  8. package/dist/types/game/IsometricEditor.d.ts +0 -22
  9. package/dist/types/game/IsometricTilePanel.d.ts +0 -18
  10. package/dist/types/game/gameAssetExport.d.ts +0 -160
  11. package/dist/types/game/isometricTiles.d.ts +0 -250
  12. package/dist/types/game/useAnimationPreview.d.ts +0 -63
  13. package/dist/types/game/useCollisionEditor.d.ts +0 -96
  14. package/dist/types/game/useGameAssetExport.d.ts +0 -82
  15. package/dist/types/photo/BatchProcessingPanel.d.ts +0 -13
  16. package/dist/types/photo/FaceDetectionPanel.d.ts +0 -19
  17. package/dist/types/photo/PerspectiveCorrectionPanel.d.ts +0 -17
  18. package/dist/types/photo/RawFilePanel.d.ts +0 -15
  19. package/dist/types/photo/StyleTransferPanel.d.ts +0 -16
  20. package/dist/types/photo/aiStyleTransfer.d.ts +0 -58
  21. package/dist/types/photo/batchProcessing.d.ts +0 -95
  22. package/dist/types/photo/faceDetection.d.ts +0 -103
  23. package/dist/types/photo/index.d.ts +0 -17
  24. package/dist/types/photo/perspectiveCorrection.d.ts +0 -124
  25. package/dist/types/photo/rawFileSupport.d.ts +0 -124
  26. package/dist/types/pixel/PaletteExtractorPanel.d.ts +0 -17
  27. package/dist/types/pixel/TileMapPanel.d.ts +0 -15
  28. package/dist/types/pixel/paletteExtractor.d.ts +0 -73
  29. package/dist/types/pixel/pixelAnimationPresets.d.ts +0 -79
  30. package/dist/types/pixel/pixelEffectsEngine.d.ts +0 -91
  31. package/dist/types/pixel/pixelEquipmentSystem.d.ts +0 -145
  32. package/dist/types/pixel/pixelSpriteTemplates.d.ts +0 -54
  33. package/dist/types/pixel/tileMapMode.d.ts +0 -122
  34. package/dist/types/vector/PathSimplificationPanel.d.ts +0 -16
  35. package/dist/types/vector/PdfExportPanel.d.ts +0 -20
  36. package/dist/types/vector/TextOnPathPanel.d.ts +0 -26
  37. package/dist/types/vector/VectorFilterPanel.d.ts +0 -20
  38. package/dist/types/vector/VectorPatternPanel.d.ts +0 -22
  39. package/dist/types/vector/pathSimplification.d.ts +0 -135
  40. package/dist/types/vector/pdfExport.d.ts +0 -65
  41. package/dist/types/vector/textOnPath.d.ts +0 -145
  42. package/dist/types/vector/vectorPatternFills.d.ts +0 -102
@@ -1,250 +0,0 @@
1
- /**
2
- * Isometric Tile System
3
- * Support for 2.5D isometric/dimetric tile rendering and editing
4
- */
5
- export type IsometricProjection = 'isometric' | 'dimetric' | 'trimetric' | 'military' | 'cavalier';
6
- export interface IsometricConfig {
7
- /** Projection type */
8
- projection: IsometricProjection;
9
- /** Tile width in pixels */
10
- tileWidth: number;
11
- /** Tile height in pixels (visible portion) */
12
- tileHeight: number;
13
- /** Tile depth (for 3D tiles) */
14
- tileDepth: number;
15
- /** Angle in degrees (for custom projections) */
16
- angle: number;
17
- /** Scale factor */
18
- scale: number;
19
- /** Origin offset */
20
- origin: {
21
- x: number;
22
- y: number;
23
- };
24
- /** Grid size (columns x rows) */
25
- gridSize: {
26
- cols: number;
27
- rows: number;
28
- };
29
- /** Stacking layers */
30
- layers: number;
31
- }
32
- export interface IsometricTile {
33
- /** Unique ID */
34
- id: string;
35
- /** Grid position */
36
- gridX: number;
37
- gridY: number;
38
- /** Layer (z-level) */
39
- layer: number;
40
- /** Tile type/sprite index */
41
- tileType: number;
42
- /** Rotation (0, 90, 180, 270) */
43
- rotation: 0 | 90 | 180 | 270;
44
- /** Flip horizontally */
45
- flipX: boolean;
46
- /** Flip vertically */
47
- flipY: boolean;
48
- /** Custom height offset */
49
- heightOffset: number;
50
- /** Tile metadata */
51
- metadata?: Record<string, unknown>;
52
- }
53
- export interface IsometricTileset {
54
- /** Tileset name */
55
- name: string;
56
- /** Source image path */
57
- imagePath: string;
58
- /** Tile definitions */
59
- tiles: IsometricTileDefinition[];
60
- /** Tileset dimensions */
61
- imageWidth: number;
62
- imageHeight: number;
63
- }
64
- export interface IsometricTileDefinition {
65
- /** Tile ID */
66
- id: number;
67
- /** Name */
68
- name: string;
69
- /** Region in source image */
70
- region: {
71
- x: number;
72
- y: number;
73
- width: number;
74
- height: number;
75
- };
76
- /** Tile footprint (for larger tiles) */
77
- footprint: {
78
- cols: number;
79
- rows: number;
80
- };
81
- /** Height in layers */
82
- height: number;
83
- /** Anchor point (for positioning) */
84
- anchor: {
85
- x: number;
86
- y: number;
87
- };
88
- /** Collision type */
89
- collision: 'none' | 'solid' | 'half' | 'ramp-n' | 'ramp-s' | 'ramp-e' | 'ramp-w';
90
- /** Tags for filtering */
91
- tags: string[];
92
- }
93
- export interface IsometricMap {
94
- /** Map name */
95
- name: string;
96
- /** Grid dimensions */
97
- width: number;
98
- height: number;
99
- /** Number of layers */
100
- layers: number;
101
- /** Tile data */
102
- tiles: IsometricTile[];
103
- /** Tileset references */
104
- tilesets: string[];
105
- /** Map properties */
106
- properties: Record<string, unknown>;
107
- }
108
- export interface ScreenPosition {
109
- x: number;
110
- y: number;
111
- }
112
- export interface GridPosition {
113
- col: number;
114
- row: number;
115
- layer: number;
116
- }
117
- /**
118
- * Get projection angles for different isometric types
119
- */
120
- export declare function getProjectionAngles(projection: IsometricProjection): {
121
- x: number;
122
- y: number;
123
- };
124
- /**
125
- * Convert grid coordinates to screen coordinates
126
- */
127
- export declare function gridToScreen(gridX: number, gridY: number, layer: number, config: IsometricConfig): ScreenPosition;
128
- /**
129
- * Convert screen coordinates to grid coordinates
130
- */
131
- export declare function screenToGrid(screenX: number, screenY: number, layer: number, config: IsometricConfig): GridPosition;
132
- /**
133
- * Get tile corners in screen space
134
- */
135
- export declare function getTileCorners(gridX: number, gridY: number, layer: number, config: IsometricConfig): ScreenPosition[];
136
- /**
137
- * Get 3D tile vertices (for cubes/blocks)
138
- */
139
- export declare function getTile3DVertices(gridX: number, gridY: number, layer: number, height: number, config: IsometricConfig): {
140
- top: ScreenPosition[];
141
- left: ScreenPosition[];
142
- right: ScreenPosition[];
143
- };
144
- /**
145
- * Sort tiles for correct rendering order (painter's algorithm)
146
- */
147
- export declare function sortTilesForRendering(tiles: IsometricTile[]): IsometricTile[];
148
- /**
149
- * Get visible tiles within viewport
150
- */
151
- export declare function getVisibleTiles(tiles: IsometricTile[], viewport: {
152
- x: number;
153
- y: number;
154
- width: number;
155
- height: number;
156
- }, config: IsometricConfig): IsometricTile[];
157
- /**
158
- * Render isometric grid to canvas
159
- */
160
- export declare function renderIsometricGrid(ctx: CanvasRenderingContext2D, config: IsometricConfig, options?: {
161
- gridColor?: string;
162
- gridOpacity?: number;
163
- showCoordinates?: boolean;
164
- }): void;
165
- /**
166
- * Render a single isometric tile
167
- */
168
- export declare function renderIsometricTile(ctx: CanvasRenderingContext2D, tile: IsometricTile, tileset: IsometricTileset, tileImage: HTMLImageElement, config: IsometricConfig): void;
169
- /**
170
- * Render 3D block (cube) at position
171
- */
172
- export declare function renderIsometricBlock(ctx: CanvasRenderingContext2D, gridX: number, gridY: number, layer: number, height: number, colors: {
173
- top: string;
174
- left: string;
175
- right: string;
176
- }, config: IsometricConfig): void;
177
- /**
178
- * Create a new isometric map
179
- */
180
- export declare function createIsometricMap(name: string, width: number, height: number, layers?: number): IsometricMap;
181
- /**
182
- * Add a tile to the map
183
- */
184
- export declare function addTile(map: IsometricMap, tile: Omit<IsometricTile, 'id'>): IsometricMap;
185
- /**
186
- * Remove a tile from the map
187
- */
188
- export declare function removeTile(map: IsometricMap, tileId: string): IsometricMap;
189
- /**
190
- * Get tile at position
191
- */
192
- export declare function getTileAt(map: IsometricMap, gridX: number, gridY: number, layer: number): IsometricTile | undefined;
193
- /**
194
- * Get all tiles at position (all layers)
195
- */
196
- export declare function getTilesAt(map: IsometricMap, gridX: number, gridY: number): IsometricTile[];
197
- /**
198
- * Fill a region with tiles
199
- */
200
- export declare function fillRegion(map: IsometricMap, startX: number, startY: number, endX: number, endY: number, layer: number, tileType: number): IsometricMap;
201
- /**
202
- * Export to Tiled TMX format (isometric)
203
- */
204
- export declare function exportToTiledIsometric(map: IsometricMap, configOrTileset?: IsometricConfig | IsometricTileset, configArg?: IsometricConfig): string;
205
- /**
206
- * Export to Godot isometric tilemap
207
- */
208
- export declare function exportToGodotIsometric(map: IsometricMap, configOrTileset?: IsometricConfig | IsometricTileset, configArg?: IsometricConfig): string;
209
- export interface UseIsometricEditorOptions {
210
- /** Initial configuration */
211
- config?: Partial<IsometricConfig>;
212
- /** Initial map */
213
- initialMap?: IsometricMap;
214
- }
215
- export interface UseIsometricEditorReturn {
216
- /** Current configuration */
217
- config: IsometricConfig;
218
- /** Current map */
219
- map: IsometricMap;
220
- /** Update configuration */
221
- setConfig: (config: Partial<IsometricConfig>) => void;
222
- /** Set selected tile type */
223
- setSelectedTile: (tileType: number) => void;
224
- /** Selected tile type */
225
- selectedTile: number;
226
- /** Current layer */
227
- currentLayer: number;
228
- /** Set current layer */
229
- setCurrentLayer: (layer: number) => void;
230
- /** Place tile at grid position */
231
- placeTile: (gridX: number, gridY: number) => void;
232
- /** Remove tile at grid position */
233
- eraseTile: (gridX: number, gridY: number) => void;
234
- /** Fill region */
235
- fill: (startX: number, startY: number, endX: number, endY: number) => void;
236
- /** Convert screen to grid */
237
- screenToGrid: (screenX: number, screenY: number) => GridPosition;
238
- /** Undo last action */
239
- undo: () => void;
240
- /** Redo last undone action */
241
- redo: () => void;
242
- /** Can undo */
243
- canUndo: boolean;
244
- /** Can redo */
245
- canRedo: boolean;
246
- /** Clear map */
247
- clear: () => void;
248
- }
249
- export declare function useIsometricEditor(options?: UseIsometricEditorOptions): UseIsometricEditorReturn;
250
- export default useIsometricEditor;
@@ -1,63 +0,0 @@
1
- /**
2
- * useAnimationPreview — Hook for animation playback in GameAsset2dEditor
3
- *
4
- * Features:
5
- * - Real-time frame playback with configurable speed
6
- * - State machine simulation with parameter control
7
- * - Transition blending preview
8
- * - Play/pause/stop/step controls
9
- * - Loop and ping-pong modes
10
- * - Timeline scrubbing
11
- */
12
- import type { SpriteFrame, SpriteSheet, AnimationStateMachine } from './gameAssetTypes';
13
- export interface AnimationPreviewState {
14
- isPlaying: boolean;
15
- currentFrameIndex: number;
16
- elapsedTime: number;
17
- playbackSpeed: number;
18
- currentAnimationId: string | null;
19
- animationType: 'single' | 'stateMachine';
20
- currentStateId: string | null;
21
- targetStateId: string | null;
22
- transitionProgress: number;
23
- isTransitioning: boolean;
24
- parameterValues: Map<string, boolean | number>;
25
- currentFrame: SpriteFrame | null;
26
- frameImageData: ImageData | null;
27
- onionSkinEnabled: boolean;
28
- onionSkinFrames: number;
29
- onionSkinOpacity: number;
30
- }
31
- export interface AnimationPreviewOptions {
32
- spriteSheets: SpriteSheet[];
33
- stateMachines: AnimationStateMachine[];
34
- onFrameChange?: (frameIndex: number) => void;
35
- onStateChange?: (stateId: string) => void;
36
- onTransitionStart?: (fromId: string, toId: string) => void;
37
- onTransitionEnd?: (toId: string) => void;
38
- }
39
- export interface AnimationPreviewApi {
40
- state: AnimationPreviewState;
41
- play: () => void;
42
- pause: () => void;
43
- stop: () => void;
44
- stepForward: () => void;
45
- stepBackward: () => void;
46
- setPlaybackSpeed: (speed: number) => void;
47
- toggleLoop: () => void;
48
- seekToFrame: (frameIndex: number) => void;
49
- seekToTime: (timeMs: number) => void;
50
- playAnimation: (animationId: string) => void;
51
- playStateMachine: (stateMachineId: string) => void;
52
- setParameter: (name: string, value: boolean | number) => void;
53
- triggerParameter: (name: string) => void;
54
- forceState: (stateId: string) => void;
55
- resetStateMachine: () => void;
56
- toggleOnionSkin: () => void;
57
- setOnionSkinFrames: (count: number) => void;
58
- setOnionSkinOpacity: (opacity: number) => void;
59
- getAnimationDuration: (animationId: string) => number;
60
- getFrameAt: (animationId: string, timeMs: number) => SpriteFrame | null;
61
- getCurrentFrameImage: () => HTMLCanvasElement | null;
62
- }
63
- export declare function useAnimationPreview(options: AnimationPreviewOptions): AnimationPreviewApi;
@@ -1,96 +0,0 @@
1
- /**
2
- * useCollisionEditor — Hook for collision editing state management
3
- *
4
- * Features:
5
- * - Collision body management (CRUD)
6
- * - Undo/redo history
7
- * - Collision shape operations
8
- * - Per-frame collision support
9
- * - Collision testing/preview
10
- * - Export to physics engine formats
11
- */
12
- import type { CollisionBody, CollisionShape, CollisionShapeType } from './CollisionEditor';
13
- export interface FrameCollision {
14
- frameIndex: number;
15
- body: CollisionBody;
16
- }
17
- export interface CollisionEditorState {
18
- /** Current body being edited */
19
- currentBody: CollisionBody | null;
20
- /** Per-frame collision data */
21
- frameCollisions: FrameCollision[];
22
- /** Currently selected frame index (for animations) */
23
- currentFrameIndex: number;
24
- /** Whether to use per-frame collisions */
25
- usePerFrameCollisions: boolean;
26
- /** Undo history */
27
- undoStack: CollisionBody[];
28
- /** Redo history */
29
- redoStack: CollisionBody[];
30
- /** Selected shape ID */
31
- selectedShapeId: string | null;
32
- /** Preview mode enabled */
33
- previewMode: boolean;
34
- }
35
- export interface UseCollisionEditorOptions {
36
- /** Initial body */
37
- initialBody?: CollisionBody | null;
38
- /** Initial frame collisions */
39
- initialFrameCollisions?: FrameCollision[];
40
- /** Max undo history size */
41
- maxHistory?: number;
42
- /** Called when body changes */
43
- onChange?: (body: CollisionBody | null, frameCollisions: FrameCollision[]) => void;
44
- }
45
- export interface UseCollisionEditorReturn {
46
- /** Current state */
47
- state: CollisionEditorState;
48
- /** Current body (auto-switches based on frame) */
49
- currentBody: CollisionBody | null;
50
- /** Update the current body */
51
- setBody: (body: CollisionBody) => void;
52
- /** Create a new body */
53
- createBody: () => void;
54
- /** Delete the current body */
55
- deleteBody: () => void;
56
- /** Clone the current body */
57
- cloneBody: () => void;
58
- /** Add a shape to current body */
59
- addShape: (type: CollisionShapeType) => void;
60
- /** Update a shape */
61
- updateShape: (shape: CollisionShape) => void;
62
- /** Delete a shape */
63
- deleteShape: (shapeId: string) => void;
64
- /** Duplicate a shape */
65
- duplicateShape: (shapeId: string) => void;
66
- /** Select a shape */
67
- selectShape: (shapeId: string | null) => void;
68
- /** Move shape in layer order */
69
- moveShape: (shapeId: string, direction: 'up' | 'down') => void;
70
- /** Undo last action */
71
- undo: () => void;
72
- /** Redo last undone action */
73
- redo: () => void;
74
- /** Can undo */
75
- canUndo: boolean;
76
- /** Can redo */
77
- canRedo: boolean;
78
- /** Toggle per-frame collisions */
79
- setUsePerFrameCollisions: (use: boolean) => void;
80
- /** Set current frame */
81
- setCurrentFrame: (frameIndex: number) => void;
82
- /** Copy collision to frame */
83
- copyToFrame: (targetFrameIndex: number) => void;
84
- /** Copy collision to all frames */
85
- copyToAllFrames: () => void;
86
- /** Toggle preview mode */
87
- setPreviewMode: (enabled: boolean) => void;
88
- /** Export to physics engine format */
89
- exportToFormat: (format: 'box2d' | 'matter' | 'rapier' | 'json') => string;
90
- /** Import from JSON */
91
- importFromJson: (json: string) => void;
92
- /** Reset to defaults */
93
- reset: () => void;
94
- }
95
- export declare function useCollisionEditor(options?: UseCollisionEditorOptions): UseCollisionEditorReturn;
96
- export default useCollisionEditor;
@@ -1,82 +0,0 @@
1
- /**
2
- * useGameAssetExport
3
- * Hook for exporting game assets from editor contexts
4
- */
5
- import type { CollisionShape } from './CollisionEditor';
6
- import type { ExportFormat, ExportResult, ExportManagerOptions } from './gameAssetExport';
7
- export interface UseGameAssetExportOptions {
8
- /** Asset name */
9
- name: string;
10
- /** Asset dimensions */
11
- width: number;
12
- height: number;
13
- /** Image data (canvas, blob, or path) */
14
- image: HTMLCanvasElement | Blob | string;
15
- /** Collision shapes */
16
- collisions?: CollisionShape[];
17
- /** Animation frames data */
18
- frames?: FrameData[];
19
- /** Default export format */
20
- defaultFormat?: ExportFormat;
21
- }
22
- export interface FrameData {
23
- /** Frame index */
24
- index: number;
25
- /** Frame duration in ms */
26
- duration: number;
27
- /** Frame region in source image */
28
- x: number;
29
- y: number;
30
- width: number;
31
- height: number;
32
- /** Anchor point (0-1) */
33
- anchorX?: number;
34
- anchorY?: number;
35
- /** Per-frame collisions */
36
- collisions?: CollisionShape[];
37
- }
38
- export interface ExportState {
39
- /** Whether export is in progress */
40
- isExporting: boolean;
41
- /** Export progress (0-1) */
42
- progress: number;
43
- /** Current export step */
44
- step: string;
45
- /** Last export results */
46
- results: ExportResult[] | null;
47
- /** Last export error */
48
- error: Error | null;
49
- }
50
- export interface UseGameAssetExportReturn {
51
- /** Export state */
52
- state: ExportState;
53
- /** Export to specific format */
54
- exportTo: (format: ExportFormat, options?: Partial<ExportManagerOptions['formatOptions']>) => Promise<ExportResult[]>;
55
- /** Export and download */
56
- exportAndDownload: (format: ExportFormat, options?: Partial<ExportManagerOptions['formatOptions']>) => Promise<void>;
57
- /** Export and download as ZIP */
58
- exportAndZip: (format: ExportFormat, options?: Partial<ExportManagerOptions['formatOptions']>) => Promise<void>;
59
- /** Export to all formats */
60
- exportAll: () => Promise<Map<ExportFormat, ExportResult[]>>;
61
- /** Clear last results/error */
62
- reset: () => void;
63
- /** Available formats */
64
- availableFormats: ExportFormat[];
65
- }
66
- export declare function useGameAssetExport(options: UseGameAssetExportOptions): UseGameAssetExportReturn;
67
- export interface ExportWithImageOptions extends UseGameAssetExportOptions {
68
- /** Include image in export */
69
- includeImage?: boolean;
70
- /** Image format */
71
- imageFormat?: 'png' | 'webp' | 'jpg';
72
- /** Image quality (0-1, for jpg/webp) */
73
- imageQuality?: number;
74
- }
75
- /**
76
- * Export asset data along with image file
77
- */
78
- export declare function exportWithImage(format: ExportFormat, options: ExportWithImageOptions): Promise<{
79
- data: ExportResult[];
80
- image?: Blob;
81
- }>;
82
- export default useGameAssetExport;
@@ -1,13 +0,0 @@
1
- /**
2
- * BatchProcessingPanel
3
- * UI panel for batch processing in PhotoEditor
4
- */
5
- import React from 'react';
6
- export interface BatchProcessingPanelProps {
7
- /** Called when processing complete */
8
- onComplete?: () => void;
9
- /** Custom class name */
10
- className?: string;
11
- }
12
- export declare const BatchProcessingPanel: React.FC<BatchProcessingPanelProps>;
13
- export default BatchProcessingPanel;
@@ -1,19 +0,0 @@
1
- /**
2
- * FaceDetectionPanel — UI for face detection and auto-crop
3
- */
4
- import React from 'react';
5
- import { FaceRegion } from './faceDetection';
6
- export interface FaceDetectionPanelProps {
7
- /** Source image data */
8
- imageData: ImageData | null;
9
- /** Callback when crop is applied */
10
- onCrop: (x: number, y: number, width: number, height: number) => void;
11
- /** Callback when face regions are detected */
12
- onFacesDetected?: (faces: FaceRegion[]) => void;
13
- /** Optional class name */
14
- className?: string;
15
- /** Panel title */
16
- title?: string;
17
- }
18
- export declare function FaceDetectionPanel({ imageData, onCrop, onFacesDetected, className, title, }: FaceDetectionPanelProps): React.JSX.Element;
19
- export default FaceDetectionPanel;
@@ -1,17 +0,0 @@
1
- /**
2
- * PerspectiveCorrectionPanel
3
- * UI panel for perspective correction in PhotoEditor
4
- */
5
- import React from 'react';
6
- export interface PerspectiveCorrectionPanelProps {
7
- /** Source image data */
8
- imageData: ImageData;
9
- /** Called when correction is applied */
10
- onApply: (result: ImageData) => void;
11
- /** Called when cancelled */
12
- onCancel?: () => void;
13
- /** Custom class name */
14
- className?: string;
15
- }
16
- export declare const PerspectiveCorrectionPanel: React.FC<PerspectiveCorrectionPanelProps>;
17
- export default PerspectiveCorrectionPanel;
@@ -1,15 +0,0 @@
1
- /**
2
- * RawFilePanel — UI for RAW file loading and processing
3
- */
4
- import React from 'react';
5
- import { RawMetadata } from './rawFileSupport';
6
- export interface RawFilePanelProps {
7
- /** Callback when RAW file is processed */
8
- onLoad: (imageData: ImageData, metadata: RawMetadata) => void;
9
- /** Optional class name */
10
- className?: string;
11
- /** Panel title */
12
- title?: string;
13
- }
14
- export declare function RawFilePanel({ onLoad, className, title }: RawFilePanelProps): React.JSX.Element;
15
- export default RawFilePanel;
@@ -1,16 +0,0 @@
1
- /**
2
- * StyleTransferPanel — UI for AI-based style transfer
3
- */
4
- import React from 'react';
5
- export interface StyleTransferPanelProps {
6
- /** Source image data */
7
- imageData: ImageData | null;
8
- /** Callback when style transfer is applied */
9
- onApply: (result: ImageData) => void;
10
- /** Optional class name */
11
- className?: string;
12
- /** Panel title */
13
- title?: string;
14
- }
15
- export declare function StyleTransferPanel({ imageData, onApply, className, title, }: StyleTransferPanelProps): React.JSX.Element;
16
- export default StyleTransferPanel;
@@ -1,58 +0,0 @@
1
- /**
2
- * aiStyleTransfer — AI-based style transfer filters for PhotoEditor
3
- *
4
- * This module implements neural style transfer effects using pure canvas operations
5
- * for lightweight, dependency-free artistic filters. Also supports optional
6
- * TensorFlow.js integration for more advanced neural style transfer.
7
- *
8
- * Features:
9
- * - Pre-defined artistic styles (oil painting, watercolor, sketch, etc.)
10
- * - Real-time preview with downscaled processing
11
- * - Adjustable style intensity
12
- * - Optional TF.js for advanced neural transfer
13
- */
14
- export type StylePreset = 'oil-painting' | 'watercolor' | 'pencil-sketch' | 'charcoal' | 'impressionist' | 'pop-art' | 'vintage' | 'noir' | 'cyberpunk' | 'anime' | 'pixel-art' | 'mosaic' | 'pointillism' | 'stained-glass' | 'custom';
15
- export interface StyleTransferOptions {
16
- /** Style preset to apply */
17
- style: StylePreset;
18
- /** Intensity of the effect (0-1) */
19
- intensity: number;
20
- /** Detail preservation (0-1) */
21
- detailPreservation: number;
22
- /** Color saturation adjustment (-1 to 1) */
23
- saturation: number;
24
- /** Custom style image (for 'custom' preset) */
25
- customStyleImage?: ImageData;
26
- /** Processing quality (affects speed vs quality) */
27
- quality: 'fast' | 'balanced' | 'high';
28
- }
29
- export interface StyleTransferResult {
30
- imageData: ImageData;
31
- processingTimeMs: number;
32
- style: StylePreset;
33
- }
34
- export declare const DEFAULT_STYLE_OPTIONS: StyleTransferOptions;
35
- export declare const STYLE_PRESETS: Record<StylePreset, {
36
- name: string;
37
- description: string;
38
- }>;
39
- /**
40
- * Downscale image for faster preview processing
41
- */
42
- export declare function downscaleForPreview(imageData: ImageData, quality: 'fast' | 'balanced' | 'high'): {
43
- data: ImageData;
44
- scale: number;
45
- };
46
- /**
47
- * Upscale processed image back to original size
48
- */
49
- export declare function upscaleFromPreview(imageData: ImageData, originalWidth: number, originalHeight: number): ImageData;
50
- /**
51
- * Apply style transfer to an image
52
- */
53
- export declare function applyStyleTransfer(imageData: ImageData, options?: Partial<StyleTransferOptions>): StyleTransferResult;
54
- /**
55
- * Generate preview thumbnails for all styles
56
- */
57
- export declare function generateStylePreviews(imageData: ImageData, size?: number): Promise<Map<StylePreset, ImageData>>;
58
- export default applyStyleTransfer;