UNPKG

@techolution-ai/computer-vision

Version:

A JavaScript/TypeScript library for computer vision applications, providing tools for image processing, scanning, and MQTT-based messaging.

60 lines (59 loc) 1.91 kB
var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/scanner/scan-image.tsx var scan_image_exports = {}; __export(scan_image_exports, { default: () => scan_image_default }); module.exports = __toCommonJS(scan_image_exports); var import_react = require("react"); var import_jsx_runtime = require("react/jsx-runtime"); var ScanImage = (0, import_react.forwardRef)( (props, ref) => { const { src, crossOrigin, ...restProps } = props; const imageRef = (0, import_react.useRef)(null); (0, import_react.useEffect)(() => { const imgRefCopy = imageRef.current; if (imageRef) return; imgRefCopy.src = src; return () => { if (imgRefCopy) { imgRefCopy.src = ""; } }; }, []); return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( "img", { ref: (_ref) => { imageRef.current = _ref; if (typeof ref === "function") { ref(_ref); } else if (ref) { ; ref.current = _ref; } }, src, ...restProps } ); } ); var scan_image_default = ScanImage; //# sourceMappingURL=scan-image.cjs.map