public function getTopLeftOnBit() : ?array
    {
        $bitsOffset = 0;

        while ($bitsOffset < count($this->bits) && 0 === $this->bits[$bitsOffset]) {
            ++$bitsOffset;
        }

        if (count($this->bits) === $bitsOffset) {
            return null;
        }

        $x = intdiv($bitsOffset, $this->rowSize);
        $y = ($bitsOffset % $this->rowSize) << 5;

        $bits = $this->bits[$bitsOffset];
        $bit = 0;

        while (0 === ($bits << (31 - $bit))) {
            ++$bit;
        }

        $x += $bit;

        return [$x, $y];
    }
public function getTopLeftOnBit() : ?array
    {
        $bitsOffset = 0;

        while ($bitsOffset < count($this->bits) && 0 === $this->bits[$bitsOffset]) {
            ++$bitsOffset;
        }

        if (count($this->bits) === $bitsOffset) {
            return null;
        }

        $x = intdiv($bitsOffset, $this->rowSize);
        $y = ($bitsOffset % $this->rowSize) << 5;

        $bits = $this->bits[$bitsOffset];
        $bit = 0;

        while (0 === ($bits << (31 - $bit))) {
            ++$bit;
        }

        $x += $bit;

        return [$x, $y];
    }
public function getTopLeftOnBit ( ) : ? array { $ bitsOffset = 0 ; while ( $ bitsOffset < count ( $ this -> bits ) && 0 === $ this -> bits [ $ bitsOffset ] ) { ++ $ bitsOffset ; } if ( count ( $ this -> bits ) === $ bitsOffset ) { return null ; } $ x = intdiv ( $ bitsOffset , $ this -> rowSize ) ; $ y = ( $ bitsOffset % $ this -> rowSize ) << 5 ; $ bits = $ this -> bits [ $ bitsOffset ] ; $ bit = 0 ; while ( 0 === ( $ bits << ( 31 - $ bit ) ) ) { ++ $ bit ; } $ x += $ bit ; return [ $ x , $ y ] ; }
Gets the most top left set bit.

This is useful in detecting a corner of a 'pure' barcode.

@return int[]|null
Gets the most top left set bit .