-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathCommonTransformationInterface.php
More file actions
136 lines (122 loc) · 3.78 KB
/
CommonTransformationInterface.php
File metadata and controls
136 lines (122 loc) · 3.78 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?php
/**
* This file is part of the Cloudinary PHP package.
*
* (c) Cloudinary
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Cloudinary\Transformation;
use Cloudinary\Transformation\Qualifier\BaseQualifier;
/**
* Interface CommonTransformationInterface
*/
interface CommonTransformationInterface extends ComponentInterface
{
/**
* Forces format conversion to the given format.
*
* (Formerly known as fetch format).
*
* @param Format|string|null $format The format in which to deliver the asset.
*
*
* @see Format
*/
public function format(Format|string|null $format): static;
/**
* Controls compression quality.
*
* Reducing the quality is a trade-off between visual quality and file size.
*
* @param Quality|int|float|string|null $quality The quality value. (Range 1 to 100)
*
*/
public function quality(Quality|int|float|string|null $quality): static;
/**
* Applies a filter or an effect on an asset.
*
* @param EffectAction|EffectQualifier $effect The effect to apply.
*
*
* @see EffectAction
* @see EffectQualifier
*/
public function effect(EffectQualifier|EffectAction $effect): static;
/**
* Applies an adjustment effect on an asset.
*
* @param EffectAction|EffectQualifier $adjustment The adjustment effect to apply.
*
*
* @see EffectAction
* @see EffectQualifier
*/
public function adjust(EffectQualifier|EffectAction $adjustment): static;
/**
* Applies a pre-defined transformation of the given name.
*
* @param string $transformationName The name of the transformation.
*
*/
public function namedTransformation(string $transformationName): static;
/**
* Adds a generic qualifier as a separate action.
*
* @param string $shortName The generic qualifier name.
* @param array|mixed $value The generic qualifier value.
*
*/
public function addGenericQualifier(string $shortName, ...$value): static;
/**
* Adds (chains) a transformation action.
*
* @param BaseAction|BaseQualifier|mixed $action The transformation action to add.
* If BaseQualifier is provided, it is wrapped with action.
*
*/
public function addAction(mixed $action): static;
/**
* Adds (appends) a transformation.
*
* Appended transformation is nested.
*
* @param CommonTransformation $transformation The transformation to add.
*
*/
public function addTransformation(CommonTransformation $transformation): static;
/**
* Adds action defined as an array of qualifiers.
*
* @param array $qualifiers An associative array of qualifiers
*
*
* @see QualifiersAction
*/
public function addActionFromQualifiers(array $qualifiers): static;
/**
* Defines a new user variable.
*
* @param string $name The variable name
* @param mixed $value The variable value
*
*/
public function addVariable(string $name, mixed $value): static;
/**
* Rotates the asset by the given angle.
*
* @param int|string $angle The rotation angle.
*
*/
public function rotate(int|string $angle): static;
/**
* Specifies a conditional transformation whose condition should be met before applying a transformation.
*
* @param Conditional $conditionalTransformation The conditional transformation.
*
*
* @see https://cloudinary.com/documentation/conditional_transformations
*/
public function conditional(Conditional $conditionalTransformation): static;
}