UNPKG

ppu-ocv

Version:

A type-safe, modular, chainable image processing library built on top of OpenCV.js with a fluent API leveraging pipeline processing.

1 lines 577 B
let _platform=null;export function setPlatform(platform){_platform=platform}export function getPlatform(){if(!_platform){throw new Error("No canvas platform registered. "+'Import "ppu-ocv" (Node), "ppu-ocv/web" (browser), '+'"ppu-ocv/canvas" (Node canvas-only), "ppu-ocv/canvas-web" (browser canvas-only), '+'or "ppu-ocv/canvas-mobile" (React Native / Skia) to auto-register.')}return _platform}export function isCanvasLike(value){return typeof value==="object"&&value!==null&&typeof value.getContext==="function"&&typeof value.width==="number"&&typeof value.height==="number"}