0.0.7 • Published 2 years ago

rect-detect v0.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

demo

npm i rect-detect
import { rectDetect, circleDetect } from "rect-detect";

const rect = rectDetect(pixel, width, height, {
    color: [0, 0, 0, 255],
}) 

ctx.fillStyle = "red";

for (const [x, y, w, h] of rect) {
    ctx.beginPath();
    ctx.rect(x, y, w, h);
    ctx.strokeStyle = "red";
    ctx.stroke();
}


const circle = circleDetect(pixel, width, height, {
    color: [0, 0, 255, 255],
});

for (const [x, y, r] of circle) {
    ctx.beginPath();
    ctx.arc(x, y, r, 0, 2 * Math.PI, false);
    ctx.lineWidth = 1;
    ctx.strokeStyle = R;
    ctx.stroke();
}
0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago