| Conditions | 4 |
| Paths | 4 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | public static function apply(Edge $edge) |
||
| 13 | { |
||
| 14 | if ($edge->horizontal) { |
||
| 15 | $comparedLuma = $edge->inward ? $edge->luma->north : $edge->luma->south; |
||
| 16 | } else { |
||
| 17 | $comparedLuma = $edge->inward ? $edge->luma->west : $edge->luma->east; |
||
| 18 | } |
||
| 19 | $edge->averageLuma = ($edge->luma->center + $comparedLuma) / 2; |
||
| 20 | $edge->gradient = abs($edge->luma->center - $comparedLuma); |
||
| 21 | $edge->threshold = $edge->gradient / 4; |
||
| 22 | } |
||
| 24 |