public function emptyTo(& $colorData, $count) 
    {
        for ($i = 0; $i < $count; $i++) {
            $sampleCount = $this->samples[$i * 5 + self::IDX_COUNT];
            $a = $this->samples[$i * 5 + self::IDX_A];
            $color = $sampleCount == 0 || $a == 0 ? 0 :
                ColorUtils::from(
                    (int)($a / $sampleCount),
                    (int)($this->samples[$i * 5 + self::IDX_R] / $a),
                    (int)($this->samples[$i * 5 + self::IDX_G] / $a),
                    (int)($this->samples[$i * 5 + self::IDX_B] / $a)
                );
            
            $colorData[] = 1;
            $colorData[] = $color;
        }
        
        $this->pixelOffset = 0;
        $this->subPixelOffset = 0;
        $this->used = -1;
    }
public function emptyTo(& $colorData, $count) 
    {
        for ($i = 0; $i < $count; $i++) {
            $sampleCount = $this->samples[$i * 5 + self::IDX_COUNT];
            $a = $this->samples[$i * 5 + self::IDX_A];
            $color = $sampleCount == 0 || $a == 0 ? 0 :
                ColorUtils::from(
                    (int)($a / $sampleCount),
                    (int)($this->samples[$i * 5 + self::IDX_R] / $a),
                    (int)($this->samples[$i * 5 + self::IDX_G] / $a),
                    (int)($this->samples[$i * 5 + self::IDX_B] / $a)
                );
            
            $colorData[] = 1;
            $colorData[] = $color;
        }
        
        $this->pixelOffset = 0;
        $this->subPixelOffset = 0;
        $this->used = -1;
    }
public function emptyTo ( & $ colorData , $ count ) { for ( $ i = 0 ; $ i < $ count ; $ i ++ ) { $ sampleCount = $ this -> samples [ $ i * 5 + self :: IDX_COUNT ] ; $ a = $ this -> samples [ $ i * 5 + self :: IDX_A ] ; $ color = $ sampleCount == 0 || $ a == 0 ? 0 : ColorUtils :: from ( ( int ) ( $ a / $ sampleCount ) , ( int ) ( $ this -> samples [ $ i * 5 + self :: IDX_R ] / $ a ) , ( int ) ( $ this -> samples [ $ i * 5 + self :: IDX_G ] / $ a ) , ( int ) ( $ this -> samples [ $ i * 5 + self :: IDX_B ] / $ a ) ) ; $ colorData [ ] = 1 ; $ colorData [ ] = $ color ; } $ this -> pixelOffset = 0 ; $ this -> subPixelOffset = 0 ; $ this -> used = - 1 ; }
Writes the average color of each pixel to a specified color array.

@param array $colorData The average colors will be written to this
color array.
@param integer $count  Number of pixels to write.
Writes the average color of each pixel to a specified color array .