private function _add($count, $a, $r, $g, $b) 
    {
        if ($this->used < $this->pixelOffset) {
            $this->used = $this->pixelOffset;
            
            $this->samples[$this->pixelOffset * 5 + self::IDX_COUNT] = $count;
            $this->samples[$this->pixelOffset * 5 + self::IDX_A] = $a * $count;
            $this->samples[$this->pixelOffset * 5 + self::IDX_R] = $a * $r * $count;
            $this->samples[$this->pixelOffset * 5 + self::IDX_G] = $a * $g * $count;
            $this->samples[$this->pixelOffset * 5 + self::IDX_B] = $a * $b * $count;
        } else {
            $this->samples[$this->pixelOffset * 5 + self::IDX_COUNT] += $count;

            if ($a > 0) {
                $this->samples[$this->pixelOffset * 5 + self::IDX_A] += $a * $count;
                $this->samples[$this->pixelOffset * 5 + self::IDX_R] += $a * $r * $count;
                $this->samples[$this->pixelOffset * 5 + self::IDX_G] += $a * $g * $count;
                $this->samples[$this->pixelOffset * 5 + self::IDX_B] += $a * $b * $count;
            }
        }
    }
private function _add($count, $a, $r, $g, $b) 
    {
        if ($this->used < $this->pixelOffset) {
            $this->used = $this->pixelOffset;
            
            $this->samples[$this->pixelOffset * 5 + self::IDX_COUNT] = $count;
            $this->samples[$this->pixelOffset * 5 + self::IDX_A] = $a * $count;
            $this->samples[$this->pixelOffset * 5 + self::IDX_R] = $a * $r * $count;
            $this->samples[$this->pixelOffset * 5 + self::IDX_G] = $a * $g * $count;
            $this->samples[$this->pixelOffset * 5 + self::IDX_B] = $a * $b * $count;
        } else {
            $this->samples[$this->pixelOffset * 5 + self::IDX_COUNT] += $count;

            if ($a > 0) {
                $this->samples[$this->pixelOffset * 5 + self::IDX_A] += $a * $count;
                $this->samples[$this->pixelOffset * 5 + self::IDX_R] += $a * $r * $count;
                $this->samples[$this->pixelOffset * 5 + self::IDX_G] += $a * $g * $count;
                $this->samples[$this->pixelOffset * 5 + self::IDX_B] += $a * $b * $count;
            }
        }
    }
private function _add ( $ count , $ a , $ r , $ g , $ b ) { if ( $ this -> used < $ this -> pixelOffset ) { $ this -> used = $ this -> pixelOffset ; $ this -> samples [ $ this -> pixelOffset * 5 + self :: IDX_COUNT ] = $ count ; $ this -> samples [ $ this -> pixelOffset * 5 + self :: IDX_A ] = $ a * $ count ; $ this -> samples [ $ this -> pixelOffset * 5 + self :: IDX_R ] = $ a * $ r * $ count ; $ this -> samples [ $ this -> pixelOffset * 5 + self :: IDX_G ] = $ a * $ g * $ count ; $ this -> samples [ $ this -> pixelOffset * 5 + self :: IDX_B ] = $ a * $ b * $ count ; } else { $ this -> samples [ $ this -> pixelOffset * 5 + self :: IDX_COUNT ] += $ count ; if ( $ a > 0 ) { $ this -> samples [ $ this -> pixelOffset * 5 + self :: IDX_A ] += $ a * $ count ; $ this -> samples [ $ this -> pixelOffset * 5 + self :: IDX_R ] += $ a * $ r * $ count ; $ this -> samples [ $ this -> pixelOffset * 5 + self :: IDX_G ] += $ a * $ g * $ count ; $ this -> samples [ $ this -> pixelOffset * 5 + self :: IDX_B ] += $ a * $ b * $ count ; } } }
Adds a color to the current pixel in the buffer.

@param integer $count Number of samples of the color to be added to
the buffer.
Adds a color to the current pixel in the buffer .