@woosh/meep-engine 2.46.36 → 2.47.1

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.
@@ -1,12 +1,16 @@
1
1
  import { Sampler2D } from "./Sampler2D.js";
2
2
  import { sampler2d_to_uint8_RGBA } from "./sampler2d_to_uint8_RGBA.js";
3
+ import { assert } from "../../../../core/assert.js";
3
4
 
4
5
  /**
5
6
  *
6
7
  * @param {Sampler2D} sampler
7
8
  * @param {HTMLCanvasElement} canvas
8
9
  */
9
- export function sample2d_write_to_canvas_raw(sampler, canvas) {
10
+ export function sampler2d_write_to_canvas_raw(sampler, canvas) {
11
+
12
+ assert.defined(sampler, 'sampler');
13
+ assert.defined(canvas, 'canvas');
10
14
 
11
15
  const width = sampler.width;
12
16
  const height = sampler.height;
@@ -1,5 +1,5 @@
1
1
  import { assert } from "../../../../core/assert.js";
2
- import { sampler2D_scale_down_linear } from "./sampler2D_scale_down_linear.js";
2
+ import { sampler2d_scale_down_linear } from "./sampler2d_scale_down_linear.js";
3
3
  import { Sampler2D } from "./Sampler2D.js";
4
4
  import { upsampleSampler2D } from "./upsampleSampler2D.js";
5
5
  import { genericResampleSampler2D } from "./genericResampleSampler2D.js";
@@ -29,7 +29,7 @@ export function scaleSampler2D(input, output) {
29
29
  // downscaling
30
30
  if (Number.isInteger(sourceWidth / targetWidth) && Number.isInteger(sourceHeight / targetHeight)) {
31
31
  // dimensions are multiples of source/target
32
- sampler2D_scale_down_linear(input, output);
32
+ sampler2d_scale_down_linear(input, output);
33
33
  } else {
34
34
  // generic downsample
35
35
  genericResampleSampler2D(input, output, 3);
@@ -1,5 +1,5 @@
1
1
  import { Sampler2D } from "../../../graphics/texture/sampler/Sampler2D.js";
2
- import { sampler2D_scale_down_linear } from "../../../graphics/texture/sampler/sampler2D_scale_down_linear.js";
2
+ import { sampler2d_scale_down_linear } from "../../../graphics/texture/sampler/sampler2d_scale_down_linear.js";
3
3
  import { computeWholeDivisorLow } from "../../../../core/math/computeWholeDivisorLow.js";
4
4
 
5
5
  /**
@@ -20,7 +20,7 @@ export function buildCameraTargetSampler({ heightSampler }) {
20
20
 
21
21
  const result = Sampler2D.float32(1, s(heightSampler.width), s(heightSampler.height));
22
22
 
23
- sampler2D_scale_down_linear(heightSampler, result);
23
+ sampler2d_scale_down_linear(heightSampler, result);
24
24
 
25
25
  return result;
26
26
  }