PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 2.4.6
Booking for Appointments and Events Calendar – Amelia v2.4.6
2.4.7 2.4.6 2.4.5 2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / vendor / bacon / bacon-qr-code / src / Renderer / Image / ImageBackEndInterface.php
ameliabooking / vendor / bacon / bacon-qr-code / src / Renderer / Image Last commit date
EpsImageBackEnd.php 9 months ago ImageBackEndInterface.php 9 months ago ImagickImageBackEnd.php 9 months ago SvgImageBackEnd.php 9 months ago TransformationMatrix.php 9 months ago
ImageBackEndInterface.php
88 lines
1 <?php
2 declare(strict_types = 1);
3
4 namespace BaconQrCode\Renderer\Image;
5
6 use BaconQrCode\Exception\RuntimeException;
7 use BaconQrCode\Renderer\Color\ColorInterface;
8 use BaconQrCode\Renderer\Path\Path;
9 use BaconQrCode\Renderer\RendererStyle\Gradient;
10
11 /**
12 * Interface for back ends able to to produce path based images.
13 */
14 interface ImageBackEndInterface
15 {
16 /**
17 * Starts a new image.
18 *
19 * If a previous image was already started, previous data get erased.
20 */
21 public function new(int $size, ColorInterface $backgroundColor) : void;
22
23 /**
24 * Transforms all following drawing operation coordinates by scaling them by a given factor.
25 *
26 * @throws RuntimeException if no image was started yet.
27 */
28 public function scale(float $size) : void;
29
30 /**
31 * Transforms all following drawing operation coordinates by translating them by a given amount.
32 *
33 * @throws RuntimeException if no image was started yet.
34 */
35 public function translate(float $x, float $y) : void;
36
37 /**
38 * Transforms all following drawing operation coordinates by rotating them by a given amount.
39 *
40 * @throws RuntimeException if no image was started yet.
41 */
42 public function rotate(int $degrees) : void;
43
44 /**
45 * Pushes the current coordinate transformation onto a stack.
46 *
47 * @throws RuntimeException if no image was started yet.
48 */
49 public function push() : void;
50
51 /**
52 * Pops the last coordinate transformation from a stack.
53 *
54 * @throws RuntimeException if no image was started yet.
55 */
56 public function pop() : void;
57
58 /**
59 * Draws a path with a given color.
60 *
61 * @throws RuntimeException if no image was started yet.
62 */
63 public function drawPathWithColor(Path $path, ColorInterface $color) : void;
64
65 /**
66 * Draws a path with a given gradient which spans the box described by the position and size.
67 *
68 * @throws RuntimeException if no image was started yet.
69 */
70 public function drawPathWithGradient(
71 Path $path,
72 Gradient $gradient,
73 float $x,
74 float $y,
75 float $width,
76 float $height
77 ) : void;
78
79 /**
80 * Ends the image drawing operation and returns the resulting blob.
81 *
82 * This should reset the state of the back end and thus this method should only be callable once per image.
83 *
84 * @throws RuntimeException if no image was started yet.
85 */
86 public function done() : string;
87 }
88