Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
302 B
2
Indexable
Never
    var imgData = ctx.getImageData(0, 0, canvas.width, canvas.height);

    var indices = [];
    
    // Boundary check
    if (x1 < 0 || y1 < 0 || x1 + n > imgData.width || y1 + n > imgData.height) {
        console.error("(x1,y1) Out of bounds");
        return []; // Return an empty array
Leave a Comment