| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | public function draw(): Image |
||
| 28 | { |
||
| 29 | /** @var \AhmadMayahi\Vision\Data\Face $face */ |
||
| 30 | foreach ($this->face->detect() as $face) { |
||
| 31 | $vertices = $face->bounds; |
||
| 32 | |||
| 33 | if (0 !== count($vertices)) { |
||
| 34 | $x1 = $vertices[0]->x; |
||
| 35 | $y1 = $vertices[0]->y; |
||
| 36 | |||
| 37 | $x2 = $vertices[2]->x; |
||
| 38 | $y2 = $vertices[2]->y; |
||
| 39 | |||
| 40 | $this->image->drawRectangle($x1, $y1, $x2, $y2, $this->borderColor); |
||
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 44 | return $this->image; |
||
| 45 | } |
||
| 47 |