Improve the mosaic algorithm further #43
@ -220,6 +220,10 @@ class PhotoMosaic
|
|||||||
{
|
{
|
||||||
$score = $this->getScoreForRow($imageSelection, $requiredImageTypes);
|
$score = $this->getScoreForRow($imageSelection, $requiredImageTypes);
|
||||||
$fitnessScores[$layout] = [$score, $imageSelection];
|
$fitnessScores[$layout] = [$score, $imageSelection];
|
||||||
|
|
||||||
|
// Perfect score? Bail out early
|
||||||
|
if ($score === count($requiredImageTypes))
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user