0.0.7 • Published 3 years ago

rect-detect v0.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
3 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

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago