Total Complexity | 1 |
Total Lines | 54 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
12 | class MaskPositionType |
||
13 | { |
||
14 | const MASK_POINT_FOREHEAD = 'forehead'; |
||
15 | const MASK_POINT_EYES = 'eyes'; |
||
16 | const MASK_POINT_MOUTH = 'mouth'; |
||
17 | const MASK_POINT_CHIN = 'chin'; |
||
18 | |||
19 | /** |
||
20 | * The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”. |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | public $point; |
||
25 | |||
26 | /** |
||
27 | * Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. |
||
28 | * For example, choosing -1.0 will place mask just to the left of the default mask position. |
||
29 | * |
||
30 | * @var float |
||
31 | */ |
||
32 | public $xShift; |
||
33 | |||
34 | /** |
||
35 | * Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. |
||
36 | * For example, 1.0 will place the mask just below the default mask position. |
||
37 | * |
||
38 | * @var float |
||
39 | */ |
||
40 | public $yShift; |
||
41 | |||
42 | /** |
||
43 | * Mask scaling coefficient. For example, 2.0 means double size. |
||
44 | * |
||
45 | * @var float |
||
46 | */ |
||
47 | public $scale; |
||
48 | |||
49 | /** |
||
50 | * @param string $point |
||
51 | * @param float $xShift |
||
52 | * @param float $yShift |
||
53 | * @param float $scale |
||
54 | * |
||
55 | * @return MaskPositionType |
||
56 | */ |
||
57 | public static function create(string $point, float $xShift, float $yShift, float $scale): MaskPositionType |
||
68 |