@illgrenoble/webx-client 1.12.0 → 1.13.0

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 (177) hide show
  1. package/README.md +0 -2
  2. package/dist/WebXClient.d.ts +4 -2
  3. package/dist/WebXEngine.d.ts +4 -0
  4. package/dist/WebXOptions.d.ts +7 -0
  5. package/dist/display/WebXDisplay.d.ts +6 -2
  6. package/dist/display/WebXDisplayOptions.d.ts +16 -0
  7. package/dist/display/WebXDisplayOverlay.d.ts +38 -0
  8. package/dist/display/WebXMaterial.d.ts +56 -0
  9. package/dist/display/filter/WebXCRTFilterMaterial.d.ts +36 -0
  10. package/dist/display/filter/WebXFilter.d.ts +55 -0
  11. package/dist/display/filter/WebXFilterFactory.d.ts +31 -0
  12. package/dist/display/filter/WebXFilterMaterial.d.ts +41 -0
  13. package/dist/display/filter/WebXTestFilterMaterial.d.ts +41 -0
  14. package/dist/display/filter/index.d.ts +5 -0
  15. package/dist/display/index.d.ts +1 -0
  16. package/dist/index.d.ts +1 -0
  17. package/dist/renderer/WebXCanvasRenderer.d.ts +0 -1
  18. package/dist/texture/WebXTexture.d.ts +53 -4
  19. package/dist/texture/WebXTextureFactory.d.ts +1 -2
  20. package/dist/webx-client.cjs +1 -5391
  21. package/dist/webx-client.esm.js +1 -5322
  22. package/package.json +4 -3
  23. package/dist/GuacamoleKeyboard.js +0 -1551
  24. package/dist/WebXClient.js +0 -513
  25. package/dist/WebXClient.js.map +0 -1
  26. package/dist/WebXConnectionHandler.js +0 -96
  27. package/dist/WebXConnectionHandler.js.map +0 -1
  28. package/dist/WebXEngine.js +0 -7
  29. package/dist/WebXEngine.js.map +0 -1
  30. package/dist/display/WebXCursor.js +0 -139
  31. package/dist/display/WebXCursor.js.map +0 -1
  32. package/dist/display/WebXCursorFactory.js +0 -59
  33. package/dist/display/WebXCursorFactory.js.map +0 -1
  34. package/dist/display/WebXDisplay.js +0 -507
  35. package/dist/display/WebXDisplay.js.map +0 -1
  36. package/dist/display/WebXDisplayOverlay.js +0 -31
  37. package/dist/display/WebXDisplayOverlay.js.map +0 -1
  38. package/dist/display/WebXMaterial.js +0 -142
  39. package/dist/display/WebXMaterial.js.map +0 -1
  40. package/dist/display/WebXSubImage.d.ts +0 -50
  41. package/dist/display/WebXSubImage.js +0 -26
  42. package/dist/display/WebXSubImage.js.map +0 -1
  43. package/dist/display/WebXTexture.d.ts +0 -6
  44. package/dist/display/WebXTextureFactory.d.ts +0 -54
  45. package/dist/display/WebXTextureFactory.js +0 -160
  46. package/dist/display/WebXTextureFactory.js.map +0 -1
  47. package/dist/display/WebXTextureFunc.d.ts +0 -3
  48. package/dist/display/WebXWindow.js +0 -478
  49. package/dist/display/WebXWindow.js.map +0 -1
  50. package/dist/display/WebXWindowProperties.d.ts +0 -44
  51. package/dist/display/WebXWindowProperties.js +0 -25
  52. package/dist/display/WebXWindowProperties.js.map +0 -1
  53. package/dist/display/index.js +0 -24
  54. package/dist/display/index.js.map +0 -1
  55. package/dist/index.js +0 -25
  56. package/dist/index.js.map +0 -1
  57. package/dist/input/GuacamoleKeyboard.js +0 -1551
  58. package/dist/input/WebXKeyboard.js +0 -44
  59. package/dist/input/WebXKeyboard.js.map +0 -1
  60. package/dist/input/WebXMouse.js +0 -231
  61. package/dist/input/WebXMouse.js.map +0 -1
  62. package/dist/input/index.js +0 -20
  63. package/dist/input/index.js.map +0 -1
  64. package/dist/input/mouse/WebXMouseState.js +0 -217
  65. package/dist/input/mouse/WebXMouseState.js.map +0 -1
  66. package/dist/input/mouse/index.js +0 -18
  67. package/dist/input/mouse/index.js.map +0 -1
  68. package/dist/instruction/WebXClipboardInstruction.js +0 -23
  69. package/dist/instruction/WebXClipboardInstruction.js.map +0 -1
  70. package/dist/instruction/WebXConnectInstruction.js +0 -24
  71. package/dist/instruction/WebXConnectInstruction.js.map +0 -1
  72. package/dist/instruction/WebXCursorImageInstruction.js +0 -23
  73. package/dist/instruction/WebXCursorImageInstruction.js.map +0 -1
  74. package/dist/instruction/WebXDataAckInstruction.js +0 -26
  75. package/dist/instruction/WebXDataAckInstruction.js.map +0 -1
  76. package/dist/instruction/WebXImageInstruction.js +0 -23
  77. package/dist/instruction/WebXImageInstruction.js.map +0 -1
  78. package/dist/instruction/WebXInstruction.js +0 -28
  79. package/dist/instruction/WebXInstruction.js.map +0 -1
  80. package/dist/instruction/WebXInstructionResponse.js +0 -78
  81. package/dist/instruction/WebXInstructionResponse.js.map +0 -1
  82. package/dist/instruction/WebXInstructionType.js +0 -96
  83. package/dist/instruction/WebXInstructionType.js.map +0 -1
  84. package/dist/instruction/WebXKeyboardInstruction.js +0 -25
  85. package/dist/instruction/WebXKeyboardInstruction.js.map +0 -1
  86. package/dist/instruction/WebXMouseInstruction.js +0 -27
  87. package/dist/instruction/WebXMouseInstruction.js.map +0 -1
  88. package/dist/instruction/WebXPongInstruction.js +0 -23
  89. package/dist/instruction/WebXPongInstruction.js.map +0 -1
  90. package/dist/instruction/WebXQualityInstruction.js +0 -24
  91. package/dist/instruction/WebXQualityInstruction.js.map +0 -1
  92. package/dist/instruction/WebXScreenInstruction.js +0 -20
  93. package/dist/instruction/WebXScreenInstruction.js.map +0 -1
  94. package/dist/instruction/WebXShapeInstruction.js +0 -23
  95. package/dist/instruction/WebXShapeInstruction.js.map +0 -1
  96. package/dist/instruction/WebXWindowsInstruction.js +0 -21
  97. package/dist/instruction/WebXWindowsInstruction.js.map +0 -1
  98. package/dist/instruction/index.js +0 -32
  99. package/dist/instruction/index.js.map +0 -1
  100. package/dist/message/WebXClipboardMessage.js +0 -23
  101. package/dist/message/WebXClipboardMessage.js.map +0 -1
  102. package/dist/message/WebXConnectionMessage.js +0 -21
  103. package/dist/message/WebXConnectionMessage.js.map +0 -1
  104. package/dist/message/WebXCursorImageMessage.js +0 -35
  105. package/dist/message/WebXCursorImageMessage.js.map +0 -1
  106. package/dist/message/WebXImageMessage.js +0 -33
  107. package/dist/message/WebXImageMessage.js.map +0 -1
  108. package/dist/message/WebXMessage.js +0 -23
  109. package/dist/message/WebXMessage.js.map +0 -1
  110. package/dist/message/WebXMessageType.js +0 -64
  111. package/dist/message/WebXMessageType.js.map +0 -1
  112. package/dist/message/WebXMouseMessage.js +0 -29
  113. package/dist/message/WebXMouseMessage.js.map +0 -1
  114. package/dist/message/WebXNopMessage.js +0 -18
  115. package/dist/message/WebXNopMessage.js.map +0 -1
  116. package/dist/message/WebXPingMessage.js +0 -21
  117. package/dist/message/WebXPingMessage.js.map +0 -1
  118. package/dist/message/WebXQualityMessage.js +0 -32
  119. package/dist/message/WebXQualityMessage.js.map +0 -1
  120. package/dist/message/WebXScreenMessage.js +0 -29
  121. package/dist/message/WebXScreenMessage.js.map +0 -1
  122. package/dist/message/WebXShapeMessage.js +0 -29
  123. package/dist/message/WebXShapeMessage.js.map +0 -1
  124. package/dist/message/WebXSubImagesMessage.js +0 -29
  125. package/dist/message/WebXSubImagesMessage.js.map +0 -1
  126. package/dist/message/WebXWindowsMessage.js +0 -25
  127. package/dist/message/WebXWindowsMessage.js.map +0 -1
  128. package/dist/message/index.js +0 -31
  129. package/dist/message/index.js.map +0 -1
  130. package/dist/renderer/WebXAlphaStencilBlender.d.ts +0 -30
  131. package/dist/renderer/WebXAlphaStencilBlender.js +0 -136
  132. package/dist/renderer/WebXAlphaStencilBlender.js.map +0 -1
  133. package/dist/renderer/WebXCanvasRenderer.js +0 -190
  134. package/dist/renderer/WebXCanvasRenderer.js.map +0 -1
  135. package/dist/renderer/WebXImageBlenderFunc.d.ts +0 -8
  136. package/dist/renderer/WebXWindowCanvas.js +0 -312
  137. package/dist/renderer/WebXWindowCanvas.js.map +0 -1
  138. package/dist/renderer/index.js +0 -20
  139. package/dist/renderer/index.js.map +0 -1
  140. package/dist/tracer/WebXDebugImageMessageHandler.js +0 -102
  141. package/dist/tracer/WebXDebugImageMessageHandler.js.map +0 -1
  142. package/dist/tracer/WebXHandler.js +0 -3
  143. package/dist/tracer/WebXHandler.js.map +0 -1
  144. package/dist/tracer/WebXInstructionHandler.js +0 -13
  145. package/dist/tracer/WebXInstructionHandler.js.map +0 -1
  146. package/dist/tracer/WebXMessageHandler.js +0 -13
  147. package/dist/tracer/WebXMessageHandler.js.map +0 -1
  148. package/dist/tracer/WebXStatsHandler.js +0 -13
  149. package/dist/tracer/WebXStatsHandler.js.map +0 -1
  150. package/dist/tracer/index.js +0 -22
  151. package/dist/tracer/index.js.map +0 -1
  152. package/dist/transport/WebXBinarySerializer.js +0 -63
  153. package/dist/transport/WebXBinarySerializer.js.map +0 -1
  154. package/dist/transport/WebXInstructionBuffer.js +0 -109
  155. package/dist/transport/WebXInstructionBuffer.js.map +0 -1
  156. package/dist/transport/WebXInstructionEncoder.js +0 -294
  157. package/dist/transport/WebXInstructionEncoder.js.map +0 -1
  158. package/dist/transport/WebXMessageBuffer.js +0 -104
  159. package/dist/transport/WebXMessageBuffer.js.map +0 -1
  160. package/dist/transport/WebXMessageDecoder.js +0 -333
  161. package/dist/transport/WebXMessageDecoder.js.map +0 -1
  162. package/dist/transport/index.js +0 -22
  163. package/dist/transport/index.js.map +0 -1
  164. package/dist/tunnel/WebXTunnel.js +0 -156
  165. package/dist/tunnel/WebXTunnel.js.map +0 -1
  166. package/dist/tunnel/WebXWebSocketTunnel.js +0 -88
  167. package/dist/tunnel/WebXWebSocketTunnel.js.map +0 -1
  168. package/dist/tunnel/index.js +0 -19
  169. package/dist/tunnel/index.js.map +0 -1
  170. package/dist/utils/WebXColorGenerator.js +0 -46
  171. package/dist/utils/WebXColorGenerator.js.map +0 -1
  172. package/dist/utils/WebXVersion.js +0 -25
  173. package/dist/utils/WebXVersion.js.map +0 -1
  174. package/dist/utils/index.js +0 -19
  175. package/dist/utils/index.js.map +0 -1
  176. package/dist/webx-client.cjs.map +0 -1
  177. package/dist/webx-client.esm.js.map +0 -1
@@ -1,142 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WebXMaterial = void 0;
4
- const three_1 = require("three");
5
- const vertexShader = `
6
- #ifdef USE_MAP
7
- uniform mat3 mapTransform;
8
- varying vec2 vMapUv;
9
- #endif
10
-
11
- #ifdef USE_ALPHAMAP
12
- uniform mat3 alphaMapTransform;
13
- varying vec2 vAlphaMapUv;
14
- #endif
15
-
16
- #ifdef USE_STENCILMAP
17
- varying vec2 vStencilMapUv;
18
- #endif
19
-
20
- void main() {
21
- #ifdef USE_MAP
22
- vMapUv = (mapTransform * vec3(uv, 1)).xy;
23
- #endif
24
-
25
- #ifdef USE_ALPHAMAP
26
- vAlphaMapUv = (alphaMapTransform * vec3(uv, 1)).xy;
27
- #endif
28
-
29
- #ifdef USE_STENCILMAP
30
- vStencilMapUv = uv;
31
- #endif
32
-
33
- gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position, 1.0);
34
- }
35
- `;
36
- const fragmentShader = `
37
- uniform vec3 diffuse;
38
- uniform float opacity;
39
-
40
- #ifdef USE_MAP
41
- uniform sampler2D map;
42
- varying vec2 vMapUv;
43
- #endif
44
-
45
- #ifdef USE_ALPHAMAP
46
- uniform sampler2D alphaMap;
47
- varying vec2 vAlphaMapUv;
48
- #endif
49
-
50
- #ifdef USE_STENCILMAP
51
- uniform sampler2D stencilMap;
52
- varying vec2 vStencilMapUv;
53
- #endif
54
-
55
- void main() {
56
- vec4 diffuseColor = vec4(diffuse, opacity);
57
-
58
- #ifdef USE_STENCILMAP
59
- vec4 stencil = texture2D(stencilMap, vStencilMapUv);
60
- if (stencil.r < 0.5) {
61
- discard;
62
- }
63
- #endif
64
-
65
- #ifdef USE_MAP
66
- vec4 sampledDiffuseColor = texture2D(map, vMapUv);
67
- diffuseColor *= sampledDiffuseColor;
68
- #endif
69
-
70
- #ifdef USE_ALPHAMAP
71
- diffuseColor.a *= texture2D(alphaMap, vAlphaMapUv).g;
72
- #endif
73
-
74
- gl_FragColor = diffuseColor;
75
- gl_FragColor = linearToOutputTexel( gl_FragColor );
76
- }
77
- `;
78
- class WebXMaterial extends three_1.ShaderMaterial {
79
- get map() {
80
- return this.uniforms.map.value;
81
- }
82
- set map(value) {
83
- this.uniforms.map.value = value;
84
- }
85
- get alphaMap() {
86
- return this.uniforms.alphaMap.value;
87
- }
88
- set alphaMap(value) {
89
- this.uniforms.alphaMap.value = value;
90
- }
91
- get stencilMap() {
92
- return this.uniforms.stencilMap.value;
93
- }
94
- set stencilMap(value) {
95
- this.uniforms.stencilMap.value = value;
96
- if (value) {
97
- this.defines.USE_STENCILMAP = '';
98
- }
99
- else {
100
- delete this.defines.USE_STENCILMAP;
101
- }
102
- }
103
- get color() {
104
- return this.uniforms.diffuse.value;
105
- }
106
- set color(value) {
107
- this.uniforms.diffuse.value.copy(value);
108
- }
109
- constructor(params) {
110
- super({
111
- uniforms: {
112
- map: { value: null },
113
- alphaMap: { value: null },
114
- stencilMap: { value: null },
115
- mapTransform: { value: new three_1.Matrix3() },
116
- alphaMapTransform: { value: new three_1.Matrix3() },
117
- diffuse: { value: new three_1.Color(0xffffff) },
118
- opacity: { value: 1.0 },
119
- },
120
- vertexShader,
121
- fragmentShader,
122
- transparent: true,
123
- depthTest: true,
124
- side: three_1.BackSide,
125
- });
126
- if (params && params.color) {
127
- this.color.set(params.color);
128
- }
129
- }
130
- onBeforeRender() {
131
- if (this.map && this.map.matrixAutoUpdate) {
132
- this.map.updateMatrix();
133
- this.uniforms.mapTransform.value.copy(this.map.matrix);
134
- }
135
- if (this.alphaMap && this.alphaMap.matrixAutoUpdate) {
136
- this.alphaMap.updateMatrix();
137
- this.uniforms.alphaMapTransform.value.copy(this.alphaMap.matrix);
138
- }
139
- }
140
- }
141
- exports.WebXMaterial = WebXMaterial;
142
- //# sourceMappingURL=WebXMaterial.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WebXMaterial.js","sourceRoot":"","sources":["../../src/display/WebXMaterial.ts"],"names":[],"mappings":";;;AAAA,iCAAqG;AAIrG,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BpB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- * A sub-image is a portion of a window's texture that can be updated independently.
6
- */
7
- export declare class WebXSubImage {
8
- /**
9
- * The x-coordinate of the sub-image within the window.
10
- */
11
- readonly x: number;
12
- /**
13
- * The y-coordinate of the sub-image within the window.
14
- */
15
- readonly y: number;
16
- /**
17
- * The width of the sub-image.
18
- */
19
- readonly width: number;
20
- /**
21
- * The height of the sub-image.
22
- */
23
- readonly height: number;
24
- /**
25
- * The depth of the sub-image (e.g., 24-bit or 32-bit).
26
- */
27
- readonly depth: number;
28
- /**
29
- * The color map texture of the sub-image.
30
- */
31
- readonly colorMap: THREE.Texture;
32
- /**
33
- * The alpha map texture of the sub-image.
34
- */
35
- readonly alphaMap: THREE.Texture;
36
- /**
37
- * Creates a new instance of WebXSubImage.
38
- *
39
- * @param properties The properties of the sub-image, including position, size, and textures.
40
- */
41
- constructor(properties: {
42
- x: number;
43
- y: number;
44
- width: number;
45
- height: number;
46
- depth: number;
47
- colorMap: THREE.Texture;
48
- alphaMap: THREE.Texture;
49
- });
50
- }
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WebXSubImage = void 0;
4
- /**
5
- * Represents a sub-image within a WebX window.
6
- *
7
- * A sub-image is a portion of a window's texture that can be updated independently.
8
- */
9
- class WebXSubImage {
10
- /**
11
- * Creates a new instance of WebXSubImage.
12
- *
13
- * @param properties The properties of the sub-image, including position, size, and textures.
14
- */
15
- constructor(properties) {
16
- this.x = properties.x;
17
- this.y = properties.y;
18
- this.width = properties.width;
19
- this.height = properties.height;
20
- this.depth = properties.depth;
21
- this.colorMap = properties.colorMap;
22
- this.alphaMap = properties.alphaMap;
23
- }
24
- }
25
- exports.WebXSubImage = WebXSubImage;
26
- //# sourceMappingURL=WebXSubImage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WebXSubImage.js","sourceRoot":"","sources":["../../src/display/WebXSubImage.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACH,MAAa,YAAY;IAoCvB;;;;OAIG;IACH,YAAY,UAQX;QACC,IAAI,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;QACtB,IAAI,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QAChC,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC;QACpC,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC;IACtC,CAAC;CACF;AA1DD,oCA0DC"}
@@ -1,6 +0,0 @@
1
- export declare class WebXTexture {
2
- image: ImageBitmap | HTMLImageElement;
3
- colorSpace: string;
4
- flipY: boolean;
5
- constructor(image: ImageBitmap | HTMLImageElement);
6
- }
@@ -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,0 @@
1
- {"version":3,"file":"WebXTextureFactory.js","sourceRoot":"","sources":["../../src/display/WebXTextureFactory.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,gDAA0E;AAC1E,iCAA4C;AAG5C;;;;GAIG;AACH,MAAa,kBAAkB;IAE7B,YAAoB,OAAmB;QAAnB,YAAO,GAAP,OAAO,CAAY;IAAG,CAAC;IAE3C;;;;;OAKG;IACU,gBAAgB,CAAC,QAAgB;;YAC5C,IAAI,CAAC;gBACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC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,MAAM,CAAC,EAAE;oBACb,MAAM,OAAO,GAAY,IAAI,eAAO,EAAE,CAAC;oBACvC,OAAO,CAAC,KAAK,GAAG,MAAM,CAAC;oBAEvB,OAAO,CAAC,OAAO,CAAC,CAAC;gBACnB,CAAC,CAAC;qBACD,KAAK,CAAC,KAAK,CAAC,EAAE;oBACb,OAAO,CAAC,IAAI,CAAC,sEAAsE,KAAK,EAAE,CAAC,CAAC;oBAC5F,MAAM,CAAC,KAAK,CAAC,CAAC;gBAChB,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QAEL,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,OAAO,CAAU,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBAC9C,qDAAqD;gBACrD,MAAM,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;gBACtC,MAAM,KAAK,GAAqB,IAAI,KAAK,EAAE,CAAC;gBAC5C,KAAK,CAAC,MAAM,GAAG,GAAG,EAAE;oBAClB,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;oBACzB,MAAM,OAAO,GAAY,IAAI,eAAO,CAAC,KAAK,CAAC,CAAC;oBAE5C,OAAO,CAAC,OAAO,CAAC,CAAC;gBACnB,CAAC,CAAC;gBAEF,KAAK,CAAC,OAAO,GAAG,CAAC,KAAK,EAAE,EAAE;oBACxB,OAAO,CAAC,IAAI,CAAC,8CAA8C,KAAK,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,3 +0,0 @@
1
- import * as THREE from 'three';
2
- import { WebXTexture } from "./WebXTexture";
3
- export declare const toThreeTexture: (texture: WebXTexture) => THREE.Texture;