protected function computeBucket(Color $_color) { if ($this->useGreyscale) { return ["grey" => (int) ($_color->getGrey() / $this->bucketQuantity)]; } return ["red" => (int) ($_color->getRed() / $this->bucketQuantity), "green" => (int) ($_color->getGreen() / $this->bucketQuantity), "blue" => (int) ($_color->getBlue() / $this->bucketQuantity)]; }
protected function compareColorPixels(Color $_a, Color $_b) { return (pow($_a->getRed() - $_b->getRed(), 2) + pow($_a->getGreen() - $_b->getGreen(), 2) + pow($_a->getBlue() - $_b->getBlue(), 2) + pow($_a->getAlpha() - $_b->getAlpha(), 2)) / 4; }
protected function compareColorPixels(Color $_a, Color $_b) { // jesli napotkalismy na rozne pixele - konczymy porownywanie obrazow $this->wasCompared = $_a->getRed() !== $_b->getRed() || $_a->getGreen() !== $_b->getGreen() || $_a->getBlue() !== $_b->getBlue() || $_a->getAlpha() !== $_b->getAlpha(); }
protected function compareColorPixels(Color $_a, Color $_b) { return ((int) ($_a->getRed() !== $_b->getRed()) + (int) ($_a->getGreen() !== $_b->getGreen()) + (int) ($_a->getBlue() !== $_b->getBlue()) + (int) ($_a->getAlpha() !== $_b->getAlpha())) / 4; }