med-viewer-sdk 0.1.3 → 0.1.4
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/core/ColorAdjustPlugin.d.ts +20 -11
- package/dist/core/Engine.d.ts +2 -5
- package/dist/core/i18n.d.ts +6 -0
- package/dist/med-viewer-sdk.mjs +4350 -4281
- package/dist/med-viewer-sdk.umd.js +1 -1
- package/package.json +1 -1
- package/src/core/AnnoAnnotator.ts +2 -9
- package/src/core/ColorAdjustPlugin.ts +142 -145
- package/src/core/Engine.ts +63 -32
- package/src/core/Magnification.ts +2 -2
- package/src/core/Scalebar.ts +2 -1
- package/src/core/SelectionPlugin.ts +4 -7
- package/src/core/Toolbar.ts +26 -25
- package/src/core/i18n.ts +83 -0
|
@@ -4,33 +4,42 @@ export interface ColorAdjustments {
|
|
|
4
4
|
contrast?: number;
|
|
5
5
|
saturation?: number;
|
|
6
6
|
gamma?: number;
|
|
7
|
-
invert?: boolean;
|
|
8
7
|
hue?: number;
|
|
8
|
+
invert?: boolean;
|
|
9
9
|
sepia?: boolean;
|
|
10
10
|
greyscale?: boolean;
|
|
11
11
|
}
|
|
12
|
-
/**
|
|
13
|
-
* 2. 插件初始化选项接口
|
|
14
|
-
*/
|
|
15
12
|
export interface ColorAdjustOptions {
|
|
16
13
|
adjustments?: ColorAdjustments;
|
|
17
14
|
debounceMs?: number;
|
|
18
|
-
loadMode?:
|
|
15
|
+
loadMode?: "async" | "sync";
|
|
19
16
|
}
|
|
20
17
|
export declare class ColorAdjustPlugin {
|
|
21
18
|
private viewer;
|
|
22
19
|
private _adjustments;
|
|
23
|
-
|
|
20
|
+
private options;
|
|
21
|
+
private lut;
|
|
22
|
+
private needUpdate;
|
|
24
23
|
private debounceTimer;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
constructor(viewer: any, options?: ColorAdjustOptions);
|
|
25
|
+
/**
|
|
26
|
+
* 更新查找表 (LUT)
|
|
27
|
+
* 将亮度、对比度、反色、伽马合并为一个 256 长度的数组,大幅减少循环内计算
|
|
28
|
+
*/
|
|
29
|
+
private updateLut;
|
|
29
30
|
/**
|
|
30
|
-
*
|
|
31
|
+
* 核心处理器:利用异步调度减少主线程占用
|
|
31
32
|
*/
|
|
32
33
|
private combinedProcessor;
|
|
34
|
+
/**
|
|
35
|
+
* 应用滤镜配置到 Viewer
|
|
36
|
+
*/
|
|
33
37
|
apply(): void;
|
|
38
|
+
/**
|
|
39
|
+
* 业务层调用的 API,内置防抖
|
|
40
|
+
*/
|
|
34
41
|
setAdjustments(adj: ColorAdjustments): void;
|
|
42
|
+
get adjustments(): ColorAdjustments;
|
|
35
43
|
reset(): void;
|
|
44
|
+
destroy(): void;
|
|
36
45
|
}
|
package/dist/core/Engine.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { ColorAdjustPlugin, type ColorAdjustOptions } from "./ColorAdjustPlugin"
|
|
|
5
5
|
import { SelectionPlugin, type SelectionOptions } from './SelectionPlugin';
|
|
6
6
|
import { ScalebarPlugin, type ScalebarOptions } from './Scalebar';
|
|
7
7
|
import { MagnificationPlugin, type MagnificationOptions } from './Magnification';
|
|
8
|
+
import { Locale } from "./i18n";
|
|
8
9
|
/**
|
|
9
10
|
* 引擎配置接口
|
|
10
11
|
*/
|
|
@@ -13,6 +14,7 @@ export interface MedEngineOptions {
|
|
|
13
14
|
tileSource: string | any;
|
|
14
15
|
navigatorBorderRadius?: number;
|
|
15
16
|
prefixUrl?: string;
|
|
17
|
+
locale?: Locale;
|
|
16
18
|
plugins?: {
|
|
17
19
|
annotorious?: boolean | any;
|
|
18
20
|
toolbar?: boolean | ToolbarOptions;
|
|
@@ -45,11 +47,6 @@ export declare class MedViewerEngine {
|
|
|
45
47
|
* 真正挂载 Annotorious 的私有方法
|
|
46
48
|
*/
|
|
47
49
|
private mountAnnotorious;
|
|
48
|
-
/**
|
|
49
|
-
* 统一切换交互模式
|
|
50
|
-
* @param mode 'browse' | 'konva' | 'anno'
|
|
51
|
-
*/
|
|
52
|
-
setInteractionEffect(mode: "browse" | "konva" | "anno"): void;
|
|
53
50
|
/**
|
|
54
51
|
* 销毁引擎与所有插件
|
|
55
52
|
*/
|