Adjusts the image contrast.

```php
$img = new bbn\file\image("/home/data/test/image.jpg");
$img->contrast("-");
$img->contrast();
```

@param string $val The value "+" (default), increases the contrast, the value ("-") reduces it.
@return image
327314
public function contrast($val='+')
	{
		if ( $this->test() )
		{
			if ( class_exists('\\Imagick') )
			{
				$p = ( $val == '-' ) ? 0 : 1;
				if ( !$this->img->contrastImage($p) ){
					$this->error = \defined('BBN_THERE_HAS_BEEN_A_PROBLEM') ?
						BBN_THERE_HAS_BEEN_A_PROBLEM : 'There has been a problem';
				}
			}
			else if ( function_exists('imagefilter') )
			{
				$p = ( $val == '-' ) ? -20 : 20;
				if ( !imagefilter($this->img,IMG_FILTER_CONTRAST,-20) ){
					$this->error = \defined('BBN_THERE_HAS_BEEN_A_PROBLEM') ?
						BBN_THERE_HAS_BEEN_A_PROBLEM : 'There has been a problem';
				}
			}
		}
		return $this;
	}
880852
public function apply( $image ) {
        $image->getCore()->blurImage(1 * $this->amount, 0.5 * $this->amount);
        return $image;
    }
588793
protected function Promote( $val )
	{
	    return $val instanceof DecimalProxy ? $val : new DecimalProxy( Convert::ToDecimal( $val, null ) );
	}
786768
protected function _image($val)
    {
        $DEBUGCSS = $this->_dompdf->getOptions()->getDebugCss();
        $parsed_url = "none";

        if (mb_strpos($val, "url") === false) {
            $path = "none"; //Don't resolve no image -> otherwise would prefix path and no longer recognize as none
        } else {
            $val = preg_replace("/url\(\s*['\"]?([^'\")]+)['\"]?\s*\)/", "\\1", trim($val));

            // Resolve the url now in the context of the current stylesheet
            $parsed_url = Helpers::explode_url($val);
            if ($parsed_url["protocol"] == "" && $this->get_protocol() == "") {
                if ($parsed_url["path"][0] === '/' || $parsed_url["path"][0] === '\\') {
                    $path = $_SERVER["DOCUMENT_ROOT"] . '/';
                } else {
                    $path = $this->get_base_path();
                }

                $path .= $parsed_url["path"] . $parsed_url["file"];
                $path = realpath($path);
                // If realpath returns FALSE then specifically state that there is no background image
                // FIXME: Is this causing problems for imported CSS files? There are some './none' references when running the test cases.
                if (!$path) {
                    $path = 'none';
                }
            } else {
                $path = Helpers::build_url($this->get_protocol(),
                    $this->get_host(),
                    $this->get_base_path(),
                    $val);
            }
        }

        if ($DEBUGCSS) {
            print "<pre>[_image\n";
            print_r($parsed_url);
            print $this->get_protocol() . "\n" . $this->get_base_path() . "\n" . $path . "\n";
            print "_image]</pre>";;
        }

        return $path;
    }
696553
protected function Eq( $val )
	{
		if  (! $val->getIsNumeric() ) return false;
		return  $this->ToInt( null ) == $val->ToInt( null );
	}
68810
public function setImageMaxHeight($v)
    {
        if ($v !== null) {
            $v = (double) $v;
        }

        if ($this->image_max_height !== $v) {
            $this->image_max_height = $v;
            $this->modifiedColumns[AttributeTypeTableMap::IMAGE_MAX_HEIGHT] = true;
        }


        return $this;
    }
215575
public function Sub( $val )
	{
		$value = $val instanceof DecimalValue ? $val : Convert::ToDecimal( $val );
		return new DecimalValue( bcsub( $this->_value, $value->getValue(), max( $this->getScale(), $this->scale( $value ) ) ) );
	}
926144
function addImage( &$img, $x, $y, $w = 0, $h = 0, $quality = 75 )
    {
        // add a new image into the current location, as an external object
        // add the image at $x,$y, and with width and height as defined by $w & $h

        // note that this will only work with full colour images and makes them jpg images for display
        // later versions could present lossless image formats if there is interest.

        // there seems to be some problem here in that images that have quality set above 75 do not appear
        // not too sure why this is, but in the meantime I have restricted this to 75.
        if ( $quality > 75 )
        {
            $quality = 75;
        }

        // if the width or height are set to zero, then set the other one based on keeping the image
        // height/width ratio the same, if they are both zero, then give up :)
        $imageWidth = imagesx( $img );
        $imageHeight = imagesy( $img );

        if ( $w <= 0 && $h <= 0 )
        {
            return;
        }
        if ( $w == 0 )
        {
            $w = $h / $imageHeight * $imageWidth;
        }
        if ( $h == 0 )
        {
            $h = $w * $imageHeight / $imageWidth;
        }

        // gotta get the data out of the img..

        // so I write to a temp file, and then read it back.. soo ugly, my apologies.
        $tmpDir = '/tmp';
        $tmpName = tempnam( $tmpDir, 'img' );
        imagejpeg( $img, $tmpName, $quality );

        $fp = fopen( $tmpName, 'rb' );
        if ( $fp )
        {
            $data = '';
            while ( !feof( $fp ) )
            {
                $data .= fread( $fp, 1024 );
            }
            fclose( $fp );
        }
        else
        {
            $error = 1;
            $errormsg = 'trouble opening file';
        }
        unlink( $tmpName );
        $this->addJpegImage_common( $data, $x, $y, $w, $h, $imageWidth, $imageHeight );
    }
270842
public function applyFilter(Image $image)
    {
        $image->fit($this->params["w"], $this->params["h"]);

        return $image;
    }
1286698
protected function Div($val)
	{
		$result = DecimalValue::FromValue( $this->_value )->Div( $val->getValue() );
		return new DecimalProxy( $result );
	}
935001
public function get($val)
    {
        // If we already have the code, just return that
        if (is_numeric($val)) {
            return $val;
        }

        if (array_key_exists($val, $this->colors)) {
            return $this->colors[$val];
        }

        return null;
    }
617449
public function apply($image)
    {
        for ($i=0; $i < $this->amount; $i++) {
            imagefilter($image->getCore(), IMG_FILTER_GAUSSIAN_BLUR);
        }
        return $image;
    }
306643
public function parseOne($val)
    {
        if ($this->allowHtml() === false) {
            if (is_string($val)) {
                return strip_tags($val);
            }
        }

        return $val;
    }
1245849
public function changeBrightness($newValue) {
		$newValue = max(-255, min(255, $newValue));
		imagefilter($this->resource, IMG_FILTER_BRIGHTNESS, $newValue);
		return $this;
	}
159208
public function run(Image $image)
    {
        $blur = $this->getBlur();

        if ($blur !== null) {
            $image->blur($blur);
        }

        return $image;
    }
958585
public function execute($image)
    {
        $color = $this->argument(0)->required()->value();
        $color = new Color($color);
        $x = $this->argument(1)->type('digit')->required()->value();
        $y = $this->argument(2)->type('digit')->required()->value();

        return imagesetpixel($image->getCore(), $x, $y, $color->getInt());
    }
1011187
protected function Mod( $val )
	{
		$val = $this->getOtherValue( $val );

		if ( is_infinite( $this->_value ) || is_nan( $this->_value ) || is_nan( $val ) || $val == 0 )
		{
			return new FloatProxy( NAN );
		}

		if ( is_infinite( $val ) )
		{
			return $this;
		}

		if ( is_infinite( $val ) )
		{
			return $val;
		}

		if ( $this->_value == 0 )
		{
			return $this;
		}

		$denominator = DecimalValue::FromFloat( $val );
		$result = DecimalValue::FromFloat( $this->_value )->Mod( $denominator );
		$result = $result->ToFloat( null );
		return new FloatProxy( $result );
	}