ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
CropToRectangle.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24
30{
31 public $max_size;
32 public const FOREVER_ID = '0fca4b6cf274bd4aac78caef9494f6f19e67366118548d5556f89fda5f683826';
33
34 public function __construct(
35 protected bool $persist = false,
36 protected int $max_width = 512,
37 protected float $ratio = 16 / 9,
38 protected int $quality = 75
39 ) {
40 }
41
42 public function getId(): string
43 {
44 return self::FOREVER_ID;
45 }
46
47
48 public function getFlavourMachineId(): string
49 {
50 return MaxRectangleSizeMachine::ID;
51 }
52
53 public function getQuality(): int
54 {
55 return $this->quality;
56 }
57
58 public function getMaxWidth(): int
59 {
60 return $this->max_width;
61 }
62
63 public function getRatio(): float
64 {
65 return $this->ratio;
66 }
67
68 public function getInternalName(): string
69 {
70 return 'crop_to_rectangle';
71 }
72
73 public function getVariantName(): ?string
74 {
75 return $this->max_size . '_' . $this->ratio . '_' . $this->quality;
76 }
77
78 public function persist(): bool
79 {
80 return $this->persist;
81 }
82}
getFlavourMachineId()
Defines the ID of the machine that supports this definition.
getVariantName()
If a definition can be used in several variants (e.g.
persist()
Define whether the generated flavor and the respective streams should be persisted,...
getInternalName()
This defines the speaky internal name of the definition, as the consumer would like to use it,...
__construct(protected bool $persist=false, protected int $max_width=512, protected float $ratio=16/9, protected int $quality=75)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...