- Notifications
You must be signed in to change notification settings - Fork 531
Expand file tree
/
Copy pathInfo.php
More file actions
256 lines (223 loc) · 7.11 KB
/
Info.php
File metadata and controls
256 lines (223 loc) · 7.11 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<?php
namespace Imagine\Driver;
use Imagine\Image\Palette\PaletteInterface;
/**
* Provide information and features supported by a graphics driver.
*
* @since 1.3.0
*/
interface Info
{
/**
* Affected functions: Imagine\Image\ImageInterface::profile(), Imagine\Image\ImageInterface::usePalette().
*
* @var int
*/
const FEATURE_COLORPROFILES = 1;
/**
* Affected functions: Imagine\Image\ImageInterface::usePalette(), opening images with particular colorspaces.
*
* See also the requirePaletteSupport/isPaletteSupported driver info methods.
*
* @var int
*/
const FEATURE_COLORSPACECONVERSION = 2;
/**
* Affected functions: Imagine\Effects\EffectsInterface::grayscale().
*
* @var int
*/
const FEATURE_GRAYSCALEEFFECT = 3;
/**
* Affected functions: Imagine\Image\LayersInterface::coalesce().
*
* See also the FEATURE_MULTIPLELAYERS feature
*
* @var int
*/
const FEATURE_COALESCELAYERS = 4;
/**
* Affected functions: Imagine\Effects\EffectsInterface::negative().
*
* @var int
*/
const FEATURE_NEGATEIMAGE = 5;
/**
* Affected functions: Imagine\Effects\EffectsInterface::colorize().
*
* @var int
*/
const FEATURE_COLORIZEIMAGE = 6;
/**
* Affected functions: Imagine\Effects\EffectsInterface::sharpen().
*
* @var int
*/
const FEATURE_SHARPENIMAGE = 7;
/**
* Affected functions: Imagine\Effects\EffectsInterface::convolve().
*
* @var int
*/
const FEATURE_CONVOLVEIMAGE = 8;
/**
* Affected functions: Imagine\Draw\DrawerInterface::text() and Imagine\Image\FontInterface::box().
*
* @var int
*/
const FEATURE_TEXTFUNCTIONS = 9;
/**
* Affected functions: Imagine\Image\LayersInterface methods that would create more that 1 layer or 0 layers.
*
* @var int
*/
const FEATURE_MULTIPLELAYERS = 10;
/**
* Affected functions: none at the moment.
*
* @var int
*/
const FEATURE_CUSTOMRESOLUTION = 11;
/**
* Affected functions: Imagine\Image\ImageInterface::get(), Imagine\Image\ImageInterface::save(), Imagine\Image\ImageInterface::show().
*
* @var int
*/
const FEATURE_EXPORTWITHCUSTOMRESOLUTION = 12;
/**
* Affected functions: Imagine\Draw\DrawerInterface::chord() with $fill == true.
*
* @var int
*/
const FEATURE_DRAWFILLEDCHORDSCORRECTLY = 13;
/**
* Affected functions: Imagine\Draw\DrawerInterface::circle() with $fill == false and $thickness > 1.
*
* @var int
*/
const FEATURE_DRAWUNFILLEDCIRCLESWITHTICHKESSCORRECTLY = 14;
/**
* Affected functions: Imagine\Draw\DrawerInterface::ellipse() with $fill == false and $thickness > 1.
*
* @var int
*/
const FEATURE_DRAWUNFILLEDELLIPSESWITHTICHKESSCORRECTLY = 15;
/**
* Affected functions: Imagine\Image\ImageInterface::getColorAt() when the palette is CMYK.
*
* @var int
*/
const FEATURE_GETCMYKCOLORSCORRECTLY = 16;
/**
* Affected functions: any that uses colors with an alpha channel.
*
* @var int
*/
const FEATURE_TRANSPARENCY = 17;
/**
* Affected functions: Imagine\Image\ImageInterface::rotate(), Imagine\Filter\Basic\Rotate.
*
* @var int
*/
const FEATURE_ROTATEIMAGEWITHCORRECTSIZE = 18;
/**
* Affected functions: Imagine\Image\ImageInterface::get(), Imagine\Image\ImageInterface::save(), Imagine\Image\ImageInterface::show().
*
* @var int
*/
const FEATURE_EXPORTWITHCUSTOMJPEGSAMPLINGFACTORS = 19;
/**
* Adding frames to a image with no previously loaded layers works.
*
* @var int
*/
const FEATURE_ADDLAYERSTOEMPTYIMAGE = 20;
/**
* Affected functions: Imagine\Image\ImagineInterface::open(), Imagine\Image\ImagineInterface::load(), Imagine\Image\ImagineInterface::read().
*
* @var int
*/
const FEATURE_DETECTGRAYCOLORSPACE = 21;
/**
* Get the Info instance for a specific driver.
*
* @param bool $required when the driver is not available: if FALSE the function returns NULL, if TRUE the driver throws a \Imagine\Exception\NotSupportedException
*
* @throws \Imagine\Exception\NotSupportedException if $required is TRUE and the driver is not available
*
* @return static|null return NULL if the driver is not available and $required is FALSE
*/
public static function get($required = true);
/**
* Check if the current driver/engine version combination is supported.
*
* @throws \Imagine\Exception\NotSupportedException if the version combination is not supported
*/
public function checkVersionIsSupported();
/**
* Get the version of the driver.
* For example:
* - for GD: it's the version of PHP
* - for gmagick: it's the version of the gmagick PHP extension
* - for imagick: it's the version of the imagick PHP extension.
*
* @param bool $raw if false the result will be in the format <major>.<minor>.<patch>, if TRUE the result will be the raw version
*/
public function getDriverVersion($raw = false);
/**
* Get the version of the library used by the driver.
* For example:
* - for GD: it's the version of libgd
* - for gmagick: it's the version of the GraphicsMagick
* - for imagick: it's the version of the ImageMagick.
*
* @param bool $raw if false the result will be in the format <major>.<minor>.<patch>, if TRUE the result will be the raw version
*/
public function getEngineVersion($raw = false);
/**
* Check if the driver the features requested.
*
* @param int|int[] $features The features to be checked (see the Info::FEATURE_... constants)
*
* @return bool returns TRUE if the driver supports all the specified features, FALSE otherwise
*/
public function hasFeature($features);
/**
* Check if the driver has the features requested.
*
* @param int|int[] $features The features to be checked (see the Info::FEATURE_... constants)
*
* @throws \Imagine\Exception\NotSupportedException if any of the requested features is not supported
*/
public function requireFeature($features);
/**
* Get the list of supported file formats.
*
* @return \Imagine\Image\FormatList
*/
public function getSupportedFormats();
/**
* Check if a format is supported.
*
* @param \Imagine\Image\Format|string $format
*
* @return bool
*/
public function isFormatSupported($format);
/**
* Check if a palette is supported.
*
* @param \Imagine\Image\Palette\PaletteInterface $palette
*
* @throws \Imagine\Exception\NotSupportedException if the palette is not supported
*/
public function requirePaletteSupport(PaletteInterface $palette);
/**
* Check if a palette is supported.
*
* @param \Imagine\Image\Palette\PaletteInterface $palette
*
* @return bool
*/
public function isPaletteSupported(PaletteInterface $palette);
}