(image)
| 57518 | return format; |
| 57519 | } |
| 57520 | function getImageData(image) { |
| 57521 | switch(getImageType(image)){ |
| 57522 | case "data": |
| 57523 | return image; |
| 57524 | case "image": |
| 57525 | case "imagebitmap": |
| 57526 | var canvas = document.createElement("canvas"); |
| 57527 | var context = canvas.getContext("2d"); |
| 57528 | if (context) { |
| 57529 | canvas.width = image.width; |
| 57530 | canvas.height = image.height; |
| 57531 | context.drawImage(image, 0, 0); |
| 57532 | return context.getImageData(0, 0, image.width, image.height); |
| 57533 | } |
| 57534 | default: |
| 57535 | return (0, _assertDefault.default)(false); |
| 57536 | } |
| 57537 | } |
| 57538 | function getImageTypeOrNull(image) { |
| 57539 | if (typeof ImageBitmap !== "undefined" && image instanceof ImageBitmap) return "imagebitmap"; |
| 57540 | if (typeof Image !== "undefined" && image instanceof Image) return "image"; |
nothing calls this directly
no test coverage detected