Gets the most bottom right set bit.

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

@return int[]|null
325773
public function getBottomRightOnBit() : ?array
    {
        $bitsOffset = count($this->bits) - 1;

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

        if ($bitsOffset < 0) {
            return null;
        }

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

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

        while (0 === BitUtils::unsignedRightShift($bits, $bit)) {
            --$bit;
        }

        $x += $bit;

        return [$x, $y];
    }
247539
public function tail()
    {
        $last = count($this->parts) - 1;
        if ($last < 0) {
            return null;
        }

        return $this->parts[$last];
    }
1333196
public function getLastReference()
    {
        return substr($this->data, $this->forkRate * $this->keyLength*3, $this->keyLength);
    }
697133
private function doGetIteratorBin()
    {
        $bitset   = $this->bitset;
        $byteLen  = \strlen($bitset);
        for ($bytePos = 0; $bytePos < $byteLen; ++$bytePos) {
            if ($bitset[$bytePos] === "\0") {
                // fast skip null byte
                continue;
            }

            $ord = \ord($bitset[$bytePos]);
            for ($bitPos = 0; $bitPos < 8; ++$bitPos) {
                if ($ord & (1 << $bitPos)) {
                    $ordinal = $bytePos * 8 + $bitPos;
                    yield $ordinal => ($this->enumeration)::byOrdinal($ordinal);
                }
            }
        }
    }
665104
public function last()
	{
		$set = array_slice($this->list, -1, 1, true);
		
		return isset($set[0]) ? $set[0] : null;
	}
357098
protected function getValuesPerCodeBranch()
	{
		$values = [];
		foreach ($this->branchesCode as $value => $branchCode)
		{
			$values[$branchCode][] = $value;
		}

		return $values;
	}
185598
private function getRandColor()
    {
        $red = mt_rand(1,254);
        $green = mt_rand(1,254);

        if($red + $green > 400){
            $blue = 0;
        }else{
            $blue = 400 -$green - $red;
        }
        return [$red,$green,$blue];
    }
1038012
public function getStepIndexes()
    {
        $dates = [];

        // TODO : Think about doing this a cleaner way with carbon instead with timestamps ...
        $current = $this->start->timestamp;
        $last = $this->end->timestamp;

        while ($current <= $last) {
            $dates[] = date($this->getStepFormat(), $current);
            $current = strtotime($this->getStepIncrement(), $current);
        }

        return $dates;
    }
1152502
protected function getVlqBytesToInt()
    {
        $value = 0;
        $isBigInt = false;

        for ($this->pos; $this->pos < $this->maxLen; $this->pos++) {
            if (!$isBigInt) {
                $lshift = $value << 7;
                # An overflow bitshift will result in a negative number. This will check if GMP is available and flip it
                # to a bigint safe method in one shot.
                if ($lshift < 0) {
                    $isBigInt = true;
                    $this->throwIfBigIntGmpNeeded(true);
                    $value = \gmp_init($value);
                }
            }
            if ($isBigInt) {
                $lshift = \gmp_mul($value, \gmp_pow('2', 7));
            }
            $orVal = (\ord($this->binary[$this->pos]) & 0x7f);
            if ($isBigInt) {
                $value = \gmp_or($lshift, \gmp_init($orVal));
            } else {
                $value = $lshift | $orVal;
            }
            # We have reached the last byte if the MSB is not set.
            if ((\ord($this->binary[$this->pos]) & 0x80) === 0) {
                $this->pos++;
                return $isBigInt ? \gmp_strval($value) : $value;
            }
        }

        throw new EncoderException('Expected an ending byte to decode a VLQ, but none was found.');
    }
392652
private function doGetOrdinalsBin()
    {
        $ordinals = [];
        $bitset   = $this->bitset;
        $byteLen  = \strlen($bitset);
        for ($bytePos = 0; $bytePos < $byteLen; ++$bytePos) {
            if ($bitset[$bytePos] === "\0") {
                // fast skip null byte
                continue;
            }

            $ord = \ord($bitset[$bytePos]);
            for ($bitPos = 0; $bitPos < 8; ++$bitPos) {
                if ($ord & (1 << $bitPos)) {
                    $ordinals[] = $bytePos * 8 + $bitPos;
                }
            }
        }
        return $ordinals;
    }
496525
public function getPlacementOptions()
    {
        return [
            self::PLACEMENT_AUTO => _t(__CLASS__ . '.AUTO', 'Auto'),
            self::PLACEMENT_TOP => _t(__CLASS__ . '.TOP', 'Top'),
            self::PLACEMENT_LEFT => _t(__CLASS__ . '.LEFT', 'Left'),
            self::PLACEMENT_RIGHT => _t(__CLASS__ . '.RIGHT', 'Right'),
            self::PLACEMENT_BOTTOM => _t(__CLASS__ . '.BOTTOM', 'Bottom'),
        ];
    }
263921
public function getIconBounds() 
    {
        // Round padding to nearest integer
        $padding = (int)($this->style->getPadding() * $this->size + 0.5);
        
        return new Rectangle(
            $padding, $padding,
            $this->size - $padding * 2,
            $this->size - $padding * 2);
    }
972236
public function getEnclosingRectangle() : ?array
    {
        $left = $this->width;
        $top = $this->height;
        $right = -1;
        $bottom = -1;

        for ($y = 0; $y < $this->height; ++$y) {
            for ($x32 = 0; $x32 < $this->rowSize; ++$x32) {
                $bits = $this->bits[$y * $this->rowSize + $x32];

                if (0 !== $bits) {
                    if ($y < $top) {
                        $top = $y;
                    }

                    if ($y > $bottom) {
                        $bottom = $y;
                    }

                    if ($x32 * 32 < $left) {
                        $bit = 0;

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

                        if (($x32 * 32 + $bit) < $left) {
                            $left = $x32 * 32 + $bit;
                        }
                    }
                }

                if ($x32 * 32 + 31 > $right) {
                    $bit = 31;

                    while (0 === BitUtils::unsignedRightShift($bits, $bit)) {
                        --$bit;
                    }

                    if (($x32 * 32 + $bit) > $right) {
                        $right = $x32 * 32 + $bit;
                    }
                }
            }
        }

        $width = $right - $left;
        $height = $bottom - $top;

        if ($width < 0 || $height < 0) {
            return null;
        }

        return [$left, $top, $width, $height];
    }
580316
public function getValue()
    {
        $parts = $this->literalParts;
        
        reset($this->encodedParts);
        ksort($this->encodedParts);
        while (current($this->encodedParts) !== false) {
            $parts[key($this->encodedParts)] = $this->getNextEncodedValue();
        }
        
        ksort($parts);
        return array_reduce(
            $parts,
            function ($carry, $item) {
                return $carry . $item;
            },
            ''
        );
    }
443930
protected function get_key_from_position() {
        $keylist = array_keys($this->userlists);
        if (isset($keylist[$this->iteratorposition])) {
            return $keylist[$this->iteratorposition];
        }

        return null;
    }
619821
public function getAllTransformations() {
		$t = array();
		$bits = $this->bits;
		$t['T0'] = $bits;
		for ($i=1; $i<12; $i++) {
			$bits = \ianring\BitmaskUtils::rotateBitmask($bits, $direction = 1, $amount = 1);
			$t['T' . $i] = $bits;
		}

		$bits = \ianring\BitmaskUtils::reflectBitmask($this->bits);
		$t['T0I'] = $bits;
		for ($i=1; $i<12; $i++) {
			$bits = \ianring\BitmaskUtils::rotateBitmask($bits, $direction = 1, $amount = 1);
			$t['T' . $i . 'I'] = $bits;
		}
		return $t;
	}
143012
public function getBitRate()
    {
        if ($this->bitRate === null) {
            $match = [];
            preg_match(self::$REGEX_BITRATE, $this->output, $match);
            $this->bitRate = (int)(array_key_exists(1, $match) ? ($match[1] * 1000) : 0);
        }

        return $this->bitRate;
    }