original_string: public final function negate( bool $internal = false ) : GdImage
     {
  
        if ( ! $internal )
        {
           $clon = clone $this;
           return $clon->negate( true );
        }
  
        $w = $this->getWidth();
        $h = $this->getHeight();
  
        $im = \imagecreatetruecolor( $w, $h );
        for ( $y = 0; $y < $h; ++$y )
        {
           for ( $x = 0; $x < $w; $x++ )
           {
              $colors = \imagecolorsforindex(
                 $this->r,
                 \imagecolorat( $this->r, $x, $y )
              );
              $r = 255 - $colors[ 'red' ];
              $g = 255 - $colors[ 'green' ];
              $b = 255 - $colors[ 'blue' ];
              $newColor = \imagecolorallocate( $im, $r, $g, $b );
              \imagesetpixel( $im, $x, $y, $newColor );
           }
        }
        
        \imagedestroy( $this->r );
        $this->r = null;
        
        $this->r = $im;
        
        return $this;
        
     }
code: public final function negate( bool $internal = false ) : GdImage
     {
  
        if ( ! $internal )
        {
           $clon = clone $this;
           return $clon->negate( true );
        }
  
        $w = $this->getWidth();
        $h = $this->getHeight();
  
        $im = \imagecreatetruecolor( $w, $h );
        for ( $y = 0; $y < $h; ++$y )
        {
           for ( $x = 0; $x < $w; $x++ )
           {
              $colors = \imagecolorsforindex(
                 $this->r,
                 \imagecolorat( $this->r, $x, $y )
              );
              $r = 255 - $colors[ 'red' ];
              $g = 255 - $colors[ 'green' ];
              $b = 255 - $colors[ 'blue' ];
              $newColor = \imagecolorallocate( $im, $r, $g, $b );
              \imagesetpixel( $im, $x, $y, $newColor );
           }
        }
        
        \imagedestroy( $this->r );
        $this->r = null;
        
        $this->r = $im;
        
        return $this;
        
     }
code_tokens: public final function negate ( bool $ internal = false ) : GdImage { if ( ! $ internal ) { $ clon = clone $ this ; return $ clon -> negate ( true ) ; } $ w = $ this -> getWidth ( ) ; $ h = $ this -> getHeight ( ) ; $ im = \ imagecreatetruecolor ( $ w , $ h ) ; for ( $ y = 0 ; $ y < $ h ; ++ $ y ) { for ( $ x = 0 ; $ x < $ w ; $ x ++ ) { $ colors = \ imagecolorsforindex ( $ this -> r , \ imagecolorat ( $ this -> r , $ x , $ y ) ) ; $ r = 255 - $ colors [ 'red' ] ; $ g = 255 - $ colors [ 'green' ] ; $ b = 255 - $ colors [ 'blue' ] ; $ newColor = \ imagecolorallocate ( $ im , $ r , $ g , $ b ) ; \ imagesetpixel ( $ im , $ x , $ y , $ newColor ) ; } } \ imagedestroy ( $ this -> r ) ; $ this -> r = null ; $ this -> r = $ im ; return $ this ; }
docstring: Creates a negative of current image.
  
  @param  boolean $internal Do not create a new instance?
  @return \Beluga\Drawing\Image\GdImage
docstring_tokens: Creates a negative of current image .