med-viewer-sdk 0.1.2 → 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/core/ColorAdjustPlugin.d.ts +24 -17
- package/dist/core/Engine.d.ts +3 -0
- package/dist/core/Magnification.d.ts +25 -0
- package/dist/med-viewer-sdk.d.ts +3 -1
- package/dist/med-viewer-sdk.mjs +1191 -20
- package/dist/med-viewer-sdk.umd.js +1 -1
- package/package.json +3 -2
- package/src/assets/icons/tool_color.png +0 -0
- package/src/assets/icons/tool_reset.png +0 -0
- package/src/core/ColorAdjustPlugin.ts +158 -228
- package/src/core/Engine.ts +19 -7
- package/src/core/Magnification.ts +261 -0
- package/src/core/Toolbar.ts +497 -36
- package/src/index.ts +5 -3
- package/src/plugins/openseadragon-filtering.js +211 -0
- package/src/types/type.d.ts +1 -0
|
@@ -1,29 +1,36 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "openseadragon-filtering";
|
|
2
2
|
export interface ColorAdjustments {
|
|
3
3
|
brightness?: number;
|
|
4
4
|
contrast?: number;
|
|
5
5
|
saturation?: number;
|
|
6
6
|
gamma?: number;
|
|
7
|
-
sharpen?: number;
|
|
8
|
-
edgeEnhance?: number;
|
|
9
|
-
pseudoColor?: boolean;
|
|
10
7
|
invert?: boolean;
|
|
8
|
+
hue?: number;
|
|
9
|
+
sepia?: boolean;
|
|
10
|
+
greyscale?: boolean;
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* 2. 插件初始化选项接口
|
|
14
|
+
*/
|
|
12
15
|
export interface ColorAdjustOptions {
|
|
13
|
-
|
|
16
|
+
adjustments?: ColorAdjustments;
|
|
17
|
+
debounceMs?: number;
|
|
18
|
+
loadMode?: 'async' | 'sync';
|
|
14
19
|
}
|
|
15
20
|
export declare class ColorAdjustPlugin {
|
|
16
|
-
private
|
|
17
|
-
private
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
private viewer;
|
|
22
|
+
private _adjustments;
|
|
23
|
+
get adjustments(): ColorAdjustments;
|
|
24
|
+
private debounceTimer;
|
|
25
|
+
private debounceMs;
|
|
26
|
+
private loadMode;
|
|
27
|
+
constructor(engine: any, options?: ColorAdjustOptions);
|
|
22
28
|
destroy(): void;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
private
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
/**
|
|
30
|
+
* 核心算法:单次循环处理所有滤镜 (高性能模式)
|
|
31
|
+
*/
|
|
32
|
+
private combinedProcessor;
|
|
33
|
+
apply(): void;
|
|
34
|
+
setAdjustments(adj: ColorAdjustments): void;
|
|
35
|
+
reset(): void;
|
|
29
36
|
}
|
package/dist/core/Engine.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { MedToolbar, type ToolbarOptions } from "./Toolbar";
|
|
|
4
4
|
import { ColorAdjustPlugin, type ColorAdjustOptions } from "./ColorAdjustPlugin";
|
|
5
5
|
import { SelectionPlugin, type SelectionOptions } from './SelectionPlugin';
|
|
6
6
|
import { ScalebarPlugin, type ScalebarOptions } from './Scalebar';
|
|
7
|
+
import { MagnificationPlugin, type MagnificationOptions } from './Magnification';
|
|
7
8
|
/**
|
|
8
9
|
* 引擎配置接口
|
|
9
10
|
*/
|
|
@@ -18,6 +19,7 @@ export interface MedEngineOptions {
|
|
|
18
19
|
colorAdjust?: boolean | ColorAdjustOptions;
|
|
19
20
|
selection?: boolean | SelectionOptions;
|
|
20
21
|
scalebar?: boolean | ScalebarOptions;
|
|
22
|
+
magnification?: boolean | MagnificationOptions;
|
|
21
23
|
};
|
|
22
24
|
}
|
|
23
25
|
/**
|
|
@@ -31,6 +33,7 @@ export declare class MedViewerEngine {
|
|
|
31
33
|
colorAdjust: ColorAdjustPlugin | null;
|
|
32
34
|
selection: SelectionPlugin | null;
|
|
33
35
|
scalebar: ScalebarPlugin | null;
|
|
36
|
+
magnification: MagnificationPlugin | null;
|
|
34
37
|
private options;
|
|
35
38
|
constructor(options: MedEngineOptions);
|
|
36
39
|
/**
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import OpenSeadragon from "openseadragon";
|
|
2
|
+
export type MagnificationType = "LD" | "OSD";
|
|
3
|
+
export type MagnificationPosition = "TOP_LEFT" | "TOP_CENTER" | "TOP_RIGHT" | "BOTTOM_LEFT" | "BOTTOM_CENTER" | "BOTTOM_RIGHT" | "MIDDLE_LEFT" | "MIDDLE_RIGHT";
|
|
4
|
+
export interface MagnificationOptions {
|
|
5
|
+
type?: MagnificationType;
|
|
6
|
+
position?: MagnificationPosition;
|
|
7
|
+
offsetX?: number;
|
|
8
|
+
offsetY?: number;
|
|
9
|
+
pixelsPerMeter?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare class MagnificationPlugin {
|
|
12
|
+
private viewer;
|
|
13
|
+
private options;
|
|
14
|
+
private magnificationElement;
|
|
15
|
+
private magnificationDisplay;
|
|
16
|
+
constructor(viewer: OpenSeadragon.Viewer, options?: MagnificationOptions);
|
|
17
|
+
private init;
|
|
18
|
+
private createButton;
|
|
19
|
+
private updateMagnificationDisplay;
|
|
20
|
+
private setMagnification;
|
|
21
|
+
private fitToScreen;
|
|
22
|
+
refresh(): void;
|
|
23
|
+
destroy(): void;
|
|
24
|
+
private injectStyles;
|
|
25
|
+
}
|
package/dist/med-viewer-sdk.d.ts
CHANGED
|
@@ -2,4 +2,6 @@ import { MedViewerEngine } from './core/Engine';
|
|
|
2
2
|
import { AnnoAnnotator } from './core/AnnoAnnotator';
|
|
3
3
|
import { MedToolbar } from './core/Toolbar';
|
|
4
4
|
import { SelectionPlugin } from './core/SelectionPlugin';
|
|
5
|
-
|
|
5
|
+
import { ColorAdjustPlugin } from './core/ColorAdjustPlugin';
|
|
6
|
+
import { MagnificationPlugin } from './core/Magnification';
|
|
7
|
+
export { MedViewerEngine, AnnoAnnotator, MedToolbar, SelectionPlugin, ColorAdjustPlugin, MagnificationPlugin };
|