@nice2dev/ui-graphics 1.3.13 → 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.
- package/CHANGELOG.md +4 -0
- package/package.json +3 -3
- package/dist/types/core/useGamepad.d.ts +0 -16
- package/dist/types/core/usePointerPressure.d.ts +0 -88
- package/dist/types/game/AnimationPreviewPlayer.d.ts +0 -30
- package/dist/types/game/CollisionEditor.d.ts +0 -102
- package/dist/types/game/GameAssetExportPanel.d.ts +0 -20
- package/dist/types/game/IsometricEditor.d.ts +0 -22
- package/dist/types/game/IsometricTilePanel.d.ts +0 -18
- package/dist/types/game/gameAssetExport.d.ts +0 -160
- package/dist/types/game/isometricTiles.d.ts +0 -250
- package/dist/types/game/useAnimationPreview.d.ts +0 -63
- package/dist/types/game/useCollisionEditor.d.ts +0 -96
- package/dist/types/game/useGameAssetExport.d.ts +0 -82
- package/dist/types/photo/BatchProcessingPanel.d.ts +0 -13
- package/dist/types/photo/FaceDetectionPanel.d.ts +0 -19
- package/dist/types/photo/PerspectiveCorrectionPanel.d.ts +0 -17
- package/dist/types/photo/RawFilePanel.d.ts +0 -15
- package/dist/types/photo/StyleTransferPanel.d.ts +0 -16
- package/dist/types/photo/aiStyleTransfer.d.ts +0 -58
- package/dist/types/photo/batchProcessing.d.ts +0 -95
- package/dist/types/photo/faceDetection.d.ts +0 -103
- package/dist/types/photo/index.d.ts +0 -17
- package/dist/types/photo/perspectiveCorrection.d.ts +0 -124
- package/dist/types/photo/rawFileSupport.d.ts +0 -124
- package/dist/types/pixel/PaletteExtractorPanel.d.ts +0 -17
- package/dist/types/pixel/TileMapPanel.d.ts +0 -15
- package/dist/types/pixel/paletteExtractor.d.ts +0 -73
- package/dist/types/pixel/pixelAnimationPresets.d.ts +0 -79
- package/dist/types/pixel/pixelEffectsEngine.d.ts +0 -91
- package/dist/types/pixel/pixelEquipmentSystem.d.ts +0 -145
- package/dist/types/pixel/pixelSpriteTemplates.d.ts +0 -54
- package/dist/types/pixel/tileMapMode.d.ts +0 -122
- package/dist/types/vector/PathSimplificationPanel.d.ts +0 -16
- package/dist/types/vector/PdfExportPanel.d.ts +0 -20
- package/dist/types/vector/TextOnPathPanel.d.ts +0 -26
- package/dist/types/vector/VectorFilterPanel.d.ts +0 -20
- package/dist/types/vector/VectorPatternPanel.d.ts +0 -22
- package/dist/types/vector/pathSimplification.d.ts +0 -135
- package/dist/types/vector/pdfExport.d.ts +0 -65
- package/dist/types/vector/textOnPath.d.ts +0 -145
- package/dist/types/vector/vectorPatternFills.d.ts +0 -102
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* pixelEffectsEngine.ts — Effects, shading, lighting and shadow casting for pixel art.
|
|
3
|
-
*
|
|
4
|
-
* Features:
|
|
5
|
-
* - Cel shading / flat shading with configurable ramp
|
|
6
|
-
* - Smooth shading with dithering
|
|
7
|
-
* - Directional / point / ambient light sources
|
|
8
|
-
* - Shadow casting (ray-based)
|
|
9
|
-
* - Outline effects (inner, outer, glow, color)
|
|
10
|
-
* - Normal map generation from height map
|
|
11
|
-
* - Color ramp generator
|
|
12
|
-
* - Palette-based effects (posterize, quantize)
|
|
13
|
-
* - Gradient map
|
|
14
|
-
*/
|
|
15
|
-
import { type RGBA } from './pixelEditorUtils';
|
|
16
|
-
export interface LightSource {
|
|
17
|
-
type: 'directional' | 'point' | 'ambient';
|
|
18
|
-
color: RGBA;
|
|
19
|
-
intensity: number;
|
|
20
|
-
/** For directional: angle in degrees (0=right, 90=down) */
|
|
21
|
-
angle?: number;
|
|
22
|
-
/** For point: position */
|
|
23
|
-
x?: number;
|
|
24
|
-
y?: number;
|
|
25
|
-
/** For point: falloff radius */
|
|
26
|
-
radius?: number;
|
|
27
|
-
}
|
|
28
|
-
export interface ShadowConfig {
|
|
29
|
-
enabled: boolean;
|
|
30
|
-
color: RGBA;
|
|
31
|
-
opacity: number;
|
|
32
|
-
/** Shadow direction in degrees */
|
|
33
|
-
angle: number;
|
|
34
|
-
/** Shadow length in pixels */
|
|
35
|
-
length: number;
|
|
36
|
-
/** Blur radius (0=sharp) */
|
|
37
|
-
blur: number;
|
|
38
|
-
}
|
|
39
|
-
export interface OutlineConfig {
|
|
40
|
-
type: 'outer' | 'inner' | 'glow';
|
|
41
|
-
color: RGBA;
|
|
42
|
-
thickness: number;
|
|
43
|
-
/** For glow: falloff radius */
|
|
44
|
-
glowRadius?: number;
|
|
45
|
-
/** For glow: intensity */
|
|
46
|
-
glowIntensity?: number;
|
|
47
|
-
}
|
|
48
|
-
export interface ShadingConfig {
|
|
49
|
-
mode: 'cel' | 'smooth' | 'dither';
|
|
50
|
-
/** Number of shading levels for cel shading (2-8) */
|
|
51
|
-
levels: number;
|
|
52
|
-
/** Light direction angle degrees */
|
|
53
|
-
lightAngle: number;
|
|
54
|
-
/** Light intensity 0-2 */
|
|
55
|
-
intensity: number;
|
|
56
|
-
/** Shadow color multiplier */
|
|
57
|
-
shadowTint: RGBA;
|
|
58
|
-
/** Highlight color multiplier */
|
|
59
|
-
highlightTint: RGBA;
|
|
60
|
-
}
|
|
61
|
-
export interface ColorRamp {
|
|
62
|
-
name: string;
|
|
63
|
-
colors: string[];
|
|
64
|
-
}
|
|
65
|
-
export interface EffectPreset {
|
|
66
|
-
id: string;
|
|
67
|
-
name: string;
|
|
68
|
-
category: 'shading' | 'outline' | 'lighting' | 'color' | 'pixelate' | 'post';
|
|
69
|
-
apply: (img: ImageData) => ImageData;
|
|
70
|
-
}
|
|
71
|
-
export declare const COLOR_RAMPS: ColorRamp[];
|
|
72
|
-
export declare function generateColorRamp(baseColor: string, steps: number): string[];
|
|
73
|
-
export declare function applyOutline(src: ImageData, config: OutlineConfig): ImageData;
|
|
74
|
-
export declare function applyCelShading(src: ImageData, config: ShadingConfig): ImageData;
|
|
75
|
-
export declare function applyLighting(src: ImageData, lights: LightSource[]): ImageData;
|
|
76
|
-
export declare function applyShadowCast(src: ImageData, config: ShadowConfig): ImageData;
|
|
77
|
-
export declare function generateNormalMap(heightMap: ImageData, strength?: number): ImageData;
|
|
78
|
-
/** Generate a height map from ImageData using luminance */
|
|
79
|
-
export declare function generateHeightMap(src: ImageData): ImageData;
|
|
80
|
-
export declare function applyGradientMap(src: ImageData, ramp: ColorRamp): ImageData;
|
|
81
|
-
export declare function posterize(src: ImageData, levels: number): ImageData;
|
|
82
|
-
export declare function adjustHSL(src: ImageData, hueShift: number, satMul: number, lightMul: number): ImageData;
|
|
83
|
-
export declare function invertColors(src: ImageData): ImageData;
|
|
84
|
-
export declare function desaturate(src: ImageData): ImageData;
|
|
85
|
-
export declare function replaceColor(src: ImageData, from: RGBA, to: RGBA, tolerance?: number): ImageData;
|
|
86
|
-
/** Anti-alias pixel art edges using hqx-style neighbor analysis */
|
|
87
|
-
export declare function smoothEdges(src: ImageData): ImageData;
|
|
88
|
-
/** Apply ordered dithering to reduce color count */
|
|
89
|
-
export declare function orderedDither(src: ImageData, levels?: number): ImageData;
|
|
90
|
-
export declare const EFFECT_PRESETS: EffectPreset[];
|
|
91
|
-
export declare function getEffectsByCategory(category: EffectPreset['category']): EffectPreset[];
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* pixelEquipmentSystem.ts — Equipment, clothing, and attachment system.
|
|
3
|
-
*
|
|
4
|
-
* Features:
|
|
5
|
-
* - Attachment point definitions linked to skeleton bones
|
|
6
|
-
* - Equipment item types with layered rendering
|
|
7
|
-
* - Clothing sets that can be transferred between sprites
|
|
8
|
-
* - Import/export of equipment layers and skeleton animations independently
|
|
9
|
-
* - Z-order and depth sorting for proper layering
|
|
10
|
-
*/
|
|
11
|
-
import { type RGBA } from './pixelEditorUtils';
|
|
12
|
-
import type { AttachmentSlotType, SkeletonTemplate, SkeletonPose } from './pixelSkeletonSystem';
|
|
13
|
-
export interface EquipmentItem {
|
|
14
|
-
id: string;
|
|
15
|
-
name: string;
|
|
16
|
-
category: EquipmentCategory;
|
|
17
|
-
/** Which slot this item attaches to */
|
|
18
|
-
slotType: AttachmentSlotType;
|
|
19
|
-
/** Pixel art data for each animation frame (may be fewer than total frames — will repeat) */
|
|
20
|
-
frames: ImageData[];
|
|
21
|
-
/** Width/height of the equipment sprite */
|
|
22
|
-
width: number;
|
|
23
|
-
height: number;
|
|
24
|
-
/** Anchor point within the sprite (pivot for rotation) */
|
|
25
|
-
anchorX: number;
|
|
26
|
-
anchorY: number;
|
|
27
|
-
/** Z-order offset from the attachment point's z-order */
|
|
28
|
-
zOrderOffset: number;
|
|
29
|
-
/** Additional rotation offset (degrees) */
|
|
30
|
-
rotationOffset: number;
|
|
31
|
-
/** Color tint to apply (optional) */
|
|
32
|
-
tint?: RGBA;
|
|
33
|
-
/** Color slots that can be recolored */
|
|
34
|
-
colorSlots?: EquipmentColorSlot[];
|
|
35
|
-
}
|
|
36
|
-
export type EquipmentCategory = 'helmet' | 'hat' | 'hair' | 'face' | 'armor' | 'shirt' | 'cape' | 'robe' | 'gloves' | 'bracers' | 'pants' | 'leggings' | 'skirt' | 'boots' | 'shoes' | 'weapon_melee' | 'weapon_ranged' | 'shield' | 'ring' | 'necklace' | 'belt_item' | 'wings' | 'tail' | 'accessory';
|
|
37
|
-
export interface EquipmentColorSlot {
|
|
38
|
-
name: string;
|
|
39
|
-
/** Original color to replace */
|
|
40
|
-
originalColor: RGBA;
|
|
41
|
-
/** Current replacement color */
|
|
42
|
-
currentColor: RGBA;
|
|
43
|
-
}
|
|
44
|
-
export interface ClothingSet {
|
|
45
|
-
id: string;
|
|
46
|
-
name: string;
|
|
47
|
-
description: string;
|
|
48
|
-
/** Map of slot type to equipment item */
|
|
49
|
-
items: Partial<Record<AttachmentSlotType, EquipmentItem>>;
|
|
50
|
-
/** Preview image (optional) */
|
|
51
|
-
previewImage?: ImageData;
|
|
52
|
-
/** Tags for search/filter */
|
|
53
|
-
tags: string[];
|
|
54
|
-
}
|
|
55
|
-
export interface EquipmentLayerExport {
|
|
56
|
-
version: 1;
|
|
57
|
-
type: 'equipment-layers';
|
|
58
|
-
items: SerializedEquipmentItem[];
|
|
59
|
-
}
|
|
60
|
-
export interface SkeletonAnimationExport {
|
|
61
|
-
version: 1;
|
|
62
|
-
type: 'skeleton-animation';
|
|
63
|
-
skeletonId: string;
|
|
64
|
-
animations: SerializedAnimationData[];
|
|
65
|
-
}
|
|
66
|
-
interface SerializedEquipmentItem {
|
|
67
|
-
id: string;
|
|
68
|
-
name: string;
|
|
69
|
-
category: EquipmentCategory;
|
|
70
|
-
slotType: AttachmentSlotType;
|
|
71
|
-
width: number;
|
|
72
|
-
height: number;
|
|
73
|
-
anchorX: number;
|
|
74
|
-
anchorY: number;
|
|
75
|
-
zOrderOffset: number;
|
|
76
|
-
rotationOffset: number;
|
|
77
|
-
/** RGBA data as base64 per frame */
|
|
78
|
-
frameData: string[];
|
|
79
|
-
colorSlots?: EquipmentColorSlot[];
|
|
80
|
-
}
|
|
81
|
-
interface SerializedAnimationData {
|
|
82
|
-
id: string;
|
|
83
|
-
name: string;
|
|
84
|
-
category: string;
|
|
85
|
-
durationMs: number;
|
|
86
|
-
loop: boolean;
|
|
87
|
-
keyframes: Array<{
|
|
88
|
-
time: number;
|
|
89
|
-
bones: Record<string, {
|
|
90
|
-
angle?: number;
|
|
91
|
-
scaleX?: number;
|
|
92
|
-
scaleY?: number;
|
|
93
|
-
}>;
|
|
94
|
-
easing: string;
|
|
95
|
-
}>;
|
|
96
|
-
}
|
|
97
|
-
export interface RenderedEquipment {
|
|
98
|
-
x: number;
|
|
99
|
-
y: number;
|
|
100
|
-
width: number;
|
|
101
|
-
height: number;
|
|
102
|
-
rotation: number;
|
|
103
|
-
zOrder: number;
|
|
104
|
-
imageData: ImageData;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Compute where each equipped item should render given the current skeleton pose.
|
|
108
|
-
*/
|
|
109
|
-
export declare function resolveEquipmentPositions(skeleton: SkeletonTemplate, pose: SkeletonPose, equippedItems: EquipmentItem[], frameIndex: number, rootX: number, rootY: number): RenderedEquipment[];
|
|
110
|
-
/**
|
|
111
|
-
* Composite equipment onto a target ImageData at resolved positions.
|
|
112
|
-
*/
|
|
113
|
-
export declare function compositeEquipment(target: ImageData, equipment: RenderedEquipment[]): ImageData;
|
|
114
|
-
export declare function recolorEquipment(item: EquipmentItem, colorSlotIndex: number, newColor: RGBA): EquipmentItem;
|
|
115
|
-
export declare function createClothingSet(name: string, items: EquipmentItem[], tags?: string[]): ClothingSet;
|
|
116
|
-
export declare function mergeClothingSets(base: ClothingSet, overlay: ClothingSet): ClothingSet;
|
|
117
|
-
export declare function exportEquipmentLayers(items: EquipmentItem[]): string;
|
|
118
|
-
export declare function importEquipmentLayers(json: string): EquipmentItem[];
|
|
119
|
-
export declare function exportSkeletonAnimations(skeletonId: string, animations: Array<{
|
|
120
|
-
id: string;
|
|
121
|
-
name: string;
|
|
122
|
-
category: string;
|
|
123
|
-
durationMs: number;
|
|
124
|
-
loop: boolean;
|
|
125
|
-
keyframes: Array<{
|
|
126
|
-
time: number;
|
|
127
|
-
pose: {
|
|
128
|
-
bones: Record<string, {
|
|
129
|
-
angle?: number;
|
|
130
|
-
scaleX?: number;
|
|
131
|
-
scaleY?: number;
|
|
132
|
-
}>;
|
|
133
|
-
};
|
|
134
|
-
easing: string;
|
|
135
|
-
}>;
|
|
136
|
-
}>): string;
|
|
137
|
-
export declare function importSkeletonAnimations(json: string): SkeletonAnimationExport;
|
|
138
|
-
export declare const EQUIPMENT_IRON_HELMET: EquipmentItem;
|
|
139
|
-
export declare const EQUIPMENT_WOODEN_SHIELD: EquipmentItem;
|
|
140
|
-
export declare const EQUIPMENT_IRON_SWORD: EquipmentItem;
|
|
141
|
-
export declare const EQUIPMENT_RED_CAPE: EquipmentItem;
|
|
142
|
-
export declare const EQUIPMENT_LEATHER_BOOTS: EquipmentItem;
|
|
143
|
-
export declare const DEFAULT_EQUIPMENT: EquipmentItem[];
|
|
144
|
-
export declare const DEFAULT_CLOTHING_SET: ClothingSet;
|
|
145
|
-
export {};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* pixelSpriteTemplates.ts — Pixel art sprite templates and prefabs.
|
|
3
|
-
*
|
|
4
|
-
* Templates include: stick figures, simple characters, buildings (house, castle, mine),
|
|
5
|
-
* trees, vehicles — each with animation frame data.
|
|
6
|
-
*
|
|
7
|
-
* Templates are stored as compact RLE-encoded pixel data for efficiency.
|
|
8
|
-
*/
|
|
9
|
-
export interface SpriteTemplate {
|
|
10
|
-
id: string;
|
|
11
|
-
name: string;
|
|
12
|
-
category: SpriteCategory;
|
|
13
|
-
width: number;
|
|
14
|
-
height: number;
|
|
15
|
-
/** Palette used by this template (indexed colors) */
|
|
16
|
-
palette: string[];
|
|
17
|
-
/** Layers of pixel data. Each layer = array of frames, each frame = palette-indexed 2D array (row-major, -1 = transparent) */
|
|
18
|
-
layers: SpriteTemplateLayer[];
|
|
19
|
-
/** Optional animation metadata */
|
|
20
|
-
animations?: TemplateAnimation[];
|
|
21
|
-
/** Skeleton association */
|
|
22
|
-
skeletonId?: string;
|
|
23
|
-
/** Tags for search/filter */
|
|
24
|
-
tags: string[];
|
|
25
|
-
}
|
|
26
|
-
export interface SpriteTemplateLayer {
|
|
27
|
-
name: string;
|
|
28
|
-
/** Row-major array of palette indices (-1 = transparent). Length = frames × width × height */
|
|
29
|
-
frames: number[][][];
|
|
30
|
-
}
|
|
31
|
-
export interface TemplateAnimation {
|
|
32
|
-
name: string;
|
|
33
|
-
/** Frame indices to use */
|
|
34
|
-
frameIndices: number[];
|
|
35
|
-
fps: number;
|
|
36
|
-
loop: boolean;
|
|
37
|
-
}
|
|
38
|
-
export type SpriteCategory = 'character' | 'building' | 'nature' | 'vehicle' | 'item' | 'effect' | 'tile' | 'ui' | 'animal' | 'monster';
|
|
39
|
-
export declare function templateFrameToImageData(template: SpriteTemplate, layerIndex: number, frameIndex: number): ImageData;
|
|
40
|
-
/** Flatten all layers of a frame into a single ImageData */
|
|
41
|
-
export declare function templateToComposite(template: SpriteTemplate, frameIndex: number): ImageData;
|
|
42
|
-
export declare const TEMPLATE_STICK_FIGURE: SpriteTemplate;
|
|
43
|
-
export declare const TEMPLATE_SIMPLE_CHARACTER: SpriteTemplate;
|
|
44
|
-
export declare const TEMPLATE_HOUSE: SpriteTemplate;
|
|
45
|
-
export declare const TEMPLATE_CASTLE: SpriteTemplate;
|
|
46
|
-
export declare const TEMPLATE_MINE: SpriteTemplate;
|
|
47
|
-
export declare const TEMPLATE_OAK_TREE: SpriteTemplate;
|
|
48
|
-
export declare const TEMPLATE_PINE_TREE: SpriteTemplate;
|
|
49
|
-
export declare const TEMPLATE_CAR: SpriteTemplate;
|
|
50
|
-
export declare const TEMPLATE_HORSE: SpriteTemplate;
|
|
51
|
-
export declare const ALL_SPRITE_TEMPLATES: SpriteTemplate[];
|
|
52
|
-
export declare function getTemplatesByCategory(category: SpriteCategory): SpriteTemplate[];
|
|
53
|
-
export declare function getTemplateById(id: string): SpriteTemplate | undefined;
|
|
54
|
-
export declare function searchTemplates(query: string): SpriteTemplate[];
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* tileMapMode — Tile map editing mode for PixelEditor
|
|
3
|
-
*
|
|
4
|
-
* Features:
|
|
5
|
-
* - Repeat pattern (tile seamless preview)
|
|
6
|
-
* - Mirror modes (horizontal, vertical, both)
|
|
7
|
-
* - Tile grid overlay
|
|
8
|
-
* - Tile offset/wrapping
|
|
9
|
-
* - Seamless tile generation
|
|
10
|
-
* - Auto-tile detection
|
|
11
|
-
*/
|
|
12
|
-
export type TileMirrorMode = 'none' | 'horizontal' | 'vertical' | 'both';
|
|
13
|
-
export type TileRepeatPattern = 'none' | 'repeat' | 'repeat-x' | 'repeat-y' | 'mirror-repeat' | 'brick' | 'hexagonal';
|
|
14
|
-
export interface TileMapSettings {
|
|
15
|
-
/** Whether tile map mode is enabled */
|
|
16
|
-
enabled: boolean;
|
|
17
|
-
/** Mirror mode for editing */
|
|
18
|
-
mirrorMode: TileMirrorMode;
|
|
19
|
-
/** Repeat pattern for preview */
|
|
20
|
-
repeatPattern: TileRepeatPattern;
|
|
21
|
-
/** Number of tiles to show in preview (width) */
|
|
22
|
-
repeatCountX: number;
|
|
23
|
-
/** Number of tiles to show in preview (height) */
|
|
24
|
-
repeatCountY: number;
|
|
25
|
-
/** Brick offset (0-1, only for brick pattern) */
|
|
26
|
-
brickOffset: number;
|
|
27
|
-
/** Show tile grid */
|
|
28
|
-
showGrid: boolean;
|
|
29
|
-
/** Grid color */
|
|
30
|
-
gridColor: string;
|
|
31
|
-
/** Grid opacity (0-1) */
|
|
32
|
-
gridOpacity: number;
|
|
33
|
-
/** Wrap editing across tile boundaries */
|
|
34
|
-
wrapEditing: boolean;
|
|
35
|
-
/** Show seam warning markers */
|
|
36
|
-
showSeamWarnings: boolean;
|
|
37
|
-
}
|
|
38
|
-
export interface TileMapState {
|
|
39
|
-
settings: TileMapSettings;
|
|
40
|
-
/** Offset for scrolling the tile preview */
|
|
41
|
-
previewOffsetX: number;
|
|
42
|
-
previewOffsetY: number;
|
|
43
|
-
/** Zoom level for tile preview */
|
|
44
|
-
previewZoom: number;
|
|
45
|
-
}
|
|
46
|
-
export declare const DEFAULT_TILE_MAP_SETTINGS: TileMapSettings;
|
|
47
|
-
/**
|
|
48
|
-
* Apply mirror transformation to coordinates
|
|
49
|
-
*/
|
|
50
|
-
export declare function applyMirror(x: number, y: number, width: number, height: number, mode: TileMirrorMode): {
|
|
51
|
-
x: number;
|
|
52
|
-
y: number;
|
|
53
|
-
}[];
|
|
54
|
-
/**
|
|
55
|
-
* Wrap coordinates to tile boundaries
|
|
56
|
-
*/
|
|
57
|
-
export declare function wrapCoordinates(x: number, y: number, width: number, height: number): {
|
|
58
|
-
x: number;
|
|
59
|
-
y: number;
|
|
60
|
-
};
|
|
61
|
-
/**
|
|
62
|
-
* Get all affected coordinates for a draw operation
|
|
63
|
-
*/
|
|
64
|
-
export declare function getAffectedCoordinates(x: number, y: number, width: number, height: number, settings: TileMapSettings): {
|
|
65
|
-
x: number;
|
|
66
|
-
y: number;
|
|
67
|
-
}[];
|
|
68
|
-
/**
|
|
69
|
-
* Render tile pattern to a canvas for preview
|
|
70
|
-
*/
|
|
71
|
-
export declare function renderTilePattern(source: HTMLCanvasElement | ImageData, settings: TileMapSettings, targetWidth: number, targetHeight: number): HTMLCanvasElement;
|
|
72
|
-
/**
|
|
73
|
-
* Analyze tile for seam issues (discontinuities at edges)
|
|
74
|
-
*/
|
|
75
|
-
export declare function analyzeSeams(imageData: ImageData, threshold?: number): {
|
|
76
|
-
top: number[];
|
|
77
|
-
right: number[];
|
|
78
|
-
bottom: number[];
|
|
79
|
-
left: number[];
|
|
80
|
-
score: number;
|
|
81
|
-
};
|
|
82
|
-
/**
|
|
83
|
-
* Make tile seamless using offset blend technique
|
|
84
|
-
*/
|
|
85
|
-
export declare function makeSeamless(imageData: ImageData, blendWidth?: number): ImageData;
|
|
86
|
-
export interface UseTileMapModeOptions {
|
|
87
|
-
/** Initial settings */
|
|
88
|
-
initialSettings?: Partial<TileMapSettings>;
|
|
89
|
-
/** Tile width */
|
|
90
|
-
tileWidth: number;
|
|
91
|
-
/** Tile height */
|
|
92
|
-
tileHeight: number;
|
|
93
|
-
/** Called when settings change */
|
|
94
|
-
onSettingsChange?: (settings: TileMapSettings) => void;
|
|
95
|
-
}
|
|
96
|
-
export interface UseTileMapModeReturn {
|
|
97
|
-
/** Current settings */
|
|
98
|
-
settings: TileMapSettings;
|
|
99
|
-
/** Update settings */
|
|
100
|
-
updateSettings: (partial: Partial<TileMapSettings>) => void;
|
|
101
|
-
/** Toggle tile map mode */
|
|
102
|
-
toggle: () => void;
|
|
103
|
-
/** Set mirror mode */
|
|
104
|
-
setMirrorMode: (mode: TileMirrorMode) => void;
|
|
105
|
-
/** Set repeat pattern */
|
|
106
|
-
setRepeatPattern: (pattern: TileRepeatPattern) => void;
|
|
107
|
-
/** Get affected coordinates for a draw operation */
|
|
108
|
-
getDrawCoordinates: (x: number, y: number) => {
|
|
109
|
-
x: number;
|
|
110
|
-
y: number;
|
|
111
|
-
}[];
|
|
112
|
-
/** Render tile preview */
|
|
113
|
-
renderPreview: (source: HTMLCanvasElement | ImageData, width: number, height: number) => HTMLCanvasElement;
|
|
114
|
-
/** Analyze seams */
|
|
115
|
-
analyzeSeams: (imageData: ImageData) => ReturnType<typeof analyzeSeams>;
|
|
116
|
-
/** Make tile seamless */
|
|
117
|
-
makeSeamless: (imageData: ImageData) => ImageData;
|
|
118
|
-
/** Reset to defaults */
|
|
119
|
-
reset: () => void;
|
|
120
|
-
}
|
|
121
|
-
export declare function useTileMapMode(options: UseTileMapModeOptions): UseTileMapModeReturn;
|
|
122
|
-
export default useTileMapMode;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PathSimplificationPanel — UI for path simplification and smoothing
|
|
3
|
-
*/
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import type { Point } from './pathSimplification';
|
|
6
|
-
export interface PathSimplificationPanelProps {
|
|
7
|
-
/** Points array from selected shape */
|
|
8
|
-
points: Point[];
|
|
9
|
-
/** Called when points are modified */
|
|
10
|
-
onApply: (points: Point[]) => void;
|
|
11
|
-
/** Whether the path is closed (polygon) */
|
|
12
|
-
isClosed?: boolean;
|
|
13
|
-
className?: string;
|
|
14
|
-
}
|
|
15
|
-
export declare function PathSimplificationPanel({ points, onApply, isClosed, className, }: PathSimplificationPanelProps): React.JSX.Element;
|
|
16
|
-
export default PathSimplificationPanel;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PdfExportPanel
|
|
3
|
-
* UI for exporting vector graphics to PDF
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import type { PdfExportResult } from './pdfExport';
|
|
7
|
-
export interface PdfExportPanelProps {
|
|
8
|
-
/** SVG element or string to export */
|
|
9
|
-
svg: SVGElement | string | null;
|
|
10
|
-
/** Called when export starts */
|
|
11
|
-
onExportStart?: () => void;
|
|
12
|
-
/** Called when export completes */
|
|
13
|
-
onExportComplete?: (result: PdfExportResult) => void;
|
|
14
|
-
/** Called on export error */
|
|
15
|
-
onExportError?: (error: Error) => void;
|
|
16
|
-
/** Custom class name */
|
|
17
|
-
className?: string;
|
|
18
|
-
}
|
|
19
|
-
export declare const PdfExportPanel: React.FC<PdfExportPanelProps>;
|
|
20
|
-
export default PdfExportPanel;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TextOnPathPanel
|
|
3
|
-
* UI for editing text along a path
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import type { TextOnPathOptions } from './textOnPath';
|
|
7
|
-
export interface TextOnPathPanelProps {
|
|
8
|
-
/** Initial text */
|
|
9
|
-
initialText?: string;
|
|
10
|
-
/** Initial path data */
|
|
11
|
-
initialPath?: string;
|
|
12
|
-
/** Called when result changes */
|
|
13
|
-
onChange?: (result: {
|
|
14
|
-
svg: string;
|
|
15
|
-
options: TextOnPathOptions;
|
|
16
|
-
}) => void;
|
|
17
|
-
/** Custom class name */
|
|
18
|
-
className?: string;
|
|
19
|
-
/** Preview size */
|
|
20
|
-
previewSize?: {
|
|
21
|
-
width: number;
|
|
22
|
-
height: number;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
export declare const TextOnPathPanel: React.FC<TextOnPathPanelProps>;
|
|
26
|
-
export default TextOnPathPanel;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* VectorFilterPanel — UI for editing SVG filters on shapes
|
|
3
|
-
*
|
|
4
|
-
* Features:
|
|
5
|
-
* - Add/remove filters
|
|
6
|
-
* - Filter presets
|
|
7
|
-
* - Individual filter property editing
|
|
8
|
-
* - Drag to reorder filters
|
|
9
|
-
* - Enable/disable individual filters
|
|
10
|
-
*/
|
|
11
|
-
import React from 'react';
|
|
12
|
-
import type { VShape } from './vectorEditorTypes';
|
|
13
|
-
import { type SvgFilter } from './vectorSvgFilters';
|
|
14
|
-
export interface VectorFilterPanelProps {
|
|
15
|
-
shape: VShape | null;
|
|
16
|
-
onFiltersChange: (shapeId: string, filters: SvgFilter[]) => void;
|
|
17
|
-
className?: string;
|
|
18
|
-
}
|
|
19
|
-
export declare function VectorFilterPanel({ shape, onFiltersChange, className }: VectorFilterPanelProps): React.JSX.Element;
|
|
20
|
-
export default VectorFilterPanel;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* VectorPatternPanel — UI for pattern fill editing
|
|
3
|
-
*/
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import type { PatternFill } from './vectorPatternFills';
|
|
6
|
-
export interface VectorPatternPanelProps {
|
|
7
|
-
/** Currently selected pattern */
|
|
8
|
-
pattern: PatternFill | null;
|
|
9
|
-
/** Called when pattern changes */
|
|
10
|
-
onChange: (pattern: PatternFill | null) => void;
|
|
11
|
-
/** Whether pattern fill is enabled */
|
|
12
|
-
enabled: boolean;
|
|
13
|
-
/** Called when enabled state changes */
|
|
14
|
-
onEnabledChange: (enabled: boolean) => void;
|
|
15
|
-
/** Saved patterns library */
|
|
16
|
-
savedPatterns?: PatternFill[];
|
|
17
|
-
/** Called when pattern is saved to library */
|
|
18
|
-
onSavePattern?: (pattern: PatternFill) => void;
|
|
19
|
-
className?: string;
|
|
20
|
-
}
|
|
21
|
-
export declare function VectorPatternPanel({ pattern, onChange, enabled, onEnabledChange, savedPatterns, onSavePattern, className, }: VectorPatternPanelProps): React.JSX.Element;
|
|
22
|
-
export default VectorPatternPanel;
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* pathSimplification — Reduce points in paths while preserving shape
|
|
3
|
-
*
|
|
4
|
-
* Algorithms:
|
|
5
|
-
* - Douglas-Peucker (visvalingam-whyatt alternative)
|
|
6
|
-
* - Radial distance
|
|
7
|
-
* - Perpendicular distance
|
|
8
|
-
* - Nth point (uniform sampling)
|
|
9
|
-
* - Visvalingam-Whyatt (area-based)
|
|
10
|
-
*
|
|
11
|
-
* Also includes:
|
|
12
|
-
* - Path smoothing (Catmull-Rom, Bezier)
|
|
13
|
-
* - Point optimization
|
|
14
|
-
*/
|
|
15
|
-
export interface Point {
|
|
16
|
-
x: number;
|
|
17
|
-
y: number;
|
|
18
|
-
}
|
|
19
|
-
export type SimplificationAlgorithm = 'douglas-peucker' | 'visvalingam' | 'radial-distance' | 'perpendicular-distance' | 'nth-point';
|
|
20
|
-
export type SmoothingAlgorithm = 'catmull-rom' | 'bezier' | 'average' | 'none';
|
|
21
|
-
export interface SimplificationOptions {
|
|
22
|
-
/** Algorithm to use */
|
|
23
|
-
algorithm: SimplificationAlgorithm;
|
|
24
|
-
/** Tolerance/threshold (meaning varies by algorithm) */
|
|
25
|
-
tolerance: number;
|
|
26
|
-
/** For nth-point: keep every Nth point */
|
|
27
|
-
nthPoint: number;
|
|
28
|
-
/** Whether path is closed (polygon) */
|
|
29
|
-
isClosed: boolean;
|
|
30
|
-
/** Preserve start/end points */
|
|
31
|
-
preserveEndpoints: boolean;
|
|
32
|
-
/** High quality mode (slower but better) */
|
|
33
|
-
highQuality: boolean;
|
|
34
|
-
}
|
|
35
|
-
export interface SmoothingOptions {
|
|
36
|
-
/** Smoothing algorithm */
|
|
37
|
-
algorithm: SmoothingAlgorithm;
|
|
38
|
-
/** Tension for Catmull-Rom (0-1, lower = smoother) */
|
|
39
|
-
tension: number;
|
|
40
|
-
/** Number of interpolated points between each pair */
|
|
41
|
-
resolution: number;
|
|
42
|
-
/** Corner angle threshold (degrees) to preserve sharp corners */
|
|
43
|
-
cornerThreshold: number;
|
|
44
|
-
}
|
|
45
|
-
export declare const DEFAULT_SIMPLIFICATION_OPTIONS: SimplificationOptions;
|
|
46
|
-
export declare const DEFAULT_SMOOTHING_OPTIONS: SmoothingOptions;
|
|
47
|
-
/**
|
|
48
|
-
* Calculate squared distance between two points
|
|
49
|
-
*/
|
|
50
|
-
export declare function squaredDistance(p1: Point, p2: Point): number;
|
|
51
|
-
/**
|
|
52
|
-
* Calculate distance between two points
|
|
53
|
-
*/
|
|
54
|
-
export declare function distance(p1: Point, p2: Point): number;
|
|
55
|
-
/**
|
|
56
|
-
* Calculate perpendicular distance from point to line segment
|
|
57
|
-
*/
|
|
58
|
-
export declare function perpendicularDistance(point: Point, lineStart: Point, lineEnd: Point): number;
|
|
59
|
-
/**
|
|
60
|
-
* Calculate triangle area (for Visvalingam)
|
|
61
|
-
*/
|
|
62
|
-
export declare function triangleArea(p1: Point, p2: Point, p3: Point): number;
|
|
63
|
-
/**
|
|
64
|
-
* Calculate angle at point b (in degrees)
|
|
65
|
-
*/
|
|
66
|
-
export declare function angleAt(a: Point, b: Point, c: Point): number;
|
|
67
|
-
/**
|
|
68
|
-
* Douglas-Peucker algorithm
|
|
69
|
-
* Recursively simplifies path by removing points within tolerance
|
|
70
|
-
*/
|
|
71
|
-
export declare function douglasPeucker(points: Point[], tolerance: number, start?: number, end?: number): Point[];
|
|
72
|
-
/**
|
|
73
|
-
* Visvalingam-Whyatt algorithm
|
|
74
|
-
* Removes points based on area of triangles
|
|
75
|
-
*/
|
|
76
|
-
export declare function visvalingam(points: Point[], minArea: number): Point[];
|
|
77
|
-
/**
|
|
78
|
-
* Radial distance simplification
|
|
79
|
-
* Removes points too close to previous kept point
|
|
80
|
-
*/
|
|
81
|
-
export declare function radialDistance(points: Point[], tolerance: number): Point[];
|
|
82
|
-
/**
|
|
83
|
-
* Perpendicular distance simplification
|
|
84
|
-
* One-pass version of Douglas-Peucker
|
|
85
|
-
*/
|
|
86
|
-
export declare function perpendicularDistanceSimplify(points: Point[], tolerance: number): Point[];
|
|
87
|
-
/**
|
|
88
|
-
* Nth point simplification
|
|
89
|
-
* Keeps every Nth point
|
|
90
|
-
*/
|
|
91
|
-
export declare function nthPoint(points: Point[], n: number): Point[];
|
|
92
|
-
/**
|
|
93
|
-
* Main simplification function
|
|
94
|
-
*/
|
|
95
|
-
export declare function simplifyPath(points: Point[], options?: Partial<SimplificationOptions>): Point[];
|
|
96
|
-
/**
|
|
97
|
-
* Catmull-Rom spline smoothing
|
|
98
|
-
*/
|
|
99
|
-
export declare function smoothCatmullRom(points: Point[], opts?: Partial<SmoothingOptions>): Point[];
|
|
100
|
-
/**
|
|
101
|
-
* Simple average smoothing
|
|
102
|
-
*/
|
|
103
|
-
export declare function smoothAverage(points: Point[], opts?: Partial<SmoothingOptions>): Point[];
|
|
104
|
-
/**
|
|
105
|
-
* Main smoothing function
|
|
106
|
-
*/
|
|
107
|
-
export declare function smoothPath(points: Point[], options?: Partial<SmoothingOptions>): Point[];
|
|
108
|
-
/**
|
|
109
|
-
* Remove duplicate consecutive points
|
|
110
|
-
*/
|
|
111
|
-
export declare function removeDuplicates(points: Point[], tolerance?: number): Point[];
|
|
112
|
-
/**
|
|
113
|
-
* Remove collinear points (points on straight lines)
|
|
114
|
-
*/
|
|
115
|
-
export declare function removeCollinear(points: Point[], angleThreshold?: number): Point[];
|
|
116
|
-
/**
|
|
117
|
-
* Calculate path length
|
|
118
|
-
*/
|
|
119
|
-
export declare function pathLength(points: Point[]): number;
|
|
120
|
-
/**
|
|
121
|
-
* Calculate path bounds
|
|
122
|
-
*/
|
|
123
|
-
export declare function pathBounds(points: Point[]): {
|
|
124
|
-
minX: number;
|
|
125
|
-
minY: number;
|
|
126
|
-
maxX: number;
|
|
127
|
-
maxY: number;
|
|
128
|
-
width: number;
|
|
129
|
-
height: number;
|
|
130
|
-
};
|
|
131
|
-
/**
|
|
132
|
-
* Resample path to uniform point spacing
|
|
133
|
-
*/
|
|
134
|
-
export declare function resamplePath(points: Point[], targetCount: number): Point[];
|
|
135
|
-
export default simplifyPath;
|