wgsl-renderer 0.1.7 → 0.1.8
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/cjs/index.js +2 -2
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +2 -2
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -629,7 +629,7 @@ var WGSLRenderer = class {
|
|
|
629
629
|
addressModeV: "clamp-to-edge"
|
|
630
630
|
}, options));
|
|
631
631
|
}
|
|
632
|
-
async loadImageTexture(image, format) {
|
|
632
|
+
async loadImageTexture(image, format, options) {
|
|
633
633
|
if (typeof image === "string") if (image.startsWith("data:")) {
|
|
634
634
|
const base64Data = image.split(",")[1];
|
|
635
635
|
const binaryString = atob(base64Data);
|
|
@@ -644,7 +644,7 @@ var WGSLRenderer = class {
|
|
|
644
644
|
});
|
|
645
645
|
image = await (await resp).blob();
|
|
646
646
|
}
|
|
647
|
-
const future = createImageBitmap(image);
|
|
647
|
+
const future = createImageBitmap(image, options);
|
|
648
648
|
future.catch((err) => {
|
|
649
649
|
console.error("Failed to load texture:", err);
|
|
650
650
|
});
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -217,7 +217,7 @@ declare class WGSLRenderer {
|
|
|
217
217
|
* Create a sampler
|
|
218
218
|
*/
|
|
219
219
|
createSampler(options?: GPUSamplerDescriptor): GPUSampler;
|
|
220
|
-
loadImageTexture(image: Blob | string, format?: GPUTextureFormat): Promise<{
|
|
220
|
+
loadImageTexture(image: Blob | string, format?: GPUTextureFormat, options?: ImageBitmapOptions): Promise<{
|
|
221
221
|
texture: GPUTexture;
|
|
222
222
|
bitMap: ImageBitmap;
|
|
223
223
|
width: number;
|
package/dist/esm/index.js
CHANGED
|
@@ -628,7 +628,7 @@ var WGSLRenderer = class {
|
|
|
628
628
|
addressModeV: "clamp-to-edge"
|
|
629
629
|
}, options));
|
|
630
630
|
}
|
|
631
|
-
async loadImageTexture(image, format) {
|
|
631
|
+
async loadImageTexture(image, format, options) {
|
|
632
632
|
if (typeof image === "string") if (image.startsWith("data:")) {
|
|
633
633
|
const base64Data = image.split(",")[1];
|
|
634
634
|
const binaryString = atob(base64Data);
|
|
@@ -643,7 +643,7 @@ var WGSLRenderer = class {
|
|
|
643
643
|
});
|
|
644
644
|
image = await (await resp).blob();
|
|
645
645
|
}
|
|
646
|
-
const future = createImageBitmap(image);
|
|
646
|
+
const future = createImageBitmap(image, options);
|
|
647
647
|
future.catch((err) => {
|
|
648
648
|
console.error("Failed to load texture:", err);
|
|
649
649
|
});
|