-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathSizeInterface.php
More file actions
114 lines (91 loc) Β· 2.49 KB
/
SizeInterface.php
File metadata and controls
114 lines (91 loc) Β· 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
declare(strict_types=1);
namespace Intervention\Image\Interfaces;
use Intervention\Image\Alignment;
use Traversable;
/**
* @extends Traversable<int>
*/
interface SizeInterface extends Traversable
{
/**
* Get width.
*/
public function width(): int;
/**
* Get height.
*/
public function height(): int;
/**
* Get pivot point.
*/
public function pivot(): PointInterface;
/**
* Set width.
*/
public function setWidth(int $width): self;
/**
* Set height.
*/
public function setHeight(int $height): self;
/**
* Set pivot point.
*/
public function setPivot(PointInterface $pivot): self;
/**
* Calculate aspect ratio of the current size.
*/
public function aspectRatio(): float;
/**
* Determine if current size fits within given size.
*/
public function fitsWithin(self $size): bool;
/**
* Determine if size is in landscape format.
*/
public function isLandscape(): bool;
/**
* Determine if size is in portrait format.
*/
public function isPortrait(): bool;
/**
* Move pivot to the given alignment position in the size and adjust the new position by given offset values.
*/
public function movePivot(string|Alignment $alignment, int $x = 0, int $y = 0): self;
/**
* Align pivot relative to given size at given alignment position.
*/
public function alignPivotTo(self $size, string|Alignment $alignment): self;
/**
* Calculate the relative position to another size based on the pivot point settings of both sizes.
*/
public function offsetTo(self $size): PointInterface;
/**
* @see Resizer::resize()
*/
public function resize(?int $width = null, ?int $height = null): self;
/**
* @see Resizer::resizeDown()
*/
public function resizeDown(?int $width = null, ?int $height = null): self;
/**
* @see Resizer::scale()
*/
public function scale(?int $width = null, ?int $height = null): self;
/**
* @see Resizer::scaleDown()
*/
public function scaleDown(?int $width = null, ?int $height = null): self;
/**
* @see Resizer::cover()
*/
public function cover(int $width, int $height): self;
/**
* @see Resizer::contain()
*/
public function contain(int $width, int $height): self;
/**
* @see Resizer::containDown()
*/
public function containDown(int $width, int $height): self;
}