Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Phpdftk\Svg\Value; |
| 6 | |
| 7 | /** |
| 8 | * One function in an SVG 2 `transform` attribute (SVG 2 §8.4). Implementations |
| 9 | * are the closed set of SVG transform functions: `matrix`, `translate`, |
| 10 | * `rotate`, `scale`, `skewX`, `skewY`. Each knows how to reduce itself to a |
| 11 | * 3×2 affine matrix `[a, b, c, d, e, f]` representing |
| 12 | * |
| 13 | * | a c e | |
| 14 | * | b d f | |
| 15 | * | 0 0 1 | |
| 16 | * |
| 17 | * — the same convention used by PDF's `cm` operator and SVG's `matrix(…)` |
| 18 | * function, so the painter can pass values straight through without |
| 19 | * re-ordering. |
| 20 | */ |
| 21 | interface TransformFunction |
| 22 | { |
| 23 | /** |
| 24 | * Reduce this function to a single 3×2 affine matrix `[a, b, c, d, e, f]`. |
| 25 | * |
| 26 | * @return array{float, float, float, float, float, float} |
| 27 | */ |
| 28 | public function toMatrix(): array; |
| 29 | } |