tokimeki-image-editor 0.1.1 → 0.1.3
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/components/AdjustTool.svelte +317 -0
- package/dist/components/AdjustTool.svelte.d.ts +9 -0
- package/dist/components/BlurTool.svelte +613 -0
- package/dist/components/BlurTool.svelte.d.ts +15 -0
- package/dist/components/Canvas.svelte +214 -0
- package/dist/components/Canvas.svelte.d.ts +17 -0
- package/dist/components/CropTool.svelte +942 -0
- package/dist/components/CropTool.svelte.d.ts +14 -0
- package/dist/components/ExportTool.svelte +191 -0
- package/dist/components/ExportTool.svelte.d.ts +10 -0
- package/dist/components/FilterTool.svelte +492 -0
- package/dist/components/FilterTool.svelte.d.ts +12 -0
- package/dist/components/ImageEditor.svelte +735 -0
- package/dist/components/ImageEditor.svelte.d.ts +12 -0
- package/dist/components/RotateTool.svelte +157 -0
- package/dist/components/RotateTool.svelte.d.ts +9 -0
- package/dist/components/StampTool.svelte +678 -0
- package/dist/components/StampTool.svelte.d.ts +15 -0
- package/dist/components/Toolbar.svelte +136 -0
- package/dist/components/Toolbar.svelte.d.ts +10 -0
- package/dist/config/stamps.d.ts +2 -0
- package/dist/config/stamps.js +22 -0
- package/dist/i18n/index.d.ts +1 -0
- package/dist/i18n/index.js +9 -0
- package/dist/i18n/locales/en.json +68 -0
- package/dist/i18n/locales/ja.json +68 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +5 -0
- package/dist/types.d.ts +97 -0
- package/dist/types.js +1 -0
- package/dist/utils/adjustments.d.ts +26 -0
- package/dist/utils/adjustments.js +525 -0
- package/dist/utils/canvas.d.ts +30 -0
- package/dist/utils/canvas.js +293 -0
- package/dist/utils/filters.d.ts +18 -0
- package/dist/utils/filters.js +114 -0
- package/dist/utils/history.d.ts +15 -0
- package/dist/utils/history.js +67 -0
- package/package.json +1 -1
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
<script lang="ts">import { _ } from 'svelte-i18n';
|
|
2
|
+
import { Crop, Download, SlidersHorizontal, Sparkles, Droplet, Sticker } from 'lucide-svelte';
|
|
3
|
+
let { mode, hasImage, isStandalone = false, onModeChange, } = $props();
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<div class="toolbar">
|
|
7
|
+
<button
|
|
8
|
+
class="toolbar-btn"
|
|
9
|
+
class:active={mode === 'crop'}
|
|
10
|
+
disabled={!hasImage}
|
|
11
|
+
onclick={() => onModeChange('crop')}
|
|
12
|
+
title={$_('toolbar.crop')}
|
|
13
|
+
>
|
|
14
|
+
<Crop size={20} />
|
|
15
|
+
<span>{$_('editor.crop')}</span>
|
|
16
|
+
</button>
|
|
17
|
+
|
|
18
|
+
<button
|
|
19
|
+
class="toolbar-btn"
|
|
20
|
+
class:active={mode === 'adjust'}
|
|
21
|
+
disabled={!hasImage}
|
|
22
|
+
onclick={() => onModeChange('adjust')}
|
|
23
|
+
title={$_('toolbar.adjust')}
|
|
24
|
+
>
|
|
25
|
+
<SlidersHorizontal size={20} />
|
|
26
|
+
<span>{$_('editor.adjust')}</span>
|
|
27
|
+
</button>
|
|
28
|
+
|
|
29
|
+
<button
|
|
30
|
+
class="toolbar-btn"
|
|
31
|
+
class:active={mode === 'filter'}
|
|
32
|
+
disabled={!hasImage}
|
|
33
|
+
onclick={() => onModeChange('filter')}
|
|
34
|
+
title={$_('toolbar.filter')}
|
|
35
|
+
>
|
|
36
|
+
<Sparkles size={20} />
|
|
37
|
+
<span>{$_('editor.filter')}</span>
|
|
38
|
+
</button>
|
|
39
|
+
|
|
40
|
+
<button
|
|
41
|
+
class="toolbar-btn"
|
|
42
|
+
class:active={mode === 'blur'}
|
|
43
|
+
disabled={!hasImage}
|
|
44
|
+
onclick={() => onModeChange('blur')}
|
|
45
|
+
title={$_('toolbar.blur')}
|
|
46
|
+
>
|
|
47
|
+
<Droplet size={20} />
|
|
48
|
+
<span>{$_('editor.blur')}</span>
|
|
49
|
+
</button>
|
|
50
|
+
|
|
51
|
+
<button
|
|
52
|
+
class="toolbar-btn"
|
|
53
|
+
class:active={mode === 'stamp'}
|
|
54
|
+
disabled={!hasImage}
|
|
55
|
+
onclick={() => onModeChange('stamp')}
|
|
56
|
+
title={$_('toolbar.stamp')}
|
|
57
|
+
>
|
|
58
|
+
<Sticker size={20} />
|
|
59
|
+
<span>{$_('editor.stamp')}</span>
|
|
60
|
+
</button>
|
|
61
|
+
|
|
62
|
+
{#if isStandalone}
|
|
63
|
+
<button
|
|
64
|
+
class="toolbar-btn"
|
|
65
|
+
class:active={mode === 'export'}
|
|
66
|
+
disabled={!hasImage}
|
|
67
|
+
onclick={() => onModeChange('export')}
|
|
68
|
+
title={$_('toolbar.export')}
|
|
69
|
+
>
|
|
70
|
+
<Download size={20} />
|
|
71
|
+
</button>
|
|
72
|
+
{/if}
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
<style>
|
|
76
|
+
.toolbar {
|
|
77
|
+
width: 100%;
|
|
78
|
+
display: flex;
|
|
79
|
+
gap: .5rem;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
overflow-x: auto;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@media (max-width: 767px) {
|
|
86
|
+
.toolbar {
|
|
87
|
+
align-items: stretch
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.toolbar-btn {
|
|
92
|
+
display: flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
gap: 0.5rem;
|
|
95
|
+
padding: 0.5rem 1rem;
|
|
96
|
+
background: #333;
|
|
97
|
+
color: #fff;
|
|
98
|
+
border: 1px solid #444;
|
|
99
|
+
border-radius: 4px;
|
|
100
|
+
cursor: pointer;
|
|
101
|
+
transition: all 0.2s;
|
|
102
|
+
font-size: 0.9rem;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@media (max-width: 767px) {
|
|
106
|
+
|
|
107
|
+
.toolbar-btn {
|
|
108
|
+
flex-direction: column;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
font-size: .6rem;
|
|
111
|
+
gap: .3rem;
|
|
112
|
+
width: 64px
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.toolbar-btn:hover:not(:disabled) {
|
|
117
|
+
opacity: .7;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.toolbar-btn.active {
|
|
121
|
+
background: var(--primary-color, #63b97b);
|
|
122
|
+
border-color: var(--primary-color, #63b97b);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.toolbar-btn.active:hover {
|
|
126
|
+
opacity: 1;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.toolbar-btn:disabled {
|
|
130
|
+
opacity: 0.5;
|
|
131
|
+
cursor: not-allowed;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.toolbar-btn span {
|
|
135
|
+
white-space: nowrap;
|
|
136
|
+
}</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EditorMode } from '../types';
|
|
2
|
+
interface Props {
|
|
3
|
+
mode: EditorMode;
|
|
4
|
+
hasImage: boolean;
|
|
5
|
+
isStandalone?: boolean;
|
|
6
|
+
onModeChange: (mode: EditorMode) => void;
|
|
7
|
+
}
|
|
8
|
+
declare const Toolbar: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type Toolbar = ReturnType<typeof Toolbar>;
|
|
10
|
+
export default Toolbar;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const STAMP_ASSETS = [
|
|
2
|
+
// Emojis
|
|
3
|
+
{ id: 'emoji-heart', type: 'emoji', content: '❤️', preview: '❤️' },
|
|
4
|
+
{ id: 'emoji-star', type: 'emoji', content: '⭐', preview: '⭐' },
|
|
5
|
+
{ id: 'emoji-fire', type: 'emoji', content: '🔥', preview: '🔥' },
|
|
6
|
+
{ id: 'emoji-sparkles', type: 'emoji', content: '✨', preview: '✨' },
|
|
7
|
+
{ id: 'emoji-smile', type: 'emoji', content: '😊', preview: '😊' },
|
|
8
|
+
{ id: 'emoji-cool', type: 'emoji', content: '😎', preview: '😎' },
|
|
9
|
+
{ id: 'emoji-laugh', type: 'emoji', content: '😂', preview: '😂' },
|
|
10
|
+
{ id: 'emoji-love', type: 'emoji', content: '😍', preview: '😍' },
|
|
11
|
+
{ id: 'emoji-thumbs', type: 'emoji', content: '👍', preview: '👍' },
|
|
12
|
+
{ id: 'emoji-party', type: 'emoji', content: '🎉', preview: '🎉' },
|
|
13
|
+
{ id: 'emoji-tada', type: 'emoji', content: '🎊', preview: '🎊' },
|
|
14
|
+
{ id: 'emoji-rainbow', type: 'emoji', content: '🌈', preview: '🌈' },
|
|
15
|
+
{ id: 'emoji-sun', type: 'emoji', content: '☀️', preview: '☀️' },
|
|
16
|
+
{ id: 'emoji-moon', type: 'emoji', content: '🌙', preview: '🌙' },
|
|
17
|
+
{ id: 'emoji-cloud', type: 'emoji', content: '☁️', preview: '☁️' },
|
|
18
|
+
{ id: 'emoji-flower', type: 'emoji', content: '🌸', preview: '🌸' },
|
|
19
|
+
{ id: 'emoji-cherry', type: 'emoji', content: '🍒', preview: '🍒' },
|
|
20
|
+
// { id: 'image-1', type: 'image', content: '/stamps/christmas_tree.png', preview: '/stamps/christmas_tree.png' },
|
|
21
|
+
// { id: 'svg-1', type: 'svg', content: '/stamps/svg-1.svg', preview: '/stamps/svg-1.svg' }
|
|
22
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { addMessages, init, getLocaleFromNavigator } from 'svelte-i18n';
|
|
2
|
+
import en from './locales/en.json';
|
|
3
|
+
import ja from './locales/ja.json';
|
|
4
|
+
addMessages('en', en);
|
|
5
|
+
addMessages('ja', ja);
|
|
6
|
+
init({
|
|
7
|
+
fallbackLocale: 'en',
|
|
8
|
+
initialLocale: getLocaleFromNavigator(),
|
|
9
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"editor": {
|
|
3
|
+
"title": "Image Editor",
|
|
4
|
+
"upload": "Upload Image",
|
|
5
|
+
"crop": "Crop",
|
|
6
|
+
"rotate": "Rotate",
|
|
7
|
+
"adjust": "Adjust",
|
|
8
|
+
"filter": "Filter",
|
|
9
|
+
"blur": "Blur",
|
|
10
|
+
"stamp": "Stamp",
|
|
11
|
+
"none": "None",
|
|
12
|
+
"flip": "Flip",
|
|
13
|
+
"flipHorizontal": "Flip Horizontal",
|
|
14
|
+
"flipVertical": "Flip Vertical",
|
|
15
|
+
"rotateLeft": "Rotate Left",
|
|
16
|
+
"rotateRight": "Rotate Right",
|
|
17
|
+
"export": "Export",
|
|
18
|
+
"reset": "Reset",
|
|
19
|
+
"apply": "Apply",
|
|
20
|
+
"cancel": "Cancel",
|
|
21
|
+
"close": "Close",
|
|
22
|
+
"delete": "Delete",
|
|
23
|
+
"zoom": "Zoom",
|
|
24
|
+
"quality": "Quality",
|
|
25
|
+
"format": "Format",
|
|
26
|
+
"download": "Download",
|
|
27
|
+
"dropImageHere": "Drop image here or click to upload",
|
|
28
|
+
"noImage": "No image loaded",
|
|
29
|
+
"undo": "Undo",
|
|
30
|
+
"redo": "Redo",
|
|
31
|
+
"selectStamp": "Select Stamp"
|
|
32
|
+
},
|
|
33
|
+
"toolbar": {
|
|
34
|
+
"crop": "Crop Tool",
|
|
35
|
+
"rotate": "Rotate & Flip",
|
|
36
|
+
"adjust": "Adjust Image",
|
|
37
|
+
"filter": "Filters",
|
|
38
|
+
"blur": "Blur Tool",
|
|
39
|
+
"stamp": "Stamp Tool",
|
|
40
|
+
"export": "Export Image",
|
|
41
|
+
"undo": "Undo (Ctrl+Z)",
|
|
42
|
+
"redo": "Redo (Ctrl+Shift+Z)"
|
|
43
|
+
},
|
|
44
|
+
"adjustments": {
|
|
45
|
+
"exposure": "Exposure",
|
|
46
|
+
"contrast": "Contrast",
|
|
47
|
+
"highlights": "Highlights",
|
|
48
|
+
"shadows": "Shadows",
|
|
49
|
+
"brightness": "Brightness",
|
|
50
|
+
"saturation": "Saturation",
|
|
51
|
+
"hue": "Hue",
|
|
52
|
+
"vignette": "Vignette"
|
|
53
|
+
},
|
|
54
|
+
"filters": {
|
|
55
|
+
"vivid": "Vivid",
|
|
56
|
+
"sepia": "Sepia",
|
|
57
|
+
"monochrome": "Monochrome",
|
|
58
|
+
"vintage": "Vintage",
|
|
59
|
+
"warm": "Warm",
|
|
60
|
+
"cool": "Cool",
|
|
61
|
+
"film": "Film",
|
|
62
|
+
"info": "Selecting a filter will override all current adjustments."
|
|
63
|
+
},
|
|
64
|
+
"blur": {
|
|
65
|
+
"strength": "Blur Strength",
|
|
66
|
+
"hint": "Drag on the image to create a blur area. Click on an existing area to edit it."
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"editor": {
|
|
3
|
+
"title": "画像エディター",
|
|
4
|
+
"upload": "画像をアップロード",
|
|
5
|
+
"crop": "トリミング",
|
|
6
|
+
"rotate": "回転",
|
|
7
|
+
"adjust": "調整",
|
|
8
|
+
"filter": "フィルター",
|
|
9
|
+
"blur": "ぼかし",
|
|
10
|
+
"stamp": "スタンプ",
|
|
11
|
+
"none": "なし",
|
|
12
|
+
"flip": "反転",
|
|
13
|
+
"flipHorizontal": "左右反転",
|
|
14
|
+
"flipVertical": "上下反転",
|
|
15
|
+
"rotateLeft": "左に回転",
|
|
16
|
+
"rotateRight": "右に回転",
|
|
17
|
+
"export": "エクスポート",
|
|
18
|
+
"reset": "リセット",
|
|
19
|
+
"apply": "適用",
|
|
20
|
+
"cancel": "キャンセル",
|
|
21
|
+
"close": "閉じる",
|
|
22
|
+
"delete": "削除",
|
|
23
|
+
"zoom": "ズーム",
|
|
24
|
+
"quality": "品質",
|
|
25
|
+
"format": "形式",
|
|
26
|
+
"download": "ダウンロード",
|
|
27
|
+
"dropImageHere": "画像をドロップまたはクリックしてアップロード",
|
|
28
|
+
"noImage": "画像が読み込まれていません",
|
|
29
|
+
"undo": "元に戻す",
|
|
30
|
+
"redo": "やり直す",
|
|
31
|
+
"selectStamp": "スタンプを選択"
|
|
32
|
+
},
|
|
33
|
+
"toolbar": {
|
|
34
|
+
"crop": "トリミングツール",
|
|
35
|
+
"rotate": "回転・反転",
|
|
36
|
+
"adjust": "画像調整",
|
|
37
|
+
"filter": "フィルター",
|
|
38
|
+
"blur": "ぼかしツール",
|
|
39
|
+
"stamp": "スタンプツール",
|
|
40
|
+
"export": "画像をエクスポート",
|
|
41
|
+
"undo": "元に戻す (Ctrl+Z)",
|
|
42
|
+
"redo": "やり直す (Ctrl+Shift+Z)"
|
|
43
|
+
},
|
|
44
|
+
"adjustments": {
|
|
45
|
+
"exposure": "露出",
|
|
46
|
+
"contrast": "コントラスト",
|
|
47
|
+
"highlights": "ハイライト",
|
|
48
|
+
"shadows": "シャドウ",
|
|
49
|
+
"brightness": "明るさ",
|
|
50
|
+
"saturation": "彩度",
|
|
51
|
+
"hue": "色合い",
|
|
52
|
+
"vignette": "周辺光量補正"
|
|
53
|
+
},
|
|
54
|
+
"filters": {
|
|
55
|
+
"vivid": "ビビッド",
|
|
56
|
+
"sepia": "セピア",
|
|
57
|
+
"monochrome": "モノクローム",
|
|
58
|
+
"vintage": "ビンテージ",
|
|
59
|
+
"warm": "ウォーム",
|
|
60
|
+
"cool": "クール",
|
|
61
|
+
"film": "フィルム",
|
|
62
|
+
"info": "フィルターを選択すると、すべての調整値が上書きされます。"
|
|
63
|
+
},
|
|
64
|
+
"blur": {
|
|
65
|
+
"strength": "ぼかしの強さ",
|
|
66
|
+
"hint": "画像上をドラッグしてぼかし領域を作成します。既存の領域をクリックすると編集できます。"
|
|
67
|
+
}
|
|
68
|
+
}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export type EditorMode = 'crop' | 'rotate' | 'adjust' | 'filter' | 'blur' | 'stamp' | 'export' | null;
|
|
2
|
+
export interface ImageData {
|
|
3
|
+
original: HTMLImageElement | null;
|
|
4
|
+
current: HTMLImageElement | null;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}
|
|
8
|
+
export interface CropArea {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
}
|
|
14
|
+
export interface BlurArea {
|
|
15
|
+
id: string;
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
blurStrength: number;
|
|
21
|
+
}
|
|
22
|
+
export type StampType = 'emoji' | 'image' | 'svg';
|
|
23
|
+
export interface StampAsset {
|
|
24
|
+
id: string;
|
|
25
|
+
type: StampType;
|
|
26
|
+
content: string;
|
|
27
|
+
preview?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface StampArea {
|
|
30
|
+
id: string;
|
|
31
|
+
x: number;
|
|
32
|
+
y: number;
|
|
33
|
+
width: number;
|
|
34
|
+
height: number;
|
|
35
|
+
rotation: number;
|
|
36
|
+
stampAssetId: string;
|
|
37
|
+
stampType: StampType;
|
|
38
|
+
stampContent: string;
|
|
39
|
+
}
|
|
40
|
+
export interface TransformState {
|
|
41
|
+
rotation: number;
|
|
42
|
+
flipHorizontal: boolean;
|
|
43
|
+
flipVertical: boolean;
|
|
44
|
+
scale: number;
|
|
45
|
+
}
|
|
46
|
+
export interface AdjustmentsState {
|
|
47
|
+
exposure: number;
|
|
48
|
+
contrast: number;
|
|
49
|
+
highlights: number;
|
|
50
|
+
shadows: number;
|
|
51
|
+
brightness: number;
|
|
52
|
+
saturation: number;
|
|
53
|
+
hue: number;
|
|
54
|
+
vignette: number;
|
|
55
|
+
sepia: number;
|
|
56
|
+
grayscale: number;
|
|
57
|
+
}
|
|
58
|
+
export interface FilterPreset {
|
|
59
|
+
id: string;
|
|
60
|
+
name: string;
|
|
61
|
+
adjustments: Partial<AdjustmentsState>;
|
|
62
|
+
}
|
|
63
|
+
export interface ExportOptions {
|
|
64
|
+
format: 'png' | 'jpeg';
|
|
65
|
+
quality: number;
|
|
66
|
+
}
|
|
67
|
+
export interface Viewport {
|
|
68
|
+
zoom: number;
|
|
69
|
+
offsetX: number;
|
|
70
|
+
offsetY: number;
|
|
71
|
+
scale: number;
|
|
72
|
+
}
|
|
73
|
+
export interface HistorySnapshot {
|
|
74
|
+
cropArea: CropArea | null;
|
|
75
|
+
transform: TransformState;
|
|
76
|
+
adjustments: AdjustmentsState;
|
|
77
|
+
viewport: Viewport;
|
|
78
|
+
blurAreas: BlurArea[];
|
|
79
|
+
stampAreas: StampArea[];
|
|
80
|
+
}
|
|
81
|
+
export interface EditorHistory {
|
|
82
|
+
past: HistorySnapshot[];
|
|
83
|
+
present: HistorySnapshot | null;
|
|
84
|
+
future: HistorySnapshot[];
|
|
85
|
+
}
|
|
86
|
+
export interface EditorState {
|
|
87
|
+
mode: EditorMode;
|
|
88
|
+
imageData: ImageData;
|
|
89
|
+
cropArea: CropArea | null;
|
|
90
|
+
transform: TransformState;
|
|
91
|
+
adjustments: AdjustmentsState;
|
|
92
|
+
exportOptions: ExportOptions;
|
|
93
|
+
viewport: Viewport;
|
|
94
|
+
history: EditorHistory;
|
|
95
|
+
blurAreas: BlurArea[];
|
|
96
|
+
stampAreas: StampArea[];
|
|
97
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AdjustmentsState, Viewport, CropArea } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Create default adjustments state (all values at 0 = no adjustment)
|
|
4
|
+
*/
|
|
5
|
+
export declare function createDefaultAdjustments(): AdjustmentsState;
|
|
6
|
+
/**
|
|
7
|
+
* Apply adjustments to a canvas context
|
|
8
|
+
* NOTE: For Safari compatibility, we don't use ctx.filter anymore.
|
|
9
|
+
* All adjustments are now applied via pixel manipulation in applyAllAdjustments.
|
|
10
|
+
*/
|
|
11
|
+
export declare function applyAdjustments(ctx: CanvasRenderingContext2D, adjustments: AdjustmentsState): void;
|
|
12
|
+
/**
|
|
13
|
+
* Apply ALL adjustments via pixel manipulation
|
|
14
|
+
* This works in all browsers including Safari (no ctx.filter needed)
|
|
15
|
+
*/
|
|
16
|
+
export declare function applyAllAdjustments(canvas: HTMLCanvasElement, img: HTMLImageElement, viewport: Viewport, adjustments: AdjustmentsState, cropArea?: CropArea | null): void;
|
|
17
|
+
/**
|
|
18
|
+
* Apply Gaussian blur to a region of canvas via pixel manipulation (Safari-compatible)
|
|
19
|
+
* Uses optimized separable box blur with running sums for O(n) performance
|
|
20
|
+
*/
|
|
21
|
+
export declare function applyGaussianBlur(canvas: HTMLCanvasElement, x: number, y: number, width: number, height: number, radius: number): void;
|
|
22
|
+
/**
|
|
23
|
+
* Legacy function for backwards compatibility
|
|
24
|
+
* @deprecated Use applyAllAdjustments instead
|
|
25
|
+
*/
|
|
26
|
+
export declare function applyPixelAdjustments(canvas: HTMLCanvasElement, img: HTMLImageElement, viewport: Viewport, adjustments: AdjustmentsState, cropArea?: CropArea | null): void;
|