本文整理汇总了PHP中Intervention\Image\Image::gamma方法的典型用法代码示例。如果您正苦于以下问题:PHP Image::gamma方法的具体用法?PHP Image::gamma怎么用?PHP Image::gamma使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Intervention\Image\Image
的用法示例。
在下文中一共展示了Image::gamma方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* 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;
}
示例2: run
/**
* 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;
}
示例3: applyFilter
/**
* 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);
}
示例4: adjustment
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);
}
}
示例5: handle
/**
* 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']);
}
示例6: gamma
/**
* 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);
}