/** * Extend the outline by one pixel. * * @param Pixel $pixel the next outline pixel * * @return self * */ public function push(Pixel $pixel) { $this->boundary->push($pixel); if (isset($this->outline[0]) && $this->outline[0]->position() == $pixel->position()) { $this->closed = true; return $this->clean(); } $this->size++; $this->outline[] = $pixel; return $this; }