!C99Shell v. 2.1 [PHP 8 Update] [02.02.2022]!

Software: Apache/2.4.53 (Unix) OpenSSL/1.1.1o PHP/7.4.29 mod_perl/2.0.12 Perl/v5.34.1. PHP/7.4.29 

uname -a: Linux vps-2738122-x 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 

uid=1(daemon) gid=1(daemon) grupos=1(daemon) 

Safe-mode: OFF (not secure)

/opt/lampp/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Module/EdgeIterator/   drwxr-xr-x
Free 11.32 GB of 61.93 GB (18.28%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     EdgeIterator.php (3.59 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
declare(strict_types 1);

namespace 
BaconQrCode\Renderer\Module\EdgeIterator;

use 
BaconQrCode\Encoder\ByteMatrix;
use 
IteratorAggregate;
use 
Traversable;

/**
 * Edge iterator based on potrace.
 */
final class EdgeIterator implements IteratorAggregate
{
    
/**
     * @var int[]
     */
    
private $bytes = [];

    
/**
     * @var int
     */
    
private $size;

    
/**
     * @var int
     */
    
private $width;

    
/**
     * @var int
     */
    
private $height;

    public function 
__construct(ByteMatrix $matrix)
    {
        
$this->bytes iterator_to_array($matrix->getBytes());
        
$this->size count($this->bytes);
        
$this->width $matrix->getWidth();
        
$this->height $matrix->getHeight();
    }

    
/**
     * @return Edge[]
     */
    
public function getIterator() : Traversable
    
{
        
$originalBytes $this->bytes;
        
$point $this->findNext(00);

        while (
null !== $point) {
            
$edge $this->findEdge($point[0], $point[1]);
            
$this->xorEdge($edge);

            yield 
$edge;

            
$point $this->findNext($point[0], $point[1]);
        }

        
$this->bytes $originalBytes;
    }

    
/**
     * @return int[]|null
     */
    
private function findNext(int $xint $y) : ?array
    {
        
$i $this->width $y $x;

        while (
$i $this->size && !== $this->bytes[$i]) {
            ++
$i;
        }

        if (
$i $this->size) {
            return 
$this->pointOf($i);
        }

        return 
null;
    }

    private function 
findEdge(int $xint $y) : Edge
    
{
        
$edge = new Edge($this->isSet($x$y));
        
$startX $x;
        
$startY $y;
        
$dirX 0;
        
$dirY 1;

        while (
true) {
            
$edge->addPoint($x$y);
            
$x += $dirX;
            
$y += $dirY;

            if (
$x === $startX && $y === $startY) {
                break;
            }

            
$left $this->isSet($x + ($dirX $dirY ) / 2$y + ($dirY $dirX 1) / 2);
            
$right $this->isSet($x + ($dirX $dirY 1) / 2$y + ($dirY $dirX 1) / 2);

            if (
$right && ! $left) {
                
$tmp $dirX;
                
$dirX = -$dirY;
                
$dirY $tmp;
            } elseif (
$right) {
                
$tmp $dirX;
                
$dirX = -$dirY;
                
$dirY $tmp;
            } elseif (! 
$left) {
                
$tmp $dirX;
                
$dirX $dirY;
                
$dirY = -$tmp;
            }
        }

        return 
$edge;
    }

    private function 
xorEdge(Edge $path) : void
    
{
        
$points $path->getPoints();
        
$y1 $points[0][1];
        
$length count($points);
        
$maxX $path->getMaxX();

        for (
$i 1$i $length; ++$i) {
            
$y $points[$i][1];

            if (
$y === $y1) {
                continue;
            }

            
$x $points[$i][0];
            
$minY min($y1$y);

            for (
$j $x$j $maxX; ++$j) {
                
$this->flip($j$minY);
            }

            
$y1 $y;
        }
    }

    private function isSet(
int $xint $y) : bool
    
{
        return (
            
$x >= 0
            
&& $x $this->width
            
&& $y >= 0
            
&& $y $this->height
        
) && === $this->bytes[$this->width $y $x];
    }

    
/**
     * @return int[]
     */
    
private function pointOf(int $i) : array
    {
        
$y intdiv($i$this->width);
        return [
$i $y $this->width$y];
    }

    private function 
flip(int $xint $y) : void
    
{
        
$this->bytes[$this->width $y $x] = (
            
$this->isSet($x$y) ? 1
        
);
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.1 [PHP 8 Update] [02.02.2022] maintained byC99Shell Github | Generation time: 0.8388 ]--