konva 10.0.8 → 10.0.10
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/konva.js +95 -48
- package/konva.min.js +4 -4
- package/package.json +1 -1
- package/lib/Animation.d.ts +0 -24
- package/lib/Animation.js +0 -142
- package/lib/BezierFunctions.d.ts +0 -6
- package/lib/BezierFunctions.js +0 -784
- package/lib/Canvas.d.ts +0 -33
- package/lib/Canvas.js +0 -137
- package/lib/Container.d.ts +0 -54
- package/lib/Container.js +0 -316
- package/lib/Context.d.ts +0 -95
- package/lib/Context.js +0 -561
- package/lib/Core.d.ts +0 -3
- package/lib/Core.js +0 -3
- package/lib/DragAndDrop.d.ts +0 -17
- package/lib/DragAndDrop.js +0 -110
- package/lib/Factory.d.ts +0 -22
- package/lib/Factory.js +0 -123
- package/lib/FastLayer.d.ts +0 -4
- package/lib/FastLayer.js +0 -12
- package/lib/Global.d.ts +0 -37
- package/lib/Global.js +0 -66
- package/lib/Group.d.ts +0 -9
- package/lib/Group.js +0 -13
- package/lib/Layer.d.ts +0 -62
- package/lib/Layer.js +0 -305
- package/lib/Node.d.ts +0 -323
- package/lib/Node.js +0 -1532
- package/lib/PointerEvents.d.ts +0 -11
- package/lib/PointerEvents.js +0 -37
- package/lib/Shape.d.ts +0 -196
- package/lib/Shape.js +0 -548
- package/lib/Stage.d.ts +0 -86
- package/lib/Stage.js +0 -715
- package/lib/Tween.d.ts +0 -90
- package/lib/Tween.js +0 -531
- package/lib/Util.d.ts +0 -133
- package/lib/Util.js +0 -866
- package/lib/Validators.d.ts +0 -11
- package/lib/Validators.js +0 -178
- package/lib/_CoreInternals.d.ts +0 -220
- package/lib/_CoreInternals.js +0 -34
- package/lib/_FullInternals.d.ts +0 -302
- package/lib/_FullInternals.js +0 -80
- package/lib/canvas-backend.d.ts +0 -2
- package/lib/canvas-backend.js +0 -27
- package/lib/filters/Blur.d.ts +0 -2
- package/lib/filters/Blur.js +0 -235
- package/lib/filters/Brighten.d.ts +0 -2
- package/lib/filters/Brighten.js +0 -12
- package/lib/filters/Brightness.d.ts +0 -2
- package/lib/filters/Brightness.js +0 -8
- package/lib/filters/Contrast.d.ts +0 -2
- package/lib/filters/Contrast.js +0 -35
- package/lib/filters/Emboss.d.ts +0 -2
- package/lib/filters/Emboss.js +0 -101
- package/lib/filters/Enhance.d.ts +0 -2
- package/lib/filters/Enhance.js +0 -84
- package/lib/filters/Grayscale.d.ts +0 -2
- package/lib/filters/Grayscale.js +0 -9
- package/lib/filters/HSL.d.ts +0 -2
- package/lib/filters/HSL.js +0 -24
- package/lib/filters/HSV.d.ts +0 -2
- package/lib/filters/HSV.js +0 -23
- package/lib/filters/Invert.d.ts +0 -2
- package/lib/filters/Invert.js +0 -8
- package/lib/filters/Kaleidoscope.d.ts +0 -2
- package/lib/filters/Kaleidoscope.js +0 -133
- package/lib/filters/Mask.d.ts +0 -2
- package/lib/filters/Mask.js +0 -151
- package/lib/filters/Noise.d.ts +0 -2
- package/lib/filters/Noise.js +0 -12
- package/lib/filters/Pixelate.d.ts +0 -2
- package/lib/filters/Pixelate.js +0 -60
- package/lib/filters/Posterize.d.ts +0 -2
- package/lib/filters/Posterize.js +0 -10
- package/lib/filters/RGB.d.ts +0 -2
- package/lib/filters/RGB.js +0 -38
- package/lib/filters/RGBA.d.ts +0 -2
- package/lib/filters/RGBA.js +0 -49
- package/lib/filters/Sepia.d.ts +0 -2
- package/lib/filters/Sepia.js +0 -11
- package/lib/filters/Solarize.d.ts +0 -2
- package/lib/filters/Solarize.js +0 -14
- package/lib/filters/Threshold.d.ts +0 -2
- package/lib/filters/Threshold.js +0 -10
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -2
- package/lib/shapes/Arc.d.ts +0 -27
- package/lib/shapes/Arc.js +0 -60
- package/lib/shapes/Arrow.d.ts +0 -27
- package/lib/shapes/Arrow.js +0 -99
- package/lib/shapes/Circle.d.ts +0 -15
- package/lib/shapes/Circle.js +0 -33
- package/lib/shapes/Ellipse.d.ts +0 -18
- package/lib/shapes/Ellipse.js +0 -37
- package/lib/shapes/Image.d.ts +0 -29
- package/lib/shapes/Image.js +0 -131
- package/lib/shapes/Label.d.ts +0 -39
- package/lib/shapes/Label.js +0 -173
- package/lib/shapes/Line.d.ts +0 -29
- package/lib/shapes/Line.js +0 -156
- package/lib/shapes/Path.d.ts +0 -50
- package/lib/shapes/Path.js +0 -670
- package/lib/shapes/Rect.d.ts +0 -11
- package/lib/shapes/Rect.js +0 -22
- package/lib/shapes/RegularPolygon.d.ts +0 -26
- package/lib/shapes/RegularPolygon.js +0 -72
- package/lib/shapes/Ring.d.ts +0 -17
- package/lib/shapes/Ring.js +0 -33
- package/lib/shapes/Sprite.d.ts +0 -32
- package/lib/shapes/Sprite.js +0 -108
- package/lib/shapes/Star.d.ts +0 -19
- package/lib/shapes/Star.js +0 -38
- package/lib/shapes/Text.d.ts +0 -90
- package/lib/shapes/Text.js +0 -460
- package/lib/shapes/TextPath.d.ts +0 -72
- package/lib/shapes/TextPath.js +0 -268
- package/lib/shapes/Transformer.d.ts +0 -130
- package/lib/shapes/Transformer.js +0 -1009
- package/lib/shapes/Wedge.d.ts +0 -19
- package/lib/shapes/Wedge.js +0 -38
- package/lib/skia-backend.d.ts +0 -2
- package/lib/skia-backend.js +0 -24
- package/lib/types.d.ts +0 -56
- package/lib/types.js +0 -21
package/lib/_FullInternals.d.ts
DELETED
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
import { Konva as Core } from './_CoreInternals.ts';
|
|
2
|
-
import { Arc } from './shapes/Arc.ts';
|
|
3
|
-
import { Arrow } from './shapes/Arrow.ts';
|
|
4
|
-
import { Circle } from './shapes/Circle.ts';
|
|
5
|
-
import { Ellipse } from './shapes/Ellipse.ts';
|
|
6
|
-
import { Image } from './shapes/Image.ts';
|
|
7
|
-
import { Label, Tag } from './shapes/Label.ts';
|
|
8
|
-
import { Line } from './shapes/Line.ts';
|
|
9
|
-
import { Path } from './shapes/Path.ts';
|
|
10
|
-
import { Rect } from './shapes/Rect.ts';
|
|
11
|
-
import { RegularPolygon } from './shapes/RegularPolygon.ts';
|
|
12
|
-
import { Ring } from './shapes/Ring.ts';
|
|
13
|
-
import { Sprite } from './shapes/Sprite.ts';
|
|
14
|
-
import { Star } from './shapes/Star.ts';
|
|
15
|
-
import { Text } from './shapes/Text.ts';
|
|
16
|
-
import { TextPath } from './shapes/TextPath.ts';
|
|
17
|
-
import { Transformer } from './shapes/Transformer.ts';
|
|
18
|
-
import { Wedge } from './shapes/Wedge.ts';
|
|
19
|
-
export declare const Konva: {
|
|
20
|
-
_global: any;
|
|
21
|
-
version: string;
|
|
22
|
-
isBrowser: boolean;
|
|
23
|
-
isUnminified: boolean;
|
|
24
|
-
dblClickWindow: number;
|
|
25
|
-
getAngle(angle: number): number;
|
|
26
|
-
enableTrace: boolean;
|
|
27
|
-
pointerEventsEnabled: boolean;
|
|
28
|
-
autoDrawEnabled: boolean;
|
|
29
|
-
hitOnDragEnabled: boolean;
|
|
30
|
-
capturePointerEventsEnabled: boolean;
|
|
31
|
-
_mouseListenClick: boolean;
|
|
32
|
-
_touchListenClick: boolean;
|
|
33
|
-
_pointerListenClick: boolean;
|
|
34
|
-
_mouseInDblClickWindow: boolean;
|
|
35
|
-
_touchInDblClickWindow: boolean;
|
|
36
|
-
_pointerInDblClickWindow: boolean;
|
|
37
|
-
_mouseDblClickPointerId: null;
|
|
38
|
-
_touchDblClickPointerId: null;
|
|
39
|
-
_pointerDblClickPointerId: null;
|
|
40
|
-
_renderBackend: string;
|
|
41
|
-
legacyTextRendering: boolean;
|
|
42
|
-
pixelRatio: number;
|
|
43
|
-
dragDistance: number;
|
|
44
|
-
angleDeg: boolean;
|
|
45
|
-
showWarnings: boolean;
|
|
46
|
-
dragButtons: number[];
|
|
47
|
-
isDragging(): boolean;
|
|
48
|
-
isTransforming(): boolean;
|
|
49
|
-
isDragReady(): boolean;
|
|
50
|
-
releaseCanvasOnDestroy: boolean;
|
|
51
|
-
document: any;
|
|
52
|
-
_injectGlobal(Konva: any): void;
|
|
53
|
-
} & {
|
|
54
|
-
Util: {
|
|
55
|
-
_isElement(obj: any): obj is Element;
|
|
56
|
-
_isFunction(obj: any): boolean;
|
|
57
|
-
_isPlainObject(obj: any): boolean;
|
|
58
|
-
_isArray(obj: any): obj is Array<any>;
|
|
59
|
-
_isNumber(obj: any): obj is number;
|
|
60
|
-
_isString(obj: any): obj is string;
|
|
61
|
-
_isBoolean(obj: any): obj is boolean;
|
|
62
|
-
isObject(val: any): val is object;
|
|
63
|
-
isValidSelector(selector: any): boolean;
|
|
64
|
-
_sign(number: number): 1 | -1;
|
|
65
|
-
requestAnimFrame(callback: Function): void;
|
|
66
|
-
createCanvasElement(): HTMLCanvasElement;
|
|
67
|
-
createImageElement(): HTMLImageElement;
|
|
68
|
-
_isInDocument(el: any): boolean;
|
|
69
|
-
_urlToImage(url: string, callback: Function): void;
|
|
70
|
-
_rgbToHex(r: number, g: number, b: number): string;
|
|
71
|
-
_hexToRgb(hex: string): import("./types.ts").RGB;
|
|
72
|
-
getRandomColor(): string;
|
|
73
|
-
getRGB(color: string): import("./types.ts").RGB;
|
|
74
|
-
colorToRGBA(str: string): {
|
|
75
|
-
r: number;
|
|
76
|
-
g: number;
|
|
77
|
-
b: number;
|
|
78
|
-
a: number;
|
|
79
|
-
} | undefined;
|
|
80
|
-
_namedColorToRBA(str: string): {
|
|
81
|
-
r: number;
|
|
82
|
-
g: number;
|
|
83
|
-
b: number;
|
|
84
|
-
a: number;
|
|
85
|
-
} | null;
|
|
86
|
-
_rgbColorToRGBA(str: string): {
|
|
87
|
-
r: number;
|
|
88
|
-
g: number;
|
|
89
|
-
b: number;
|
|
90
|
-
a: number;
|
|
91
|
-
} | undefined;
|
|
92
|
-
_rgbaColorToRGBA(str: string): {
|
|
93
|
-
r: number;
|
|
94
|
-
g: number;
|
|
95
|
-
b: number;
|
|
96
|
-
a: number;
|
|
97
|
-
} | undefined;
|
|
98
|
-
_hex8ColorToRGBA(str: string): {
|
|
99
|
-
r: number;
|
|
100
|
-
g: number;
|
|
101
|
-
b: number;
|
|
102
|
-
a: number;
|
|
103
|
-
} | undefined;
|
|
104
|
-
_hex6ColorToRGBA(str: string): {
|
|
105
|
-
r: number;
|
|
106
|
-
g: number;
|
|
107
|
-
b: number;
|
|
108
|
-
a: number;
|
|
109
|
-
} | undefined;
|
|
110
|
-
_hex4ColorToRGBA(str: string): {
|
|
111
|
-
r: number;
|
|
112
|
-
g: number;
|
|
113
|
-
b: number;
|
|
114
|
-
a: number;
|
|
115
|
-
} | undefined;
|
|
116
|
-
_hex3ColorToRGBA(str: string): {
|
|
117
|
-
r: number;
|
|
118
|
-
g: number;
|
|
119
|
-
b: number;
|
|
120
|
-
a: number;
|
|
121
|
-
} | undefined;
|
|
122
|
-
_hslColorToRGBA(str: string): {
|
|
123
|
-
r: number;
|
|
124
|
-
g: number;
|
|
125
|
-
b: number;
|
|
126
|
-
a: number;
|
|
127
|
-
} | undefined;
|
|
128
|
-
haveIntersection(r1: import("./types.ts").IRect, r2: import("./types.ts").IRect): boolean;
|
|
129
|
-
cloneObject<Any>(obj: Any): Any;
|
|
130
|
-
cloneArray(arr: Array<any>): any[];
|
|
131
|
-
degToRad(deg: number): number;
|
|
132
|
-
radToDeg(rad: number): number;
|
|
133
|
-
_degToRad(deg: number): number;
|
|
134
|
-
_radToDeg(rad: number): number;
|
|
135
|
-
_getRotation(radians: number): number;
|
|
136
|
-
_capitalize(str: string): string;
|
|
137
|
-
throw(str: string): never;
|
|
138
|
-
error(str: string): void;
|
|
139
|
-
warn(str: string): void;
|
|
140
|
-
each(obj: object, func: Function): void;
|
|
141
|
-
_inRange(val: number, left: number, right: number): boolean;
|
|
142
|
-
_getProjectionToSegment(x1: any, y1: any, x2: any, y2: any, x3: any, y3: any): any[];
|
|
143
|
-
_getProjectionToLine(pt: import("./types.ts").Vector2d, line: Array<import("./types.ts").Vector2d>, isClosed: boolean): import("./types.ts").Vector2d;
|
|
144
|
-
_prepareArrayForTween(startArray: any, endArray: any, isClosed: any): number[];
|
|
145
|
-
_prepareToStringify<T>(obj: any): T | null;
|
|
146
|
-
_assign<T, U>(target: T, source: U): T & U;
|
|
147
|
-
_getFirstPointerId(evt: any): any;
|
|
148
|
-
releaseCanvas(...canvases: HTMLCanvasElement[]): void;
|
|
149
|
-
drawRoundedRectPath(context: import("./Context.ts").Context, width: number, height: number, cornerRadius: number | number[]): void;
|
|
150
|
-
drawRoundedPolygonPath(context: import("./Context.ts").Context, points: import("./types.ts").Vector2d[], sides: number, radius: number, cornerRadius: number | number[]): void;
|
|
151
|
-
};
|
|
152
|
-
Transform: typeof import("./Util.ts").Transform;
|
|
153
|
-
Node: typeof import("./Node.ts").Node;
|
|
154
|
-
Container: typeof import("./Container.ts").Container;
|
|
155
|
-
Stage: typeof import("./Stage.ts").Stage;
|
|
156
|
-
stages: import("./Stage.ts").Stage[];
|
|
157
|
-
Layer: typeof import("./Layer.ts").Layer;
|
|
158
|
-
FastLayer: typeof import("./FastLayer.ts").FastLayer;
|
|
159
|
-
Group: typeof import("./Group.ts").Group;
|
|
160
|
-
DD: {
|
|
161
|
-
readonly isDragging: boolean;
|
|
162
|
-
justDragged: boolean;
|
|
163
|
-
readonly node: import("./Node.ts").Node<import("./Node.ts").NodeConfig> | undefined;
|
|
164
|
-
_dragElements: Map<number, {
|
|
165
|
-
node: import("./Node.ts").Node;
|
|
166
|
-
startPointerPos: import("./types.ts").Vector2d;
|
|
167
|
-
offset: import("./types.ts").Vector2d;
|
|
168
|
-
pointerId?: number;
|
|
169
|
-
dragStatus: "ready" | "dragging" | "stopped";
|
|
170
|
-
}>;
|
|
171
|
-
_drag(evt: any): void;
|
|
172
|
-
_endDragBefore(evt?: any): void;
|
|
173
|
-
_endDragAfter(evt: any): void;
|
|
174
|
-
};
|
|
175
|
-
Shape: typeof import("./Shape.ts").Shape;
|
|
176
|
-
shapes: {
|
|
177
|
-
[key: string]: import("./Shape.ts").Shape<import("./Shape.ts").ShapeConfig>;
|
|
178
|
-
};
|
|
179
|
-
Animation: typeof import("./Animation.ts").Animation;
|
|
180
|
-
Tween: typeof import("./Tween.ts").Tween;
|
|
181
|
-
Easings: {
|
|
182
|
-
BackEaseIn(t: any, b: any, c: any, d: any): any;
|
|
183
|
-
BackEaseOut(t: any, b: any, c: any, d: any): any;
|
|
184
|
-
BackEaseInOut(t: any, b: any, c: any, d: any): any;
|
|
185
|
-
ElasticEaseIn(t: any, b: any, c: any, d: any, a: any, p: any): any;
|
|
186
|
-
ElasticEaseOut(t: any, b: any, c: any, d: any, a: any, p: any): any;
|
|
187
|
-
ElasticEaseInOut(t: any, b: any, c: any, d: any, a: any, p: any): any;
|
|
188
|
-
BounceEaseOut(t: any, b: any, c: any, d: any): any;
|
|
189
|
-
BounceEaseIn(t: any, b: any, c: any, d: any): any;
|
|
190
|
-
BounceEaseInOut(t: any, b: any, c: any, d: any): any;
|
|
191
|
-
EaseIn(t: any, b: any, c: any, d: any): any;
|
|
192
|
-
EaseOut(t: any, b: any, c: any, d: any): any;
|
|
193
|
-
EaseInOut(t: any, b: any, c: any, d: any): any;
|
|
194
|
-
StrongEaseIn(t: any, b: any, c: any, d: any): any;
|
|
195
|
-
StrongEaseOut(t: any, b: any, c: any, d: any): any;
|
|
196
|
-
StrongEaseInOut(t: any, b: any, c: any, d: any): any;
|
|
197
|
-
Linear(t: any, b: any, c: any, d: any): any;
|
|
198
|
-
};
|
|
199
|
-
Context: typeof import("./Context.ts").Context;
|
|
200
|
-
Canvas: typeof import("./Canvas.ts").Canvas;
|
|
201
|
-
} & {
|
|
202
|
-
Arc: typeof Arc;
|
|
203
|
-
Arrow: typeof Arrow;
|
|
204
|
-
Circle: typeof Circle;
|
|
205
|
-
Ellipse: typeof Ellipse;
|
|
206
|
-
Image: typeof Image;
|
|
207
|
-
Label: typeof Label;
|
|
208
|
-
Tag: typeof Tag;
|
|
209
|
-
Line: typeof Line;
|
|
210
|
-
Path: typeof Path;
|
|
211
|
-
Rect: typeof Rect;
|
|
212
|
-
RegularPolygon: typeof RegularPolygon;
|
|
213
|
-
Ring: typeof Ring;
|
|
214
|
-
Sprite: typeof Sprite;
|
|
215
|
-
Star: typeof Star;
|
|
216
|
-
Text: typeof Text;
|
|
217
|
-
TextPath: typeof TextPath;
|
|
218
|
-
Transformer: typeof Transformer;
|
|
219
|
-
Wedge: typeof Wedge;
|
|
220
|
-
Filters: {
|
|
221
|
-
Blur: import("./Node.ts").Filter;
|
|
222
|
-
Brightness: import("./Node.ts").Filter;
|
|
223
|
-
Brighten: import("./Node.ts").Filter;
|
|
224
|
-
Contrast: import("./Node.ts").Filter;
|
|
225
|
-
Emboss: import("./Node.ts").Filter;
|
|
226
|
-
Enhance: import("./Node.ts").Filter;
|
|
227
|
-
Grayscale: import("./Node.ts").Filter;
|
|
228
|
-
HSL: import("./Node.ts").Filter;
|
|
229
|
-
HSV: import("./Node.ts").Filter;
|
|
230
|
-
Invert: import("./Node.ts").Filter;
|
|
231
|
-
Kaleidoscope: import("./Node.ts").Filter;
|
|
232
|
-
Mask: import("./Node.ts").Filter;
|
|
233
|
-
Noise: import("./Node.ts").Filter;
|
|
234
|
-
Pixelate: import("./Node.ts").Filter;
|
|
235
|
-
Posterize: import("./Node.ts").Filter;
|
|
236
|
-
RGB: import("./Node.ts").Filter;
|
|
237
|
-
RGBA: import("./Node.ts").Filter;
|
|
238
|
-
Sepia: import("./Node.ts").Filter;
|
|
239
|
-
Solarize: import("./Node.ts").Filter;
|
|
240
|
-
Threshold: import("./Node.ts").Filter;
|
|
241
|
-
};
|
|
242
|
-
};
|
|
243
|
-
export declare namespace Konva {
|
|
244
|
-
type Vector2d = Core.Vector2d;
|
|
245
|
-
type Node = Core.Node;
|
|
246
|
-
type NodeConfig = Core.NodeConfig;
|
|
247
|
-
type KonvaEventObject<EventType> = Core.KonvaEventObject<EventType>;
|
|
248
|
-
type KonvaPointerEvent = Core.KonvaPointerEvent;
|
|
249
|
-
type KonvaEventListener<This, EventType> = Core.KonvaEventListener<This, EventType>;
|
|
250
|
-
type Container = Core.Container;
|
|
251
|
-
type ContainerConfig = Core.ContainerConfig;
|
|
252
|
-
type Transform = Core.Transform;
|
|
253
|
-
type Context = Core.Context;
|
|
254
|
-
type Stage = Core.Stage;
|
|
255
|
-
type StageConfig = Core.StageConfig;
|
|
256
|
-
type Layer = Core.Layer;
|
|
257
|
-
type LayerConfig = Core.LayerConfig;
|
|
258
|
-
type FastLayer = Core.FastLayer;
|
|
259
|
-
type Group = Core.Group;
|
|
260
|
-
type GroupConfig = Core.GroupConfig;
|
|
261
|
-
type Shape = Core.Shape;
|
|
262
|
-
type ShapeConfig = Core.ShapeConfig;
|
|
263
|
-
type Animation = Core.Animation;
|
|
264
|
-
type Tween = Core.Tween;
|
|
265
|
-
type TweenConfig = Core.TweenConfig;
|
|
266
|
-
type Arc = import('./shapes/Arc.ts').Arc;
|
|
267
|
-
type ArcConfig = import('./shapes/Arc.ts').ArcConfig;
|
|
268
|
-
type Arrow = import('./shapes/Arrow.ts').Arrow;
|
|
269
|
-
type ArrowConfig = import('./shapes/Arrow.ts').ArrowConfig;
|
|
270
|
-
type Circle = import('./shapes/Circle.ts').Circle;
|
|
271
|
-
type CircleConfig = import('./shapes/Circle.ts').CircleConfig;
|
|
272
|
-
type Ellipse = import('./shapes/Ellipse.ts').Ellipse;
|
|
273
|
-
type EllipseConfig = import('./shapes/Ellipse.ts').EllipseConfig;
|
|
274
|
-
type Image = import('./shapes/Image.ts').Image;
|
|
275
|
-
type ImageConfig = import('./shapes/Image.ts').ImageConfig;
|
|
276
|
-
type Label = import('./shapes/Label.ts').Label;
|
|
277
|
-
type LabelConfig = import('./shapes/Label.ts').LabelConfig;
|
|
278
|
-
type Tag = import('./shapes/Label.ts').Tag;
|
|
279
|
-
type TagConfig = import('./shapes/Label.ts').TagConfig;
|
|
280
|
-
type Line = import('./shapes/Line.ts').Line;
|
|
281
|
-
type LineConfig = import('./shapes/Line.ts').LineConfig;
|
|
282
|
-
type Path = import('./shapes/Path.ts').Path;
|
|
283
|
-
type PathConfig = import('./shapes/Path.ts').PathConfig;
|
|
284
|
-
type Rect = import('./shapes/Rect.ts').Rect;
|
|
285
|
-
type RectConfig = import('./shapes/Rect.ts').RectConfig;
|
|
286
|
-
type RegularPolygon = import('./shapes/RegularPolygon.ts').RegularPolygon;
|
|
287
|
-
type RegularPolygonConfig = import('./shapes/RegularPolygon.ts').RegularPolygonConfig;
|
|
288
|
-
type Ring = import('./shapes/Ring.ts').Ring;
|
|
289
|
-
type RingConfig = import('./shapes/Ring.ts').RingConfig;
|
|
290
|
-
type Sprite = import('./shapes/Sprite.ts').Sprite;
|
|
291
|
-
type SpriteConfig = import('./shapes/Sprite.ts').SpriteConfig;
|
|
292
|
-
type Star = import('./shapes/Star.ts').Star;
|
|
293
|
-
type StarConfig = import('./shapes/Star.ts').StarConfig;
|
|
294
|
-
type Text = import('./shapes/Text.ts').Text;
|
|
295
|
-
type TextConfig = import('./shapes/Text.ts').TextConfig;
|
|
296
|
-
type TextPath = import('./shapes/TextPath.ts').TextPath;
|
|
297
|
-
type TextPathConfig = import('./shapes/TextPath.ts').TextPathConfig;
|
|
298
|
-
type Transformer = import('./shapes/Transformer.ts').Transformer;
|
|
299
|
-
type TransformerConfig = import('./shapes/Transformer.ts').TransformerConfig;
|
|
300
|
-
type Wedge = import('./shapes/Wedge.ts').Wedge;
|
|
301
|
-
type WedgeConfig = import('./shapes/Wedge.ts').WedgeConfig;
|
|
302
|
-
}
|
package/lib/_FullInternals.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { Konva as Core } from "./_CoreInternals.js";
|
|
2
|
-
import { Arc } from "./shapes/Arc.js";
|
|
3
|
-
import { Arrow } from "./shapes/Arrow.js";
|
|
4
|
-
import { Circle } from "./shapes/Circle.js";
|
|
5
|
-
import { Ellipse } from "./shapes/Ellipse.js";
|
|
6
|
-
import { Image } from "./shapes/Image.js";
|
|
7
|
-
import { Label, Tag } from "./shapes/Label.js";
|
|
8
|
-
import { Line } from "./shapes/Line.js";
|
|
9
|
-
import { Path } from "./shapes/Path.js";
|
|
10
|
-
import { Rect } from "./shapes/Rect.js";
|
|
11
|
-
import { RegularPolygon } from "./shapes/RegularPolygon.js";
|
|
12
|
-
import { Ring } from "./shapes/Ring.js";
|
|
13
|
-
import { Sprite } from "./shapes/Sprite.js";
|
|
14
|
-
import { Star } from "./shapes/Star.js";
|
|
15
|
-
import { Text } from "./shapes/Text.js";
|
|
16
|
-
import { TextPath } from "./shapes/TextPath.js";
|
|
17
|
-
import { Transformer } from "./shapes/Transformer.js";
|
|
18
|
-
import { Wedge } from "./shapes/Wedge.js";
|
|
19
|
-
import { Blur } from "./filters/Blur.js";
|
|
20
|
-
import { Brighten } from "./filters/Brighten.js";
|
|
21
|
-
import { Brightness } from "./filters/Brightness.js";
|
|
22
|
-
import { Contrast } from "./filters/Contrast.js";
|
|
23
|
-
import { Emboss } from "./filters/Emboss.js";
|
|
24
|
-
import { Enhance } from "./filters/Enhance.js";
|
|
25
|
-
import { Grayscale } from "./filters/Grayscale.js";
|
|
26
|
-
import { HSL } from "./filters/HSL.js";
|
|
27
|
-
import { HSV } from "./filters/HSV.js";
|
|
28
|
-
import { Invert } from "./filters/Invert.js";
|
|
29
|
-
import { Kaleidoscope } from "./filters/Kaleidoscope.js";
|
|
30
|
-
import { Mask } from "./filters/Mask.js";
|
|
31
|
-
import { Noise } from "./filters/Noise.js";
|
|
32
|
-
import { Pixelate } from "./filters/Pixelate.js";
|
|
33
|
-
import { Posterize } from "./filters/Posterize.js";
|
|
34
|
-
import { RGB } from "./filters/RGB.js";
|
|
35
|
-
import { RGBA } from "./filters/RGBA.js";
|
|
36
|
-
import { Sepia } from "./filters/Sepia.js";
|
|
37
|
-
import { Solarize } from "./filters/Solarize.js";
|
|
38
|
-
import { Threshold } from "./filters/Threshold.js";
|
|
39
|
-
export const Konva = Core.Util._assign(Core, {
|
|
40
|
-
Arc,
|
|
41
|
-
Arrow,
|
|
42
|
-
Circle,
|
|
43
|
-
Ellipse,
|
|
44
|
-
Image,
|
|
45
|
-
Label,
|
|
46
|
-
Tag,
|
|
47
|
-
Line,
|
|
48
|
-
Path,
|
|
49
|
-
Rect,
|
|
50
|
-
RegularPolygon,
|
|
51
|
-
Ring,
|
|
52
|
-
Sprite,
|
|
53
|
-
Star,
|
|
54
|
-
Text,
|
|
55
|
-
TextPath,
|
|
56
|
-
Transformer,
|
|
57
|
-
Wedge,
|
|
58
|
-
Filters: {
|
|
59
|
-
Blur,
|
|
60
|
-
Brightness,
|
|
61
|
-
Brighten,
|
|
62
|
-
Contrast,
|
|
63
|
-
Emboss,
|
|
64
|
-
Enhance,
|
|
65
|
-
Grayscale,
|
|
66
|
-
HSL,
|
|
67
|
-
HSV,
|
|
68
|
-
Invert,
|
|
69
|
-
Kaleidoscope,
|
|
70
|
-
Mask,
|
|
71
|
-
Noise,
|
|
72
|
-
Pixelate,
|
|
73
|
-
Posterize,
|
|
74
|
-
RGB,
|
|
75
|
-
RGBA,
|
|
76
|
-
Sepia,
|
|
77
|
-
Solarize,
|
|
78
|
-
Threshold,
|
|
79
|
-
},
|
|
80
|
-
});
|
package/lib/canvas-backend.d.ts
DELETED
package/lib/canvas-backend.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
var _a;
|
|
2
|
-
var _b;
|
|
3
|
-
import { Konva } from "./_CoreInternals.js";
|
|
4
|
-
import * as Canvas from 'canvas';
|
|
5
|
-
const canvas = Canvas['default'] || Canvas;
|
|
6
|
-
global.DOMMatrix = canvas.DOMMatrix;
|
|
7
|
-
(_a = (_b = global).Path2D) !== null && _a !== void 0 ? _a : (_b.Path2D = class Path2D {
|
|
8
|
-
constructor(path) {
|
|
9
|
-
this.path = path;
|
|
10
|
-
}
|
|
11
|
-
get [Symbol.toStringTag]() {
|
|
12
|
-
return `Path2D`;
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
Konva.Util['createCanvasElement'] = () => {
|
|
16
|
-
const node = canvas.createCanvas(300, 300);
|
|
17
|
-
if (!node['style']) {
|
|
18
|
-
node['style'] = {};
|
|
19
|
-
}
|
|
20
|
-
return node;
|
|
21
|
-
};
|
|
22
|
-
Konva.Util.createImageElement = () => {
|
|
23
|
-
const node = new canvas.Image();
|
|
24
|
-
return node;
|
|
25
|
-
};
|
|
26
|
-
Konva._renderBackend = 'node-canvas';
|
|
27
|
-
export default Konva;
|
package/lib/filters/Blur.d.ts
DELETED
package/lib/filters/Blur.js
DELETED
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
import { Factory } from "../Factory.js";
|
|
2
|
-
import { Node } from "../Node.js";
|
|
3
|
-
import { getNumberValidator } from "../Validators.js";
|
|
4
|
-
function BlurStack() {
|
|
5
|
-
this.r = 0;
|
|
6
|
-
this.g = 0;
|
|
7
|
-
this.b = 0;
|
|
8
|
-
this.a = 0;
|
|
9
|
-
this.next = null;
|
|
10
|
-
}
|
|
11
|
-
const mul_table = [
|
|
12
|
-
512, 512, 456, 512, 328, 456, 335, 512, 405, 328, 271, 456, 388, 335, 292,
|
|
13
|
-
512, 454, 405, 364, 328, 298, 271, 496, 456, 420, 388, 360, 335, 312, 292,
|
|
14
|
-
273, 512, 482, 454, 428, 405, 383, 364, 345, 328, 312, 298, 284, 271, 259,
|
|
15
|
-
496, 475, 456, 437, 420, 404, 388, 374, 360, 347, 335, 323, 312, 302, 292,
|
|
16
|
-
282, 273, 265, 512, 497, 482, 468, 454, 441, 428, 417, 405, 394, 383, 373,
|
|
17
|
-
364, 354, 345, 337, 328, 320, 312, 305, 298, 291, 284, 278, 271, 265, 259,
|
|
18
|
-
507, 496, 485, 475, 465, 456, 446, 437, 428, 420, 412, 404, 396, 388, 381,
|
|
19
|
-
374, 367, 360, 354, 347, 341, 335, 329, 323, 318, 312, 307, 302, 297, 292,
|
|
20
|
-
287, 282, 278, 273, 269, 265, 261, 512, 505, 497, 489, 482, 475, 468, 461,
|
|
21
|
-
454, 447, 441, 435, 428, 422, 417, 411, 405, 399, 394, 389, 383, 378, 373,
|
|
22
|
-
368, 364, 359, 354, 350, 345, 341, 337, 332, 328, 324, 320, 316, 312, 309,
|
|
23
|
-
305, 301, 298, 294, 291, 287, 284, 281, 278, 274, 271, 268, 265, 262, 259,
|
|
24
|
-
257, 507, 501, 496, 491, 485, 480, 475, 470, 465, 460, 456, 451, 446, 442,
|
|
25
|
-
437, 433, 428, 424, 420, 416, 412, 408, 404, 400, 396, 392, 388, 385, 381,
|
|
26
|
-
377, 374, 370, 367, 363, 360, 357, 354, 350, 347, 344, 341, 338, 335, 332,
|
|
27
|
-
329, 326, 323, 320, 318, 315, 312, 310, 307, 304, 302, 299, 297, 294, 292,
|
|
28
|
-
289, 287, 285, 282, 280, 278, 275, 273, 271, 269, 267, 265, 263, 261, 259,
|
|
29
|
-
];
|
|
30
|
-
const shg_table = [
|
|
31
|
-
9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17,
|
|
32
|
-
17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19,
|
|
33
|
-
19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
|
34
|
-
20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
|
|
35
|
-
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22,
|
|
36
|
-
22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
|
|
37
|
-
22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23,
|
|
38
|
-
23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
|
|
39
|
-
23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
|
|
40
|
-
23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
|
41
|
-
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
|
42
|
-
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
|
43
|
-
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
|
44
|
-
24, 24, 24, 24, 24, 24, 24,
|
|
45
|
-
];
|
|
46
|
-
function filterGaussBlurRGBA(imageData, radius) {
|
|
47
|
-
const pixels = imageData.data, width = imageData.width, height = imageData.height;
|
|
48
|
-
let p, yi, yw, r_sum, g_sum, b_sum, a_sum, r_out_sum, g_out_sum, b_out_sum, a_out_sum, r_in_sum, g_in_sum, b_in_sum, a_in_sum, pr, pg, pb, pa, rbs;
|
|
49
|
-
const div = radius + radius + 1, widthMinus1 = width - 1, heightMinus1 = height - 1, radiusPlus1 = radius + 1, sumFactor = (radiusPlus1 * (radiusPlus1 + 1)) / 2, stackStart = new BlurStack(), mul_sum = mul_table[radius], shg_sum = shg_table[radius];
|
|
50
|
-
let stackEnd = null, stack = stackStart, stackIn = null, stackOut = null;
|
|
51
|
-
for (let i = 1; i < div; i++) {
|
|
52
|
-
stack = stack.next = new BlurStack();
|
|
53
|
-
if (i === radiusPlus1) {
|
|
54
|
-
stackEnd = stack;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
stack.next = stackStart;
|
|
58
|
-
yw = yi = 0;
|
|
59
|
-
for (let y = 0; y < height; y++) {
|
|
60
|
-
r_in_sum =
|
|
61
|
-
g_in_sum =
|
|
62
|
-
b_in_sum =
|
|
63
|
-
a_in_sum =
|
|
64
|
-
r_sum =
|
|
65
|
-
g_sum =
|
|
66
|
-
b_sum =
|
|
67
|
-
a_sum =
|
|
68
|
-
0;
|
|
69
|
-
r_out_sum = radiusPlus1 * (pr = pixels[yi]);
|
|
70
|
-
g_out_sum = radiusPlus1 * (pg = pixels[yi + 1]);
|
|
71
|
-
b_out_sum = radiusPlus1 * (pb = pixels[yi + 2]);
|
|
72
|
-
a_out_sum = radiusPlus1 * (pa = pixels[yi + 3]);
|
|
73
|
-
r_sum += sumFactor * pr;
|
|
74
|
-
g_sum += sumFactor * pg;
|
|
75
|
-
b_sum += sumFactor * pb;
|
|
76
|
-
a_sum += sumFactor * pa;
|
|
77
|
-
stack = stackStart;
|
|
78
|
-
for (let i = 0; i < radiusPlus1; i++) {
|
|
79
|
-
stack.r = pr;
|
|
80
|
-
stack.g = pg;
|
|
81
|
-
stack.b = pb;
|
|
82
|
-
stack.a = pa;
|
|
83
|
-
stack = stack.next;
|
|
84
|
-
}
|
|
85
|
-
for (let i = 1; i < radiusPlus1; i++) {
|
|
86
|
-
p = yi + ((widthMinus1 < i ? widthMinus1 : i) << 2);
|
|
87
|
-
r_sum += (stack.r = pr = pixels[p]) * (rbs = radiusPlus1 - i);
|
|
88
|
-
g_sum += (stack.g = pg = pixels[p + 1]) * rbs;
|
|
89
|
-
b_sum += (stack.b = pb = pixels[p + 2]) * rbs;
|
|
90
|
-
a_sum += (stack.a = pa = pixels[p + 3]) * rbs;
|
|
91
|
-
r_in_sum += pr;
|
|
92
|
-
g_in_sum += pg;
|
|
93
|
-
b_in_sum += pb;
|
|
94
|
-
a_in_sum += pa;
|
|
95
|
-
stack = stack.next;
|
|
96
|
-
}
|
|
97
|
-
stackIn = stackStart;
|
|
98
|
-
stackOut = stackEnd;
|
|
99
|
-
for (let x = 0; x < width; x++) {
|
|
100
|
-
pixels[yi + 3] = pa = (a_sum * mul_sum) >> shg_sum;
|
|
101
|
-
if (pa !== 0) {
|
|
102
|
-
pa = 255 / pa;
|
|
103
|
-
pixels[yi] = ((r_sum * mul_sum) >> shg_sum) * pa;
|
|
104
|
-
pixels[yi + 1] = ((g_sum * mul_sum) >> shg_sum) * pa;
|
|
105
|
-
pixels[yi + 2] = ((b_sum * mul_sum) >> shg_sum) * pa;
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
pixels[yi] = pixels[yi + 1] = pixels[yi + 2] = 0;
|
|
109
|
-
}
|
|
110
|
-
r_sum -= r_out_sum;
|
|
111
|
-
g_sum -= g_out_sum;
|
|
112
|
-
b_sum -= b_out_sum;
|
|
113
|
-
a_sum -= a_out_sum;
|
|
114
|
-
r_out_sum -= stackIn.r;
|
|
115
|
-
g_out_sum -= stackIn.g;
|
|
116
|
-
b_out_sum -= stackIn.b;
|
|
117
|
-
a_out_sum -= stackIn.a;
|
|
118
|
-
p = (yw + ((p = x + radius + 1) < widthMinus1 ? p : widthMinus1)) << 2;
|
|
119
|
-
r_in_sum += stackIn.r = pixels[p];
|
|
120
|
-
g_in_sum += stackIn.g = pixels[p + 1];
|
|
121
|
-
b_in_sum += stackIn.b = pixels[p + 2];
|
|
122
|
-
a_in_sum += stackIn.a = pixels[p + 3];
|
|
123
|
-
r_sum += r_in_sum;
|
|
124
|
-
g_sum += g_in_sum;
|
|
125
|
-
b_sum += b_in_sum;
|
|
126
|
-
a_sum += a_in_sum;
|
|
127
|
-
stackIn = stackIn.next;
|
|
128
|
-
r_out_sum += pr = stackOut.r;
|
|
129
|
-
g_out_sum += pg = stackOut.g;
|
|
130
|
-
b_out_sum += pb = stackOut.b;
|
|
131
|
-
a_out_sum += pa = stackOut.a;
|
|
132
|
-
r_in_sum -= pr;
|
|
133
|
-
g_in_sum -= pg;
|
|
134
|
-
b_in_sum -= pb;
|
|
135
|
-
a_in_sum -= pa;
|
|
136
|
-
stackOut = stackOut.next;
|
|
137
|
-
yi += 4;
|
|
138
|
-
}
|
|
139
|
-
yw += width;
|
|
140
|
-
}
|
|
141
|
-
for (let x = 0; x < width; x++) {
|
|
142
|
-
g_in_sum =
|
|
143
|
-
b_in_sum =
|
|
144
|
-
a_in_sum =
|
|
145
|
-
r_in_sum =
|
|
146
|
-
g_sum =
|
|
147
|
-
b_sum =
|
|
148
|
-
a_sum =
|
|
149
|
-
r_sum =
|
|
150
|
-
0;
|
|
151
|
-
yi = x << 2;
|
|
152
|
-
r_out_sum = radiusPlus1 * (pr = pixels[yi]);
|
|
153
|
-
g_out_sum = radiusPlus1 * (pg = pixels[yi + 1]);
|
|
154
|
-
b_out_sum = radiusPlus1 * (pb = pixels[yi + 2]);
|
|
155
|
-
a_out_sum = radiusPlus1 * (pa = pixels[yi + 3]);
|
|
156
|
-
r_sum += sumFactor * pr;
|
|
157
|
-
g_sum += sumFactor * pg;
|
|
158
|
-
b_sum += sumFactor * pb;
|
|
159
|
-
a_sum += sumFactor * pa;
|
|
160
|
-
stack = stackStart;
|
|
161
|
-
for (let i = 0; i < radiusPlus1; i++) {
|
|
162
|
-
stack.r = pr;
|
|
163
|
-
stack.g = pg;
|
|
164
|
-
stack.b = pb;
|
|
165
|
-
stack.a = pa;
|
|
166
|
-
stack = stack.next;
|
|
167
|
-
}
|
|
168
|
-
let yp = width;
|
|
169
|
-
for (let i = 1; i <= radius; i++) {
|
|
170
|
-
yi = (yp + x) << 2;
|
|
171
|
-
r_sum += (stack.r = pr = pixels[yi]) * (rbs = radiusPlus1 - i);
|
|
172
|
-
g_sum += (stack.g = pg = pixels[yi + 1]) * rbs;
|
|
173
|
-
b_sum += (stack.b = pb = pixels[yi + 2]) * rbs;
|
|
174
|
-
a_sum += (stack.a = pa = pixels[yi + 3]) * rbs;
|
|
175
|
-
r_in_sum += pr;
|
|
176
|
-
g_in_sum += pg;
|
|
177
|
-
b_in_sum += pb;
|
|
178
|
-
a_in_sum += pa;
|
|
179
|
-
stack = stack.next;
|
|
180
|
-
if (i < heightMinus1) {
|
|
181
|
-
yp += width;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
yi = x;
|
|
185
|
-
stackIn = stackStart;
|
|
186
|
-
stackOut = stackEnd;
|
|
187
|
-
for (let y = 0; y < height; y++) {
|
|
188
|
-
p = yi << 2;
|
|
189
|
-
pixels[p + 3] = pa = (a_sum * mul_sum) >> shg_sum;
|
|
190
|
-
if (pa > 0) {
|
|
191
|
-
pa = 255 / pa;
|
|
192
|
-
pixels[p] = ((r_sum * mul_sum) >> shg_sum) * pa;
|
|
193
|
-
pixels[p + 1] = ((g_sum * mul_sum) >> shg_sum) * pa;
|
|
194
|
-
pixels[p + 2] = ((b_sum * mul_sum) >> shg_sum) * pa;
|
|
195
|
-
}
|
|
196
|
-
else {
|
|
197
|
-
pixels[p] = pixels[p + 1] = pixels[p + 2] = 0;
|
|
198
|
-
}
|
|
199
|
-
r_sum -= r_out_sum;
|
|
200
|
-
g_sum -= g_out_sum;
|
|
201
|
-
b_sum -= b_out_sum;
|
|
202
|
-
a_sum -= a_out_sum;
|
|
203
|
-
r_out_sum -= stackIn.r;
|
|
204
|
-
g_out_sum -= stackIn.g;
|
|
205
|
-
b_out_sum -= stackIn.b;
|
|
206
|
-
a_out_sum -= stackIn.a;
|
|
207
|
-
p =
|
|
208
|
-
(x +
|
|
209
|
-
((p = y + radiusPlus1) < heightMinus1 ? p : heightMinus1) * width) <<
|
|
210
|
-
2;
|
|
211
|
-
r_sum += r_in_sum += stackIn.r = pixels[p];
|
|
212
|
-
g_sum += g_in_sum += stackIn.g = pixels[p + 1];
|
|
213
|
-
b_sum += b_in_sum += stackIn.b = pixels[p + 2];
|
|
214
|
-
a_sum += a_in_sum += stackIn.a = pixels[p + 3];
|
|
215
|
-
stackIn = stackIn.next;
|
|
216
|
-
r_out_sum += pr = stackOut.r;
|
|
217
|
-
g_out_sum += pg = stackOut.g;
|
|
218
|
-
b_out_sum += pb = stackOut.b;
|
|
219
|
-
a_out_sum += pa = stackOut.a;
|
|
220
|
-
r_in_sum -= pr;
|
|
221
|
-
g_in_sum -= pg;
|
|
222
|
-
b_in_sum -= pb;
|
|
223
|
-
a_in_sum -= pa;
|
|
224
|
-
stackOut = stackOut.next;
|
|
225
|
-
yi += width;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
export const Blur = function Blur(imageData) {
|
|
230
|
-
const radius = Math.round(this.blurRadius());
|
|
231
|
-
if (radius > 0) {
|
|
232
|
-
filterGaussBlurRGBA(imageData, radius);
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
Factory.addGetterSetter(Node, 'blurRadius', 0, getNumberValidator(), Factory.afterSetFilter);
|
package/lib/filters/Brighten.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Factory } from "../Factory.js";
|
|
2
|
-
import { Node } from "../Node.js";
|
|
3
|
-
import { getNumberValidator } from "../Validators.js";
|
|
4
|
-
export const Brighten = function (imageData) {
|
|
5
|
-
const brightness = this.brightness() * 255, data = imageData.data, len = data.length;
|
|
6
|
-
for (let i = 0; i < len; i += 4) {
|
|
7
|
-
data[i] += brightness;
|
|
8
|
-
data[i + 1] += brightness;
|
|
9
|
-
data[i + 2] += brightness;
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
Factory.addGetterSetter(Node, 'brightness', 0, getNumberValidator(), Factory.afterSetFilter);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export const Brightness = function (imageData) {
|
|
2
|
-
const brightness = this.brightness(), data = imageData.data, len = data.length;
|
|
3
|
-
for (let i = 0; i < len; i += 4) {
|
|
4
|
-
data[i] = Math.min(255, data[i] * brightness);
|
|
5
|
-
data[i + 1] = Math.min(255, data[i + 1] * brightness);
|
|
6
|
-
data[i + 2] = Math.min(255, data[i + 2] * brightness);
|
|
7
|
-
}
|
|
8
|
-
};
|