static thresholdBlock(luminances, xoffset /*int*/, yoffset /*int*/, threshold /*int*/, stride /*int*/, matrix) {
        for (let y = 0, offset = yoffset * stride + xoffset; y < HybridBinarizer.BLOCK_SIZE; y++, offset += stride) {
            for (let x = 0; x < HybridBinarizer.BLOCK_SIZE; x++) {
                // Comparison needs to be <= so that black == 0 pixels are black even if the threshold is 0.
                if ((luminances[offset + x] & 0xFF) <= threshold) {
                    matrix.set(xoffset + x, yoffset + y);
                }
            }
        }
    }
/**
     * Applies a single threshold to a block of pixels.
     */
Applies a single threshold to a block of pixels.
Applies a single threshold to a block of pixels .
static thresholdBlock(luminances, xoffset , yoffset , threshold , stride , matrix) {
        for (let y = 0, offset = yoffset * stride + xoffset; y < HybridBinarizer.BLOCK_SIZE; y++, offset += stride) {
            for (let x = 0; x < HybridBinarizer.BLOCK_SIZE; x++) {
                if ((luminances[offset + x] & 0xFF) <= threshold) {
                    matrix.set(xoffset + x, yoffset + y);
                }
            }
        }
    }
static thresholdBlock ( luminances , xoffset , yoffset , threshold , stride , matrix ) { for ( let y = 0 , offset = yoffset * stride + xoffset ; y < HybridBinarizer . BLOCK_SIZE ; y ++ , offset += stride ) { for ( let x = 0 ; x < HybridBinarizer . BLOCK_SIZE ; x ++ ) { if ( ( luminances [ offset + x ] & 0xFF ) <= threshold ) { matrix . set ( xoffset + x , yoffset + y ) ; } } } }
Applies a single threshold to a block of pixels.
Applies a single threshold to a block of pixels .
/*int*/ /*int*/ /*int*/ /*int*/ // Comparison needs to be <= so that black == 0 pixels are black even if the threshold is 0.