private static function medianCutApply($histo, $vBox)
{
if (!$vBox->count()) {
return;
}
// If the vbox occupies just one element in color space, it can't be split
if ($vBox->count() == 1) {
return array($vBox->copy());
}
// Select the longest axis for splitting
$cutColor = $vBox->longestAxis();
// Find the partial sum arrays along the selected axis.
list($total, $partialSum) = static::sumColors($cutColor, $histo, $vBox);
return static::doCut($cutColor, $vBox, $partialSum, $total);
}