|
| 1 | +import { vtkObject } from '../../../interfaces'; |
| 2 | +import { Size } from '../../../types'; |
| 3 | +import vtkCamera from '../../../Rendering/Core/Camera'; |
| 4 | +import DefaultProtocol from './DefaultProtocol'; |
| 5 | +/** |
| 6 | + * |
| 7 | + */ |
| 8 | +export interface IViewStreamInitialValues { |
| 9 | + protocol?: typeof DefaultProtocol; |
| 10 | + api?: any; |
| 11 | + cameraUpdateRate?: number; |
| 12 | + decodeImage?: boolean; |
| 13 | + fpsWindowSize?: number; |
| 14 | + interactiveQuality?: number; |
| 15 | + interactiveRatio?: number; |
| 16 | + isAnimating?: boolean; |
| 17 | + mimeType?: string; |
| 18 | + size?: Size; |
| 19 | + stillQuality?: number; |
| 20 | + stillRatio?: number; |
| 21 | + useCameraParameters?: boolean; |
| 22 | + viewId?: string; |
| 23 | +} |
| 24 | + |
| 25 | +interface IMetaData { |
| 26 | + size: Size, |
| 27 | + id: string, |
| 28 | + memory: number, |
| 29 | + workTime: number, |
| 30 | +} |
| 31 | + |
| 32 | +interface IEvent { |
| 33 | + url: string, |
| 34 | + fps: number[], |
| 35 | + metadata: IMetaData, |
| 36 | +} |
| 37 | + |
| 38 | +export interface vtkViewStream extends vtkObject { |
| 39 | + /** |
| 40 | + * |
| 41 | + * @param callback |
| 42 | + */ |
| 43 | + onImageReady(callback: () => void): any; |
| 44 | + |
| 45 | + /** |
| 46 | + * |
| 47 | + */ |
| 48 | + getViewId(): string; |
| 49 | + |
| 50 | + /** |
| 51 | + * |
| 52 | + */ |
| 53 | + getSize(): Size; |
| 54 | + |
| 55 | + /** |
| 56 | + * |
| 57 | + */ |
| 58 | + getFps(): number[]; |
| 59 | + |
| 60 | + /** |
| 61 | + * |
| 62 | + */ |
| 63 | + getLastImageEvent(): IEvent; |
| 64 | + |
| 65 | + /** |
| 66 | + * |
| 67 | + */ |
| 68 | + getCamera(): vtkCamera; |
| 69 | + |
| 70 | + /** |
| 71 | + * |
| 72 | + * @param camera |
| 73 | + */ |
| 74 | + setCamera(camera: vtkCamera): boolean; |
| 75 | + |
| 76 | + /** |
| 77 | + * |
| 78 | + */ |
| 79 | + getCameraUpdateRate(): number; |
| 80 | + |
| 81 | + /** |
| 82 | + * |
| 83 | + * @param cameraUpdateRate |
| 84 | + */ |
| 85 | + setCameraUpdateRate(cameraUpdateRate: number): boolean; |
| 86 | + |
| 87 | + /** |
| 88 | + * |
| 89 | + */ |
| 90 | + getDecodeImage(): boolean; |
| 91 | + |
| 92 | + /** |
| 93 | + * |
| 94 | + * @param decodeImage |
| 95 | + */ |
| 96 | + setDecodeImage(decodeImage: boolean): boolean; |
| 97 | + |
| 98 | + /** |
| 99 | + * |
| 100 | + */ |
| 101 | + getFpsWindowSize(): number; |
| 102 | + |
| 103 | + /** |
| 104 | + * |
| 105 | + * @param fpsWindowSize |
| 106 | + */ |
| 107 | + setFpsWindowSize(fpsWindowSize: number): boolean; |
| 108 | + |
| 109 | + /** |
| 110 | + * |
| 111 | + */ |
| 112 | + getInteractiveQuality(): number; |
| 113 | + |
| 114 | + /** |
| 115 | + * |
| 116 | + * @param interactiveQuality |
| 117 | + */ |
| 118 | + setInteractiveQuality(interactiveQuality: number): boolean; |
| 119 | + |
| 120 | + /** |
| 121 | + * |
| 122 | + */ |
| 123 | + getInteractiveRatio(): number; |
| 124 | + |
| 125 | + /** |
| 126 | + * |
| 127 | + * @param interactiveRatio |
| 128 | + */ |
| 129 | + setInteractiveRatio(interactiveRatio: number): boolean; |
| 130 | + |
| 131 | + /** |
| 132 | + * |
| 133 | + */ |
| 134 | + getStillQuality(): number; |
| 135 | + |
| 136 | + /** |
| 137 | + * |
| 138 | + * @param stillQuality |
| 139 | + */ |
| 140 | + setStillQuality(stillQuality: number): boolean; |
| 141 | + |
| 142 | + /** |
| 143 | + * |
| 144 | + */ |
| 145 | + getStillRatio(): number; |
| 146 | + |
| 147 | + /** |
| 148 | + * |
| 149 | + * @param stillRatio |
| 150 | + */ |
| 151 | + setStillRatio(stillRatio: number): boolean; |
| 152 | + |
| 153 | + /** |
| 154 | + * |
| 155 | + */ |
| 156 | + getUseCameraParameters(): boolean; |
| 157 | + |
| 158 | + /** |
| 159 | + * |
| 160 | + * @param useCameraParameters |
| 161 | + */ |
| 162 | + setUseCameraParameters(useCameraParameters: boolean): boolean; |
| 163 | + |
| 164 | + /** |
| 165 | + * |
| 166 | + */ |
| 167 | + pushCamera(): any; |
| 168 | + |
| 169 | + /** |
| 170 | + * |
| 171 | + */ |
| 172 | + invalidateCache(): any; |
| 173 | + |
| 174 | + /** |
| 175 | + * |
| 176 | + */ |
| 177 | + render(): any; |
| 178 | + |
| 179 | + /** |
| 180 | + * |
| 181 | + */ |
| 182 | + resetCamera(): any; |
| 183 | + |
| 184 | + /** |
| 185 | + * |
| 186 | + */ |
| 187 | + startAnimation(): any; |
| 188 | + |
| 189 | + /** |
| 190 | + * |
| 191 | + */ |
| 192 | + stopAnimation(): any; |
| 193 | + |
| 194 | + /** |
| 195 | + * |
| 196 | + * @param width |
| 197 | + * @param height |
| 198 | + */ |
| 199 | + setSize(width: number, height: number): any; |
| 200 | + |
| 201 | + /** |
| 202 | + * |
| 203 | + */ |
| 204 | + startInteraction(): any; |
| 205 | + |
| 206 | + /** |
| 207 | + * |
| 208 | + */ |
| 209 | + endInteraction(): any; |
| 210 | + |
| 211 | + /** |
| 212 | + * |
| 213 | + * @param viewId |
| 214 | + */ |
| 215 | + setViewId(viewId: string): boolean; |
| 216 | + |
| 217 | + /** |
| 218 | + * |
| 219 | + * @param msg |
| 220 | + */ |
| 221 | + processMessage(msg: any): void; |
| 222 | + |
| 223 | + /** |
| 224 | + * |
| 225 | + */ |
| 226 | + delete(): void; |
| 227 | +} |
| 228 | + |
| 229 | +/** |
| 230 | + * Method used to decorate a given object (publicAPI+model) with vtkViewStream characteristics. |
| 231 | + * @param publicAPI |
| 232 | + * @param model |
| 233 | + * @param initialValues |
| 234 | + */ |
| 235 | +export function extend( |
| 236 | + publicAPI: object, |
| 237 | + model: object, |
| 238 | + initialValues?: IViewStreamInitialValues |
| 239 | +): void; |
| 240 | + |
| 241 | +/** |
| 242 | + * Method used to create a new instance of vtkViewStream |
| 243 | + * @param {IViewStreamInitialValues} [initialValues] for pre-setting some of its content |
| 244 | + */ |
| 245 | +export function newInstance( |
| 246 | + initialValues?: IViewStreamInitialValues |
| 247 | +): vtkViewStream; |
| 248 | + |
| 249 | +/** |
| 250 | + * IViewStreamInitialValues provides a way to create a remote view. |
| 251 | + */ |
| 252 | +export declare const vtkViewStream: { |
| 253 | + newInstance: typeof newInstance; |
| 254 | + extend: typeof extend; |
| 255 | +}; |
| 256 | +export default vtkViewStream; |
0 commit comments