Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m14s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m12s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m7s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m19s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m32s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m22s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 1m32s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m35s
CI / Build-Artefakte aktuell (pull_request) Failing after 1m7s
- Laravel 13 mit Filament 5 (Admin), Inertia 3 + Vue 3 + Vuetify 4 (Material 3) - Anmeldung über Fortify (Login, Passwort vergessen/ändern), keine Selbstregistrierung - Profil mit Profilbild (WebP in festen Größen), Personenseiten, Header mit Avatar-Menü - Material-3-Farbschema aus der Primärfarbe, hell/dunkel/System pro Person - Basis-Branding (Portalname, Logo, Primärfarbe) im Admin unter „Erscheinungsbild“ - Benutzerverwaltung im Admin, Zugang vorläufig über is_admin - vendor/ (ohne Dev-Pakete) und Frontend-Build mitversioniert, Dev-Pakete in vendor-dev/ - PHPUnit-Tests gegen MySQL/MariaDB, Forgejo-CI-Matrix, Docker-Entwicklungsumgebung - VERSION, CHANGELOG.md und CONTRIBUTING.md mit Release-Ablauf Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
205 lines
3.9 KiB
PHP
205 lines
3.9 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Intervention\Gif\Blocks;
|
|
|
|
use Intervention\Gif\AbstractEntity;
|
|
use Intervention\Gif\Exceptions\InvalidArgumentException;
|
|
|
|
class ImageDescriptor extends AbstractEntity
|
|
{
|
|
public const SEPARATOR = "\x2C";
|
|
|
|
/**
|
|
* Width of frame.
|
|
*/
|
|
protected int $width = 0;
|
|
|
|
/**
|
|
* Height of frame.
|
|
*/
|
|
protected int $height = 0;
|
|
|
|
/**
|
|
* Left position of frame.
|
|
*/
|
|
protected int $left = 0;
|
|
|
|
/**
|
|
* Top position of frame.
|
|
*/
|
|
protected int $top = 0;
|
|
|
|
/**
|
|
* Determine if frame is interlaced.
|
|
*/
|
|
protected bool $interlaced = false;
|
|
|
|
/**
|
|
* Local color table flag.
|
|
*/
|
|
protected bool $localColorTableExistance = false;
|
|
|
|
/**
|
|
* Sort flag of local color table.
|
|
*/
|
|
protected bool $localColorTableSorted = false;
|
|
|
|
/**
|
|
* Size of local color table.
|
|
*/
|
|
protected int $localColorTableSize = 0;
|
|
|
|
/**
|
|
* Get current width.
|
|
*/
|
|
public function width(): int
|
|
{
|
|
return $this->width;
|
|
}
|
|
|
|
/**
|
|
* Get current width.
|
|
*/
|
|
public function height(): int
|
|
{
|
|
return $this->height;
|
|
}
|
|
|
|
/**
|
|
* Get current Top.
|
|
*/
|
|
public function top(): int
|
|
{
|
|
return $this->top;
|
|
}
|
|
|
|
/**
|
|
* Get current Left.
|
|
*/
|
|
public function left(): int
|
|
{
|
|
return $this->left;
|
|
}
|
|
|
|
/**
|
|
* Set size of current instance.
|
|
*
|
|
* @throws InvalidArgumentException
|
|
*/
|
|
public function setSize(int $width, int $height): self
|
|
{
|
|
if ($width <= 0) {
|
|
throw new InvalidArgumentException('Width in ' . $this::class . ' must be larger than 0');
|
|
}
|
|
|
|
if ($height <= 0) {
|
|
throw new InvalidArgumentException('Height in ' . $this::class . ' must be larger than 0');
|
|
}
|
|
|
|
$this->width = $width;
|
|
$this->height = $height;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Set position of current instance.
|
|
*/
|
|
public function setPosition(int $left, int $top): self
|
|
{
|
|
$this->left = $left;
|
|
$this->top = $top;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Determine if frame is interlaced.
|
|
*/
|
|
public function isInterlaced(): bool
|
|
{
|
|
return $this->interlaced;
|
|
}
|
|
|
|
/**
|
|
* Set or unset interlaced value.
|
|
*/
|
|
public function setInterlaced(bool $value = true): self
|
|
{
|
|
$this->interlaced = $value;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Determine if local color table is present.
|
|
*/
|
|
public function localColorTableExistance(): bool
|
|
{
|
|
return $this->localColorTableExistance;
|
|
}
|
|
|
|
/**
|
|
* Alias for localColorTableExistance.
|
|
*/
|
|
public function hasLocalColorTable(): bool
|
|
{
|
|
return $this->localColorTableExistance();
|
|
}
|
|
|
|
/**
|
|
* Set local color table flag.
|
|
*/
|
|
public function setLocalColorTableExistance(bool $existance = true): self
|
|
{
|
|
$this->localColorTableExistance = $existance;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get local color table sorted flag.
|
|
*/
|
|
public function localColorTableSorted(): bool
|
|
{
|
|
return $this->localColorTableSorted;
|
|
}
|
|
|
|
/**
|
|
* Set local color table sorted flag.
|
|
*/
|
|
public function setLocalColorTableSorted(bool $sorted = true): self
|
|
{
|
|
$this->localColorTableSorted = $sorted;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get size of local color table.
|
|
*/
|
|
public function localColorTableSize(): int
|
|
{
|
|
return $this->localColorTableSize;
|
|
}
|
|
|
|
/**
|
|
* Get byte size of global color table.
|
|
*/
|
|
public function localColorTableByteSize(): int
|
|
{
|
|
return 3 * pow(2, $this->localColorTableSize() + 1);
|
|
}
|
|
|
|
/**
|
|
* Set size of local color table.
|
|
*/
|
|
public function setLocalColorTableSize(int $size): self
|
|
{
|
|
$this->localColorTableSize = $size;
|
|
|
|
return $this;
|
|
}
|
|
}
|