dommatrix-to-array.html 809 B

123456789101112131415161718192021
  1. <script src="../include.js"></script>
  2. <script>
  3. test(() => {
  4. let testCounter = 1;
  5. function testPart(part) {
  6. println(`${testCounter++}. ${JSON.stringify(part())}`);
  7. }
  8. // 1. DOMMatrix to Float32Array
  9. testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60]).toFloat32Array());
  10. // 2. DOMMatrix to Float32Array
  11. testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160]).toFloat32Array());
  12. // 3. DOMMatrix to Float64Array
  13. testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60]).toFloat64Array());
  14. // 4. DOMMatrix to Float64Array
  15. testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160]).toFloat64Array());
  16. });
  17. </script>