/** * Perform gamma image manipulation. * @param Request $request The request object. * @param Image $image The source image. * @return Image The manipulated image. */ public function run(Request $request, Image $image) { $gamma = $this->getGamma($request->get('gam')); if ($gamma) { $image->gamma($gamma); } return $image; }
/** * Perform gamma image manipulation. * @param Image $image The source image. * @return Image The manipulated image. */ public function run(Image $image) { $gamma = $this->getGamma(); if ($gamma) { $image->gamma($gamma); } return $image; }
/** * Applies filter effects to the given image * * @param Image\Image $image The image to filter. * * @return Image\Image The filtered image. * * @throws FilterException if the image filter algorithm fails. */ public function applyFilter(Image\Image $image) { // The Intervention Image gamma method uses gamma backwards. A gamma > 1 // must result in darker images and a gamma < 1 will make the image // lighter. So we have to flip the value around. if ($this->correction > 0.0) { $correction = 1 / $this->correction; } else { $correction = 100.0; } return $image->gamma($correction); }
protected function adjustment() { if ($this->gamma) { $this->image->gamma($this->gamma); } if ($this->contrast) { $this->image->contrast($this->contrast); } if ($this->brightness) { $this->image->brightness($this->brightness); } if ($this->sharpen) { $this->image->sharpen($this->sharpen); } }
/** * Handle the image manipulation request * @param \Intervention\Image\Image $image * @param array $options * @return \Intervention\Image\Image */ public function handle($image, $options) { $options = array_merge($this->defaults, $options); return $image->gamma($options['correction']); }
/** * Applies gamma correction * * @param float $input * @param float $output * @return \Intervention\Image\Image * @static */ public static function gamma($input, $output) { return \Intervention\Image\Image::gamma($input, $output); }