@illgrenoble/webx-client 1.9.2 → 1.9.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.
Files changed (286) hide show
  1. package/dist/input/GuacamoleKeyboard.js +118 -99
  2. package/dist/input/WebXKeyboard.d.ts +0 -16
  3. package/dist/input/WebXKeyboard.js +3 -27
  4. package/dist/input/WebXKeyboard.js.map +1 -1
  5. package/package.json +1 -1
  6. package/dist/display/WebXMaterialProvider.d.ts +0 -8
  7. package/dist/display/WebXMaterialProvider.js +0 -71
  8. package/dist/display/WebXMaterialProvider.js.map +0 -1
  9. package/dist/input/WebXNewKeyboard.d.ts +0 -62
  10. package/dist/input/WebXNewKeyboard.js +0 -94
  11. package/dist/input/WebXNewKeyboard.js.map +0 -1
  12. package/dist/input/keyboard/WebXKeyEvent.d.ts +0 -79
  13. package/dist/input/keyboard/WebXKeyEvent.js +0 -324
  14. package/dist/input/keyboard/WebXKeyEvent.js.map +0 -1
  15. package/dist/input/keyboard/WebXKeyPressEvent.d.ts +0 -30
  16. package/dist/input/keyboard/WebXKeyPressEvent.js +0 -44
  17. package/dist/input/keyboard/WebXKeyPressEvent.js.map +0 -1
  18. package/dist/input/keyboard/WebXKeyUpEvent.d.ts +0 -33
  19. package/dist/input/keyboard/WebXKeyUpEvent.js +0 -31
  20. package/dist/input/keyboard/WebXKeyUpEvent.js.map +0 -1
  21. package/dist/input/keyboard/WebXKeyboardModifierState.d.ts +0 -108
  22. package/dist/input/keyboard/WebXKeyboardModifierState.js +0 -148
  23. package/dist/input/keyboard/WebXKeyboardModifierState.js.map +0 -1
  24. package/dist/input/keyboard/WebXKeyboardUtils.d.ts +0 -25
  25. package/dist/input/keyboard/WebXKeyboardUtils.js +0 -63
  26. package/dist/input/keyboard/WebXKeyboardUtils.js.map +0 -1
  27. package/dist/input/keyboard/WebXKeydownEvent.d.ts +0 -46
  28. package/dist/input/keyboard/WebXKeydownEvent.js +0 -66
  29. package/dist/input/keyboard/WebXKeydownEvent.js.map +0 -1
  30. package/dist/input/keyboard/index.d.ts +0 -6
  31. package/dist/input/keyboard/index.js +0 -23
  32. package/dist/input/keyboard/index.js.map +0 -1
  33. package/dist/lib/GuacamoleKeyboard.js +0 -1290
  34. package/dist/lib/GuacamoleKeyboard.js.map +0 -1
  35. package/dist/message/WebXPollMessage.d.ts +0 -4
  36. package/dist/message/WebXPollMessage.js +0 -12
  37. package/dist/message/WebXPollMessage.js.map +0 -1
  38. package/dist/src/WebXClient.d.ts +0 -261
  39. package/dist/src/WebXClient.js +0 -571
  40. package/dist/src/WebXClient.js.map +0 -1
  41. package/dist/src/WebXEngine.d.ts +0 -4
  42. package/dist/src/WebXEngine.js +0 -7
  43. package/dist/src/WebXEngine.js.map +0 -1
  44. package/dist/src/display/WebXCursor.d.ts +0 -88
  45. package/dist/src/display/WebXCursor.js +0 -150
  46. package/dist/src/display/WebXCursor.js.map +0 -1
  47. package/dist/src/display/WebXCursorFactory.d.ts +0 -36
  48. package/dist/src/display/WebXCursorFactory.js +0 -59
  49. package/dist/src/display/WebXCursorFactory.js.map +0 -1
  50. package/dist/src/display/WebXDisplay.d.ts +0 -226
  51. package/dist/src/display/WebXDisplay.js +0 -424
  52. package/dist/src/display/WebXDisplay.js.map +0 -1
  53. package/dist/src/display/WebXMaterial.d.ts +0 -14
  54. package/dist/src/display/WebXMaterial.js +0 -140
  55. package/dist/src/display/WebXMaterial.js.map +0 -1
  56. package/dist/src/display/WebXSubImage.d.ts +0 -50
  57. package/dist/src/display/WebXSubImage.js +0 -26
  58. package/dist/src/display/WebXSubImage.js.map +0 -1
  59. package/dist/src/display/WebXTextureFactory.d.ts +0 -54
  60. package/dist/src/display/WebXTextureFactory.js +0 -160
  61. package/dist/src/display/WebXTextureFactory.js.map +0 -1
  62. package/dist/src/display/WebXWindow.d.ts +0 -241
  63. package/dist/src/display/WebXWindow.js +0 -438
  64. package/dist/src/display/WebXWindow.js.map +0 -1
  65. package/dist/src/display/WebXWindowProperties.d.ts +0 -44
  66. package/dist/src/display/WebXWindowProperties.js +0 -25
  67. package/dist/src/display/WebXWindowProperties.js.map +0 -1
  68. package/dist/src/display/index.d.ts +0 -7
  69. package/dist/src/display/index.js +0 -24
  70. package/dist/src/display/index.js.map +0 -1
  71. package/dist/src/index.d.ts +0 -7
  72. package/dist/src/index.js +0 -24
  73. package/dist/src/index.js.map +0 -1
  74. package/dist/src/input/WebXKeyboard.d.ts +0 -265
  75. package/dist/src/input/WebXKeyboard.js +0 -632
  76. package/dist/src/input/WebXKeyboard.js.map +0 -1
  77. package/dist/src/input/WebXMouse.d.ts +0 -125
  78. package/dist/src/input/WebXMouse.js +0 -231
  79. package/dist/src/input/WebXMouse.js.map +0 -1
  80. package/dist/src/input/index.d.ts +0 -4
  81. package/dist/src/input/index.js +0 -21
  82. package/dist/src/input/index.js.map +0 -1
  83. package/dist/src/input/keyboard/WebXKeyEvent.d.ts +0 -79
  84. package/dist/src/input/keyboard/WebXKeyEvent.js +0 -324
  85. package/dist/src/input/keyboard/WebXKeyEvent.js.map +0 -1
  86. package/dist/src/input/keyboard/WebXKeyPressEvent.d.ts +0 -30
  87. package/dist/src/input/keyboard/WebXKeyPressEvent.js +0 -44
  88. package/dist/src/input/keyboard/WebXKeyPressEvent.js.map +0 -1
  89. package/dist/src/input/keyboard/WebXKeyUpEvent.d.ts +0 -33
  90. package/dist/src/input/keyboard/WebXKeyUpEvent.js +0 -31
  91. package/dist/src/input/keyboard/WebXKeyUpEvent.js.map +0 -1
  92. package/dist/src/input/keyboard/WebXKeyboardModifierState.d.ts +0 -108
  93. package/dist/src/input/keyboard/WebXKeyboardModifierState.js +0 -148
  94. package/dist/src/input/keyboard/WebXKeyboardModifierState.js.map +0 -1
  95. package/dist/src/input/keyboard/WebXKeyboardUtils.d.ts +0 -25
  96. package/dist/src/input/keyboard/WebXKeyboardUtils.js +0 -63
  97. package/dist/src/input/keyboard/WebXKeyboardUtils.js.map +0 -1
  98. package/dist/src/input/keyboard/WebXKeydownEvent.d.ts +0 -46
  99. package/dist/src/input/keyboard/WebXKeydownEvent.js +0 -66
  100. package/dist/src/input/keyboard/WebXKeydownEvent.js.map +0 -1
  101. package/dist/src/input/keyboard/index.d.ts +0 -6
  102. package/dist/src/input/keyboard/index.js +0 -23
  103. package/dist/src/input/keyboard/index.js.map +0 -1
  104. package/dist/src/input/mouse/WebXMouseState.d.ts +0 -190
  105. package/dist/src/input/mouse/WebXMouseState.js +0 -217
  106. package/dist/src/input/mouse/WebXMouseState.js.map +0 -1
  107. package/dist/src/input/mouse/index.d.ts +0 -1
  108. package/dist/src/input/mouse/index.js +0 -18
  109. package/dist/src/input/mouse/index.js.map +0 -1
  110. package/dist/src/instruction/WebXClipboardInstruction.d.ts +0 -18
  111. package/dist/src/instruction/WebXClipboardInstruction.js +0 -23
  112. package/dist/src/instruction/WebXClipboardInstruction.js.map +0 -1
  113. package/dist/src/instruction/WebXConnectInstruction.d.ts +0 -19
  114. package/dist/src/instruction/WebXConnectInstruction.js +0 -24
  115. package/dist/src/instruction/WebXConnectInstruction.js.map +0 -1
  116. package/dist/src/instruction/WebXCursorImageInstruction.d.ts +0 -18
  117. package/dist/src/instruction/WebXCursorImageInstruction.js +0 -23
  118. package/dist/src/instruction/WebXCursorImageInstruction.js.map +0 -1
  119. package/dist/src/instruction/WebXDataAckInstruction.d.ts +0 -25
  120. package/dist/src/instruction/WebXDataAckInstruction.js +0 -26
  121. package/dist/src/instruction/WebXDataAckInstruction.js.map +0 -1
  122. package/dist/src/instruction/WebXImageInstruction.d.ts +0 -18
  123. package/dist/src/instruction/WebXImageInstruction.js +0 -23
  124. package/dist/src/instruction/WebXImageInstruction.js.map +0 -1
  125. package/dist/src/instruction/WebXInstruction.d.ts +0 -29
  126. package/dist/src/instruction/WebXInstruction.js +0 -28
  127. package/dist/src/instruction/WebXInstruction.js.map +0 -1
  128. package/dist/src/instruction/WebXInstructionResponse.d.ts +0 -66
  129. package/dist/src/instruction/WebXInstructionResponse.js +0 -78
  130. package/dist/src/instruction/WebXInstructionResponse.js.map +0 -1
  131. package/dist/src/instruction/WebXInstructionType.d.ts +0 -63
  132. package/dist/src/instruction/WebXInstructionType.js +0 -96
  133. package/dist/src/instruction/WebXInstructionType.js.map +0 -1
  134. package/dist/src/instruction/WebXKeyboardInstruction.d.ts +0 -23
  135. package/dist/src/instruction/WebXKeyboardInstruction.js +0 -25
  136. package/dist/src/instruction/WebXKeyboardInstruction.js.map +0 -1
  137. package/dist/src/instruction/WebXMouseInstruction.d.ts +0 -28
  138. package/dist/src/instruction/WebXMouseInstruction.js +0 -27
  139. package/dist/src/instruction/WebXMouseInstruction.js.map +0 -1
  140. package/dist/src/instruction/WebXPongInstruction.d.ts +0 -18
  141. package/dist/src/instruction/WebXPongInstruction.js +0 -23
  142. package/dist/src/instruction/WebXPongInstruction.js.map +0 -1
  143. package/dist/src/instruction/WebXQualityInstruction.d.ts +0 -19
  144. package/dist/src/instruction/WebXQualityInstruction.js +0 -24
  145. package/dist/src/instruction/WebXQualityInstruction.js.map +0 -1
  146. package/dist/src/instruction/WebXScreenInstruction.d.ts +0 -12
  147. package/dist/src/instruction/WebXScreenInstruction.js +0 -20
  148. package/dist/src/instruction/WebXScreenInstruction.js.map +0 -1
  149. package/dist/src/instruction/WebXShapeInstruction.d.ts +0 -18
  150. package/dist/src/instruction/WebXShapeInstruction.js +0 -23
  151. package/dist/src/instruction/WebXShapeInstruction.js.map +0 -1
  152. package/dist/src/instruction/WebXWindowsInstruction.d.ts +0 -13
  153. package/dist/src/instruction/WebXWindowsInstruction.js +0 -21
  154. package/dist/src/instruction/WebXWindowsInstruction.js.map +0 -1
  155. package/dist/src/instruction/index.d.ts +0 -15
  156. package/dist/src/instruction/index.js +0 -32
  157. package/dist/src/instruction/index.js.map +0 -1
  158. package/dist/src/message/WebXClipboardMessage.d.ts +0 -19
  159. package/dist/src/message/WebXClipboardMessage.js +0 -23
  160. package/dist/src/message/WebXClipboardMessage.js.map +0 -1
  161. package/dist/src/message/WebXConnectionMessage.d.ts +0 -12
  162. package/dist/src/message/WebXConnectionMessage.js +0 -20
  163. package/dist/src/message/WebXConnectionMessage.js.map +0 -1
  164. package/dist/src/message/WebXCursorImageMessage.d.ts +0 -46
  165. package/dist/src/message/WebXCursorImageMessage.js +0 -35
  166. package/dist/src/message/WebXCursorImageMessage.js.map +0 -1
  167. package/dist/src/message/WebXImageMessage.d.ts +0 -41
  168. package/dist/src/message/WebXImageMessage.js +0 -33
  169. package/dist/src/message/WebXImageMessage.js.map +0 -1
  170. package/dist/src/message/WebXMessage.d.ts +0 -24
  171. package/dist/src/message/WebXMessage.js +0 -23
  172. package/dist/src/message/WebXMessage.js.map +0 -1
  173. package/dist/src/message/WebXMessageType.d.ts +0 -59
  174. package/dist/src/message/WebXMessageType.js +0 -64
  175. package/dist/src/message/WebXMessageType.js.map +0 -1
  176. package/dist/src/message/WebXMouseMessage.d.ts +0 -30
  177. package/dist/src/message/WebXMouseMessage.js +0 -29
  178. package/dist/src/message/WebXMouseMessage.js.map +0 -1
  179. package/dist/src/message/WebXNopMessage.d.ts +0 -10
  180. package/dist/src/message/WebXNopMessage.js +0 -18
  181. package/dist/src/message/WebXNopMessage.js.map +0 -1
  182. package/dist/src/message/WebXPingMessage.d.ts +0 -13
  183. package/dist/src/message/WebXPingMessage.js +0 -21
  184. package/dist/src/message/WebXPingMessage.js.map +0 -1
  185. package/dist/src/message/WebXQualityMessage.d.ts +0 -39
  186. package/dist/src/message/WebXQualityMessage.js +0 -32
  187. package/dist/src/message/WebXQualityMessage.js.map +0 -1
  188. package/dist/src/message/WebXScreenMessage.d.ts +0 -37
  189. package/dist/src/message/WebXScreenMessage.js +0 -29
  190. package/dist/src/message/WebXScreenMessage.js.map +0 -1
  191. package/dist/src/message/WebXShapeMessage.d.ts +0 -31
  192. package/dist/src/message/WebXShapeMessage.js +0 -29
  193. package/dist/src/message/WebXShapeMessage.js.map +0 -1
  194. package/dist/src/message/WebXSubImagesMessage.d.ts +0 -31
  195. package/dist/src/message/WebXSubImagesMessage.js +0 -29
  196. package/dist/src/message/WebXSubImagesMessage.js.map +0 -1
  197. package/dist/src/message/WebXWindowsMessage.d.ts +0 -21
  198. package/dist/src/message/WebXWindowsMessage.js +0 -25
  199. package/dist/src/message/WebXWindowsMessage.js.map +0 -1
  200. package/dist/src/message/index.d.ts +0 -14
  201. package/dist/src/message/index.js +0 -31
  202. package/dist/src/message/index.js.map +0 -1
  203. package/dist/src/tracer/WebXDebugImageMessageHandler.d.ts +0 -48
  204. package/dist/src/tracer/WebXDebugImageMessageHandler.js +0 -102
  205. package/dist/src/tracer/WebXDebugImageMessageHandler.js.map +0 -1
  206. package/dist/src/tracer/WebXHandler.d.ts +0 -14
  207. package/dist/src/tracer/WebXHandler.js +0 -3
  208. package/dist/src/tracer/WebXHandler.js.map +0 -1
  209. package/dist/src/tracer/WebXInstructionHandler.d.ts +0 -21
  210. package/dist/src/tracer/WebXInstructionHandler.js +0 -13
  211. package/dist/src/tracer/WebXInstructionHandler.js.map +0 -1
  212. package/dist/src/tracer/WebXMessageHandler.d.ts +0 -21
  213. package/dist/src/tracer/WebXMessageHandler.js +0 -13
  214. package/dist/src/tracer/WebXMessageHandler.js.map +0 -1
  215. package/dist/src/tracer/WebXStatsHandler.d.ts +0 -23
  216. package/dist/src/tracer/WebXStatsHandler.js +0 -13
  217. package/dist/src/tracer/WebXStatsHandler.js.map +0 -1
  218. package/dist/src/tracer/index.d.ts +0 -5
  219. package/dist/src/tracer/index.js +0 -22
  220. package/dist/src/tracer/index.js.map +0 -1
  221. package/dist/src/transport/WebXBinarySerializer.d.ts +0 -31
  222. package/dist/src/transport/WebXBinarySerializer.js +0 -63
  223. package/dist/src/transport/WebXBinarySerializer.js.map +0 -1
  224. package/dist/src/transport/WebXInstructionBuffer.d.ts +0 -55
  225. package/dist/src/transport/WebXInstructionBuffer.js +0 -109
  226. package/dist/src/transport/WebXInstructionBuffer.js.map +0 -1
  227. package/dist/src/transport/WebXInstructionEncoder.d.ts +0 -181
  228. package/dist/src/transport/WebXInstructionEncoder.js +0 -294
  229. package/dist/src/transport/WebXInstructionEncoder.js.map +0 -1
  230. package/dist/src/transport/WebXMessageBuffer.d.ts +0 -80
  231. package/dist/src/transport/WebXMessageBuffer.js +0 -104
  232. package/dist/src/transport/WebXMessageBuffer.js.map +0 -1
  233. package/dist/src/transport/WebXMessageDecoder.d.ts +0 -108
  234. package/dist/src/transport/WebXMessageDecoder.js +0 -332
  235. package/dist/src/transport/WebXMessageDecoder.js.map +0 -1
  236. package/dist/src/transport/index.d.ts +0 -5
  237. package/dist/src/transport/index.js +0 -22
  238. package/dist/src/transport/index.js.map +0 -1
  239. package/dist/src/tunnel/WebXTunnel.d.ts +0 -93
  240. package/dist/src/tunnel/WebXTunnel.js +0 -156
  241. package/dist/src/tunnel/WebXTunnel.js.map +0 -1
  242. package/dist/src/tunnel/WebXWebSocketTunnel.d.ts +0 -40
  243. package/dist/src/tunnel/WebXWebSocketTunnel.js +0 -88
  244. package/dist/src/tunnel/WebXWebSocketTunnel.js.map +0 -1
  245. package/dist/src/tunnel/index.d.ts +0 -2
  246. package/dist/src/tunnel/index.js +0 -19
  247. package/dist/src/tunnel/index.js.map +0 -1
  248. package/dist/src/utils/WebXColorGenerator.d.ts +0 -24
  249. package/dist/src/utils/WebXColorGenerator.js +0 -46
  250. package/dist/src/utils/WebXColorGenerator.js.map +0 -1
  251. package/dist/src/utils/WebXVersion.d.ts +0 -34
  252. package/dist/src/utils/WebXVersion.js +0 -25
  253. package/dist/src/utils/WebXVersion.js.map +0 -1
  254. package/dist/src/utils/index.d.ts +0 -2
  255. package/dist/src/utils/index.js +0 -19
  256. package/dist/src/utils/index.js.map +0 -1
  257. package/dist/tracer/DemoVisualMessageHandler.d.ts +0 -15
  258. package/dist/tracer/DemoVisualMessageHandler.js +0 -55
  259. package/dist/tracer/DemoVisualMessageHandler.js.map +0 -1
  260. package/dist/tracer/WebXVisualMessageHandler.d.ts +0 -15
  261. package/dist/tracer/WebXVisualMessageHandler.js +0 -55
  262. package/dist/tracer/WebXVisualMessageHandler.js.map +0 -1
  263. package/dist/tunnel/WebXDefaultQoSHandler.d.ts +0 -16
  264. package/dist/tunnel/WebXDefaultQoSHandler.js +0 -57
  265. package/dist/tunnel/WebXDefaultQoSHandler.js.map +0 -1
  266. package/dist/tunnel/WebXQoSHandler.d.ts +0 -6
  267. package/dist/tunnel/WebXQoSHandler.js +0 -7
  268. package/dist/tunnel/WebXQoSHandler.js.map +0 -1
  269. package/dist/tunnel/WebXSocketIOTunnel.d.ts +0 -15
  270. package/dist/tunnel/WebXSocketIOTunnel.js +0 -41
  271. package/dist/tunnel/WebXSocketIOTunnel.js.map +0 -1
  272. package/dist/utils/ColorGenerator.d.ts +0 -24
  273. package/dist/utils/ColorGenerator.js +0 -46
  274. package/dist/utils/ColorGenerator.js.map +0 -1
  275. package/dist/utils/Config.d.ts +0 -4
  276. package/dist/utils/Config.js +0 -10
  277. package/dist/utils/Config.js.map +0 -1
  278. package/dist/utils/WebXAsyncExec.d.ts +0 -5
  279. package/dist/utils/WebXAsyncExec.js +0 -18
  280. package/dist/utils/WebXAsyncExec.js.map +0 -1
  281. package/dist/utils/WebXColourGenerator.d.ts +0 -5
  282. package/dist/utils/WebXColourGenerator.js +0 -27
  283. package/dist/utils/WebXColourGenerator.js.map +0 -1
  284. package/dist/utils/WebXFileSize.d.ts +0 -3
  285. package/dist/utils/WebXFileSize.js +0 -14
  286. package/dist/utils/WebXFileSize.js.map +0 -1
@@ -1,54 +0,0 @@
1
- import { WebXTunnel } from '../tunnel';
2
- import { Texture } from 'three';
3
- /**
4
- * Factory class for creating and managing textures for WebX windows.
5
- *
6
- * This class retrieves textures from the WebX Engine and caches them for reuse.
7
- */
8
- export declare class WebXTextureFactory {
9
- private _tunnel;
10
- constructor(_tunnel: WebXTunnel);
11
- /**
12
- * Retrieves the textures (colorMap and alphaMap) for a specific window ID from the WebX Engine.
13
- *
14
- * @param windowId The ID of the window to retrieve the texture for.
15
- * @returns A promise that resolves to the textures and associated data.
16
- */
17
- getWindowTexture(windowId: number): Promise<{
18
- depth: number;
19
- colorMap: Texture;
20
- alphaMap: Texture;
21
- }>;
22
- /**
23
- * Retrieves the stencil textures for a specific window ID from the WebX Engine.
24
- *
25
- * @param windowId The ID of the window to retrieve the texture for.
26
- * @returns A promise that resolves to the stencil texture
27
- */
28
- getWindowStencilTexture(windowId: number): Promise<{
29
- stencilMap: Texture;
30
- }>;
31
- /**
32
- * Creates a texture from a base64-encoded image data.
33
- *
34
- * @param imageData The base64-encoded image data.
35
- * @returns A promise that resolves to the created texture.
36
- */
37
- createTextureFromBase64Array(imageData: string): Promise<Texture>;
38
- /**
39
- * Creates a texture from raw image data.
40
- *
41
- * @param imageData The raw image data as a Uint8Array.
42
- * @param mimetype The MIME type of the image data (e.g., "image/png").
43
- * @param colorSpace The color space of the image data (e.g., "srgb").
44
- * @returns A promise that resolves to the created texture.
45
- */
46
- createTextureFromArray(imageData: Uint8Array, mimetype: string, colorSpace: string): Promise<Texture>;
47
- /**
48
- * Creates a texture from a Blob object.
49
- *
50
- * @param blob The Blob object containing the image data.
51
- * @returns A promise that resolves to the created texture.
52
- */
53
- createTextureFromBlob(blob: Blob): Promise<Texture>;
54
- }
@@ -1,160 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.WebXTextureFactory = void 0;
13
- const instruction_1 = require("../instruction");
14
- const three_1 = require("three");
15
- /**
16
- * Factory class for creating and managing textures for WebX windows.
17
- *
18
- * This class retrieves textures from the WebX Engine and caches them for reuse.
19
- */
20
- class WebXTextureFactory {
21
- constructor(_tunnel) {
22
- this._tunnel = _tunnel;
23
- }
24
- /**
25
- * Retrieves the textures (colorMap and alphaMap) for a specific window ID from the WebX Engine.
26
- *
27
- * @param windowId The ID of the window to retrieve the texture for.
28
- * @returns A promise that resolves to the textures and associated data.
29
- */
30
- getWindowTexture(windowId) {
31
- return __awaiter(this, void 0, void 0, function* () {
32
- try {
33
- const response = yield this._tunnel.sendRequest(new instruction_1.WebXImageInstruction(windowId));
34
- return {
35
- depth: response.depth,
36
- colorMap: response.colorMap,
37
- alphaMap: response.alphaMap,
38
- };
39
- }
40
- catch (err) {
41
- console.warn('Failed to get texture: ' + err);
42
- }
43
- });
44
- }
45
- /**
46
- * Retrieves the stencil textures for a specific window ID from the WebX Engine.
47
- *
48
- * @param windowId The ID of the window to retrieve the texture for.
49
- * @returns A promise that resolves to the stencil texture
50
- */
51
- getWindowStencilTexture(windowId) {
52
- return __awaiter(this, void 0, void 0, function* () {
53
- try {
54
- const response = yield this._tunnel.sendRequest(new instruction_1.WebXShapeInstruction(windowId));
55
- return {
56
- stencilMap: response.stencilMap,
57
- };
58
- }
59
- catch (err) {
60
- console.warn('Failed to get stencil texture: ' + err);
61
- return null;
62
- }
63
- });
64
- }
65
- /**
66
- * Creates a texture from a base64-encoded image data.
67
- *
68
- * @param imageData The base64-encoded image data.
69
- * @returns A promise that resolves to the created texture.
70
- */
71
- createTextureFromBase64Array(imageData) {
72
- return new Promise((resolve, reject) => {
73
- if (imageData != null && imageData !== '') {
74
- const image = new Image();
75
- const texture = new three_1.Texture(image);
76
- image.onload = () => {
77
- texture.needsUpdate = true;
78
- texture.flipY = false;
79
- texture.minFilter = three_1.LinearFilter;
80
- resolve(texture);
81
- };
82
- image.onerror = (error) => {
83
- console.warn(`Failed to create texture from base64: ${error}`);
84
- reject(error);
85
- };
86
- image.src = imageData;
87
- }
88
- else {
89
- resolve(null);
90
- }
91
- });
92
- }
93
- /**
94
- * Creates a texture from raw image data.
95
- *
96
- * @param imageData The raw image data as a Uint8Array.
97
- * @param mimetype The MIME type of the image data (e.g., "image/png").
98
- * @param colorSpace The color space of the image data (e.g., "srgb").
99
- * @returns A promise that resolves to the created texture.
100
- */
101
- createTextureFromArray(imageData, mimetype, colorSpace) {
102
- return __awaiter(this, void 0, void 0, function* () {
103
- if (imageData != null && imageData.byteLength > 0) {
104
- const blob = new Blob([imageData], { type: mimetype });
105
- const texture = yield this.createTextureFromBlob(blob);
106
- texture.needsUpdate = true;
107
- texture.flipY = false;
108
- texture.minFilter = three_1.LinearFilter;
109
- texture.colorSpace = colorSpace;
110
- return texture;
111
- }
112
- else {
113
- return null;
114
- }
115
- });
116
- }
117
- /**
118
- * Creates a texture from a Blob object.
119
- *
120
- * @param blob The Blob object containing the image data.
121
- * @returns A promise that resolves to the created texture.
122
- */
123
- createTextureFromBlob(blob) {
124
- // not supported by all of the browsers at the moment
125
- // https://caniuse.com/createimagebitmap
126
- if (typeof createImageBitmap === 'function') {
127
- return new Promise((resolve, reject) => {
128
- createImageBitmap(blob)
129
- .then(bitmap => {
130
- const texture = new three_1.Texture();
131
- texture.image = bitmap;
132
- resolve(texture);
133
- })
134
- .catch(error => {
135
- console.warn(`Failed to create texture using createImageBitmap from binary data: ${error}`);
136
- reject(error);
137
- });
138
- });
139
- }
140
- else {
141
- return new Promise((resolve, reject) => {
142
- // fall back to the standard way of creating an image
143
- const url = URL.createObjectURL(blob);
144
- const image = new Image();
145
- image.onload = () => {
146
- URL.revokeObjectURL(url);
147
- const texture = new three_1.Texture(image);
148
- resolve(texture);
149
- };
150
- image.onerror = (error) => {
151
- console.warn(`Failed to create texture from binary data: ${error}`);
152
- reject(error);
153
- };
154
- image.src = url;
155
- });
156
- }
157
- }
158
- }
159
- exports.WebXTextureFactory = WebXTextureFactory;
160
- //# sourceMappingURL=WebXTextureFactory.js.map
@@ -1 +0,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EAAE,CAAC,CAAC;oBACpE,MAAM,CAAC,KAAK,CAAC,CAAC;gBAChB,CAAC,CAAA;gBAED,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC;YAClB,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF;AAlJD,gDAkJC"}
@@ -1,241 +0,0 @@
1
- import * as THREE from 'three';
2
- import { WebXTextureFactory } from './WebXTextureFactory';
3
- import { Texture } from 'three';
4
- /**
5
- * Represents a window in the WebX display.
6
- *
7
- * This class manages the rendering of a single window, including its position,
8
- * size, and texture updates.
9
- */
10
- export declare class WebXWindow {
11
- static WINDOW_REFRESH_TIME_MS: number;
12
- private static _PLANE_GEOMETRY;
13
- private static _COLOR_INDEX;
14
- private readonly _textureFactory;
15
- private readonly _colorIndex;
16
- private readonly _id;
17
- private readonly _material;
18
- private readonly _mesh;
19
- private _depth;
20
- private _x;
21
- private _y;
22
- private _z;
23
- private _width;
24
- private _height;
25
- private _shaped;
26
- private _windowRefreshTimeout;
27
- /**
28
- * Gets the THREE.js mesh representing the window.
29
- *
30
- * @returns The window mesh.
31
- */
32
- get mesh(): THREE.Mesh;
33
- /**
34
- * Gets the color index of the window.
35
- *
36
- * @returns The color index as a number.
37
- */
38
- get colorIndex(): number;
39
- /**
40
- * Gets the unique ID of the window.
41
- *
42
- * @returns The window ID as a number.
43
- */
44
- get id(): number;
45
- /**
46
- * Gets the visibility status of the window.
47
- *
48
- * @returns True if the window is visible, false otherwise.
49
- */
50
- get visible(): boolean;
51
- /**
52
- * Sets the visibility status of the window.
53
- *
54
- * @param visible True to make the window visible, false to hide it.
55
- */
56
- private set visible(value);
57
- /**
58
- * Gets the color map texture of the window.
59
- *
60
- * @returns The color map as a Texture.
61
- */
62
- get colorMap(): Texture;
63
- /**
64
- * Sets the color map texture of the window.
65
- *
66
- * @param colorMap The new color map as a Texture.
67
- */
68
- private set colorMap(value);
69
- /**
70
- * Gets the alpha map texture of the window.
71
- *
72
- * @returns The alpha map as a Texture.
73
- */
74
- get alphaMap(): Texture;
75
- /**
76
- * Sets the alpha map texture of the window.
77
- *
78
- * @param alphaMap The new alpha map as a Texture.
79
- */
80
- private set alphaMap(value);
81
- /**
82
- * Gets the stencil map texture of the window.
83
- *
84
- * @returns The stencil map as a Texture.
85
- */
86
- get stencilMap(): Texture;
87
- /**
88
- * Sets the stencil map texture of the window.
89
- *
90
- * @param stencilMap The new stencil map as a Texture.
91
- */
92
- private set stencilMap(value);
93
- /**
94
- * Checks if the color map is valid.
95
- *
96
- * @returns True if the color map is valid, false otherwise.
97
- */
98
- get colorMapValid(): boolean;
99
- /**
100
- * Gets the depth of the window.
101
- *
102
- * @returns The depth as a number.
103
- */
104
- get depth(): number;
105
- /**
106
- * Gets the x-coordinate of the window.
107
- *
108
- * @returns The x-coordinate as a number.
109
- */
110
- get x(): number;
111
- /**
112
- * Sets the x-coordinate of the window.
113
- *
114
- * @param value The new x-coordinate as a number.
115
- */
116
- set x(value: number);
117
- /**
118
- * Gets the y-coordinate of the window.
119
- *
120
- * @returns The y-coordinate as a number.
121
- */
122
- get y(): number;
123
- /**
124
- * Sets the y-coordinate of the window.
125
- *
126
- * @param value The new y-coordinate as a number.
127
- */
128
- set y(value: number);
129
- /**
130
- * Gets the z-index of the window.
131
- *
132
- * @returns The z-index as a number.
133
- */
134
- get z(): number;
135
- /**
136
- * Sets the z-index of the window.
137
- *
138
- * @param value The new z-index as a number.
139
- */
140
- set z(value: number);
141
- /**
142
- * Gets the width of the window.
143
- *
144
- * @returns The width as a number.
145
- */
146
- get width(): number;
147
- /**
148
- * Sets the width of the window.
149
- *
150
- * @param value The new width as a number.
151
- */
152
- set width(value: number);
153
- /**
154
- * Gets the height of the window.
155
- *
156
- * @returns The height as a number.
157
- */
158
- get height(): number;
159
- /**
160
- * Sets the height of the window.
161
- *
162
- * @param value The new height as a number.
163
- */
164
- set height(value: number);
165
- /**
166
- * Creates a new instance of WebXWindow.
167
- *
168
- * @param configuration The properties of the window, such as position and size.
169
- * @param textureFactory The factory used to create textures for the window.
170
- */
171
- constructor(configuration: {
172
- id: number;
173
- x: number;
174
- y: number;
175
- z: number;
176
- width: number;
177
- height: number;
178
- shaped: boolean;
179
- }, textureFactory: WebXTextureFactory);
180
- /**
181
- * Loads the window image from the texture factory.
182
- */
183
- loadWindowImage(): Promise<void>;
184
- /**
185
- * Loads the window shape (stencil map) from the texture factory.
186
- */
187
- loadWindowShape(): Promise<void>;
188
- /**
189
- * Loads the window image and shape (if needed) from the texture factory.
190
- */
191
- loadWindowImageAndShape(): Promise<void>;
192
- /**
193
- * Updates the position and size of the window.
194
- *
195
- * @param x The x-coordinate of the window.
196
- * @param y The y-coordinate of the window.
197
- * @param z The z-index of the window.
198
- * @param width The width of the window.
199
- * @param height The height of the window.
200
- */
201
- setRectangle(x: number, y: number, z: number, width: number, height: number): void;
202
- /**
203
- * Updates the textures of the window with new image data.
204
- *
205
- * @param depth The depth of the image.
206
- * @param colorMap The color texture.
207
- * @param alphaMap The alpha texture.
208
- * @param isFullWindow Whether to force an update of the textures.
209
- */
210
- updateTexture(depth: number, colorMap: Texture, alphaMap: Texture, isFullWindow: boolean): void;
211
- /**
212
- * Updates the stencil map texture of the window with new image data.
213
- *
214
- * @param stencilMap The stencil map texture.
215
- */
216
- updateStencilTexture(stencilMap: Texture): void;
217
- /**
218
- * Updates the scale of the window mesh based on its width and height.
219
- */
220
- private _updateScale;
221
- /**
222
- * Updates the position of the window mesh based on its x, y, and z coordinates.
223
- */
224
- private _updatePosition;
225
- /**
226
- * Disposes of the resources used by the window.
227
- */
228
- dispose(): void;
229
- /**
230
- * Disposes of the color map texture, releasing its resources.
231
- */
232
- private _disposeColorMap;
233
- /**
234
- * Disposes of the alpha map texture, releasing its resources.
235
- */
236
- private _disposeAlphaMap;
237
- /**
238
- * Disposes of the stencil map texture, releasing its resources.
239
- */
240
- private _disposeStencilMap;
241
- }