diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-01-09 10:55:03 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-01-09 13:09:38 +0100 |
| commit | 04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa (patch) | |
| tree | 5c691241355c943a3c68ddb06b8cf8c60aa11319 /srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Eye | |
| parent | 7e0d85db834d6351ed85d01e5126ac31dc510b86 (diff) | |
| download | ft_server-04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa.tar.gz ft_server-04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa.tar.bz2 ft_server-04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa.zip | |
phpmyadmin working
Diffstat (limited to 'srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Eye')
5 files changed, 225 insertions, 0 deletions
diff --git a/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Eye/CompositeEye.php b/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Eye/CompositeEye.php new file mode 100644 index 0000000..a3e1909 --- /dev/null +++ b/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Eye/CompositeEye.php @@ -0,0 +1,38 @@ +<?php +declare(strict_types = 1); + +namespace BaconQrCode\Renderer\Eye; + +use BaconQrCode\Renderer\Path\Path; + +/** + * Combines the style of two different eyes. + */ +final class CompositeEye implements EyeInterface +{ + /** + * @var EyeInterface + */ + private $externalEye; + + /** + * @var EyeInterface + */ + private $internalEye; + + public function __construct(EyeInterface $externalEye, EyeInterface $internalEye) + { + $this->externalEye = $externalEye; + $this->internalEye = $internalEye; + } + + public function getExternalPath() : Path + { + return $this->externalEye->getExternalPath(); + } + + public function getInternalPath() : Path + { + return $this->externalEye->getInternalPath(); + } +} diff --git a/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Eye/EyeInterface.php b/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Eye/EyeInterface.php new file mode 100644 index 0000000..ab68f3c --- /dev/null +++ b/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Eye/EyeInterface.php @@ -0,0 +1,26 @@ +<?php +declare(strict_types = 1); + +namespace BaconQrCode\Renderer\Eye; + +use BaconQrCode\Renderer\Path\Path; + +/** + * Interface for describing the look of an eye. + */ +interface EyeInterface +{ + /** + * Returns the path of the external eye element. + * + * The path origin point (0, 0) must be anchored at the middle of the path. + */ + public function getExternalPath() : Path; + + /** + * Returns the path of the internal eye element. + * + * The path origin point (0, 0) must be anchored at the middle of the path. + */ + public function getInternalPath() : Path; +} diff --git a/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Eye/ModuleEye.php b/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Eye/ModuleEye.php new file mode 100644 index 0000000..84f7d12 --- /dev/null +++ b/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Eye/ModuleEye.php @@ -0,0 +1,54 @@ +<?php +declare(strict_types = 1); + +namespace BaconQrCode\Renderer\Eye; + +use BaconQrCode\Encoder\ByteMatrix; +use BaconQrCode\Renderer\Module\ModuleInterface; +use BaconQrCode\Renderer\Path\Path; + +/** + * Renders an eye based on a module renderer. + */ +final class ModuleEye implements EyeInterface +{ + /** + * @var ModuleInterface + */ + private $module; + + public function __construct(ModuleInterface $module) + { + $this->module = $module; + } + + public function getExternalPath() : Path + { + $matrix = new ByteMatrix(7, 7); + + for ($x = 0; $x < 7; ++$x) { + $matrix->set($x, 0, 1); + $matrix->set($x, 6, 1); + } + + for ($y = 1; $y < 6; ++$y) { + $matrix->set(0, $y, 1); + $matrix->set(6, $y, 1); + } + + return $this->module->createPath($matrix)->translate(-3.5, -3.5); + } + + public function getInternalPath() : Path + { + $matrix = new ByteMatrix(3, 3); + + for ($x = 0; $x < 3; ++$x) { + for ($y = 0; $y < 3; ++$y) { + $matrix->set($x, $y, 1); + } + } + + return $this->module->createPath($matrix)->translate(-1.5, -1.5); + } +} diff --git a/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Eye/SimpleCircleEye.php b/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Eye/SimpleCircleEye.php new file mode 100644 index 0000000..64d54ee --- /dev/null +++ b/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Eye/SimpleCircleEye.php @@ -0,0 +1,54 @@ +<?php +declare(strict_types = 1); + +namespace BaconQrCode\Renderer\Eye; + +use BaconQrCode\Renderer\Path\Path; + +/** + * Renders the inner eye as a circle. + */ +final class SimpleCircleEye implements EyeInterface +{ + /** + * @var self|null + */ + private static $instance; + + private function __construct() + { + } + + public static function instance() : self + { + return self::$instance ?: self::$instance = new self(); + } + + public function getExternalPath() : Path + { + return (new Path()) + ->move(-3.5, -3.5) + ->line(3.5, -3.5) + ->line(3.5, 3.5) + ->line(-3.5, 3.5) + ->close() + ->move(-2.5, -2.5) + ->line(-2.5, 2.5) + ->line(2.5, 2.5) + ->line(2.5, -2.5) + ->close() + ; + } + + public function getInternalPath() : Path + { + return (new Path()) + ->move(1.5, 0) + ->ellipticArc(1.5, 1.5, 0., false, true, 0., 1.5) + ->ellipticArc(1.5, 1.5, 0., false, true, -1.5, 0.) + ->ellipticArc(1.5, 1.5, 0., false, true, 0., -1.5) + ->ellipticArc(1.5, 1.5, 0., false, true, 1.5, 0.) + ->close() + ; + } +} diff --git a/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Eye/SquareEye.php b/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Eye/SquareEye.php new file mode 100644 index 0000000..a3892b4 --- /dev/null +++ b/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Eye/SquareEye.php @@ -0,0 +1,53 @@ +<?php +declare(strict_types = 1); + +namespace BaconQrCode\Renderer\Eye; + +use BaconQrCode\Renderer\Path\Path; + +/** + * Renders the eyes in their default square shape. + */ +final class SquareEye implements EyeInterface +{ + /** + * @var self|null + */ + private static $instance; + + private function __construct() + { + } + + public static function instance() : self + { + return self::$instance ?: self::$instance = new self(); + } + + public function getExternalPath() : Path + { + return (new Path()) + ->move(-3.5, -3.5) + ->line(3.5, -3.5) + ->line(3.5, 3.5) + ->line(-3.5, 3.5) + ->close() + ->move(-2.5, -2.5) + ->line(-2.5, 2.5) + ->line(2.5, 2.5) + ->line(2.5, -2.5) + ->close() + ; + } + + public function getInternalPath() : Path + { + return (new Path()) + ->move(-1.5, -1.5) + ->line(1.5, -1.5) + ->line(1.5, 1.5) + ->line(-1.5, 1.5) + ->close() + ; + } +} |
