Applied fixes from StyleCI

This commit is contained in:
Sujit Prasad
2016-02-19 02:20:12 -05:00
committed by StyleCI Bot
parent be5df5334f
commit d637c2b23f
439 changed files with 19063 additions and 19210 deletions

View File

@@ -1,19 +1,18 @@
<?php
/**
* @package Demos
*/
class Demo_addNoise extends Demo
{
public $order = 9350;
/**
*/
class Demo_addNoise extends Demo
{
public $order = 9350;
function init()
{
$this->addField(new IntField('amount', 300));
$this->addField(new SelectField('type', array('salt&pepper','mono','color'), 'mono'));
}
function execute($image, $request)
{
return $image->addNoise($this->fields['amount']->value, $this->fields['type']->value);
}
}
public function init()
{
$this->addField(new IntField('amount', 300));
$this->addField(new SelectField('type', ['salt&pepper', 'mono', 'color'], 'mono'));
}
public function execute($image, $request)
{
return $image->addNoise($this->fields['amount']->value, $this->fields['type']->value);
}
}

View File

@@ -1,45 +1,44 @@
<?php
/**
* @package Demos
*/
class Demo_applyConvolution extends Demo
{
public $order = 2025;
protected $base_matrix = array(array(2, 0, 0), array(0, -1, 0), array(0, 0, -1));
function init()
{
$this->addField(new Field('matrix', '2 0 0, 0 -1 0, 0 0 -1', '3x3 float matrix; separate rows with a comma, and columns with a space'));
$this->addField(new FloatField('div', 1));
$this->addField(new FloatField('offset', 220));
}
function execute($image, $request)
{
$mstr = $this->fval('matrix');
$rows = explode(',', $mstr);
$matrix = array();
foreach ($this->base_matrix as $idx => $base_row)
{
$build_row = array();
if (isset($rows[$idx]))
{
$row = trim($rows[$idx]);
$cols = explode(' ', $row);
for ($c = 0; $c < 3; $c++)
if (isset($cols[$c]))
$build_row[] = floatval(trim($cols[$c]));
else
$build_row[] = $base_row[$c];
}
else
$build_row = $base_row;
$matrix[] = $build_row;
}
return $image->applyConvolution($matrix, $this->fval('div'), $this->fval('offset'));
}
}
/**
*/
class Demo_applyConvolution extends Demo
{
public $order = 2025;
protected $base_matrix = [[2, 0, 0], [0, -1, 0], [0, 0, -1]];
public function init()
{
$this->addField(new Field('matrix', '2 0 0, 0 -1 0, 0 0 -1', '3x3 float matrix; separate rows with a comma, and columns with a space'));
$this->addField(new FloatField('div', 1));
$this->addField(new FloatField('offset', 220));
}
public function execute($image, $request)
{
$mstr = $this->fval('matrix');
$rows = explode(',', $mstr);
$matrix = [];
foreach ($this->base_matrix as $idx => $base_row) {
$build_row = [];
if (isset($rows[$idx])) {
$row = trim($rows[$idx]);
$cols = explode(' ', $row);
for ($c = 0; $c < 3; $c++) {
if (isset($cols[$c])) {
$build_row[] = floatval(trim($cols[$c]));
} else {
$build_row[] = $base_row[$c];
}
}
} else {
$build_row = $base_row;
}
$matrix[] = $build_row;
}
return $image->applyConvolution($matrix, $this->fval('div'), $this->fval('offset'));
}
}

View File

@@ -1,39 +1,38 @@
<?php
/**
* @package Demos
*/
class Demo_applyFilter extends Demo
{
public $order = 2000;
/**
*/
class Demo_applyFilter extends Demo
{
public $order = 2000;
function init()
{
$this->addField(new SelectField('filter', array(
'IMG_FILTER_NEGATE',
'IMG_FILTER_GRAYSCALE',
'IMG_FILTER_BRIGHTNESS',
'IMG_FILTER_CONTRAST',
'IMG_FILTER_COLORIZE',
'IMG_FILTER_EDGEDETECT',
'IMG_FILTER_EMBOSS',
'IMG_FILTER_GAUSSIAN_BLUR',
'IMG_FILTER_SELECTIVE_BLUR',
'IMG_FILTER_MEAN_REMOVAL',
'IMG_FILTER_SMOOTH'
))
);
$this->addField(new IntField('arg1', null));
$this->addField(new IntField('arg2', null));
$this->addField(new IntField('arg3', null));
}
function execute($image)
{
$filter = constant($this->fields['filter']->value);
$arg1 = $this->fields['arg1']->value;
$arg2 = $this->fields['arg2']->value;
$arg3 = $this->fields['arg3']->value;
return $image->applyFilter($filter, $arg1, $arg2, $arg3);
}
}
public function init()
{
$this->addField(new SelectField('filter', [
'IMG_FILTER_NEGATE',
'IMG_FILTER_GRAYSCALE',
'IMG_FILTER_BRIGHTNESS',
'IMG_FILTER_CONTRAST',
'IMG_FILTER_COLORIZE',
'IMG_FILTER_EDGEDETECT',
'IMG_FILTER_EMBOSS',
'IMG_FILTER_GAUSSIAN_BLUR',
'IMG_FILTER_SELECTIVE_BLUR',
'IMG_FILTER_MEAN_REMOVAL',
'IMG_FILTER_SMOOTH',
])
);
$this->addField(new IntField('arg1', null));
$this->addField(new IntField('arg2', null));
$this->addField(new IntField('arg3', null));
}
public function execute($image)
{
$filter = constant($this->fields['filter']->value);
$arg1 = $this->fields['arg1']->value;
$arg2 = $this->fields['arg2']->value;
$arg3 = $this->fields['arg3']->value;
return $image->applyFilter($filter, $arg1, $arg2, $arg3);
}
}

View File

@@ -1,32 +1,32 @@
<?php
/**
* @package Demos
*/
class Demo_applyMask extends Demo
{
public $order = 600;
function init()
{
$this->addField(new FileSelectField('mask', 'masks'));
$this->addField(new CoordinateField('left', 10));
$this->addField(new CoordinateField('top', '30%'));
if (!$this->request->get('mask'))
$this->request->set('mask', 'mask-circle.gif');
}
function execute($image)
{
$mask = WideImage::load(DEMO_PATH . 'masks/' . $this->fields['mask']->value);
$left = $this->fields['left']->value;
$top = $this->fields['top']->value;
return $image->applyMask($mask, $left, $top);
}
function getFormat()
{
return 'png';
}
}
/**
*/
class Demo_applyMask extends Demo
{
public $order = 600;
public function init()
{
$this->addField(new FileSelectField('mask', 'masks'));
$this->addField(new CoordinateField('left', 10));
$this->addField(new CoordinateField('top', '30%'));
if (!$this->request->get('mask')) {
$this->request->set('mask', 'mask-circle.gif');
}
}
public function execute($image)
{
$mask = WideImage::load(DEMO_PATH.'masks/'.$this->fields['mask']->value);
$left = $this->fields['left']->value;
$top = $this->fields['top']->value;
return $image->applyMask($mask, $left, $top);
}
public function getFormat()
{
return 'png';
}
}

View File

@@ -1,13 +1,12 @@
<?php
/**
* @package Demos
*/
class Demo_asGrayscale extends Demo
{
public $order = 300;
function execute($img, $request)
{
return $img->asGrayscale();
}
}
/**
*/
class Demo_asGrayscale extends Demo
{
public $order = 300;
public function execute($img, $request)
{
return $img->asGrayscale();
}
}

View File

@@ -1,13 +1,12 @@
<?php
/**
* @package Demos
*/
class Demo_asNegative extends Demo
{
public $order = 300;
function execute($img, $request)
{
return $img->asNegative();
}
}
/**
*/
class Demo_asNegative extends Demo
{
public $order = 300;
public function execute($img, $request)
{
return $img->asNegative();
}
}

View File

@@ -1,26 +1,25 @@
<?php
/**
* @package Demos
*/
class Demo_autoCrop extends Demo
{
public $order = 1050;
function init()
{
$this->addField(new IntField('margin', 0));
$this->addField(new IntField('rgb_threshold', 0));
$this->addField(new IntField('pixel_cutoff', 1));
$this->addField(new IntField('base_color', null, 'Index of the color'));
}
function execute($image, $request)
{
$margin = $this->fields['margin']->value;
$rgb_threshold = $this->fields['rgb_threshold']->value;
$pixel_cutoff = $this->fields['pixel_cutoff']->value;
$base_color = $this->fields['base_color']->value;
return $image->autoCrop($margin, $rgb_threshold, $pixel_cutoff, $base_color);
}
}
/**
*/
class Demo_autoCrop extends Demo
{
public $order = 1050;
public function init()
{
$this->addField(new IntField('margin', 0));
$this->addField(new IntField('rgb_threshold', 0));
$this->addField(new IntField('pixel_cutoff', 1));
$this->addField(new IntField('base_color', null, 'Index of the color'));
}
public function execute($image, $request)
{
$margin = $this->fields['margin']->value;
$rgb_threshold = $this->fields['rgb_threshold']->value;
$pixel_cutoff = $this->fields['pixel_cutoff']->value;
$base_color = $this->fields['base_color']->value;
return $image->autoCrop($margin, $rgb_threshold, $pixel_cutoff, $base_color);
}
}

View File

@@ -1,19 +1,18 @@
<?php
/**
* @package Demos
*/
class Demo_correctGamma extends Demo
{
public $order = 2050;
function init()
{
$this->addField(new FloatField('in_gamma', 1.1));
$this->addField(new FloatField('out_gamma', 3.7));
}
function execute($image, $request)
{
return $image->correctGamma($this->fval('in_gamma'), $this->fval('out_gamma'));
}
}
/**
*/
class Demo_correctGamma extends Demo
{
public $order = 2050;
public function init()
{
$this->addField(new FloatField('in_gamma', 1.1));
$this->addField(new FloatField('out_gamma', 3.7));
}
public function execute($image, $request)
{
return $image->correctGamma($this->fval('in_gamma'), $this->fval('out_gamma'));
}
}

View File

@@ -1,26 +1,25 @@
<?php
/**
* @package Demos
*/
class Demo_crop extends Demo
{
public $order = 1000;
function init()
{
$this->addField(new CoordinateField('left', 10));
$this->addField(new CoordinateField('top', 20));
$this->addField(new CoordinateField('width', 120));
$this->addField(new CoordinateField('height', 60));
}
function execute($image, $request)
{
$left = $this->fields['left']->value;
$top = $this->fields['top']->value;
$width = $this->fields['width']->value;
$height = $this->fields['height']->value;
return $image->crop($left, $top, $width, $height);
}
}
/**
*/
class Demo_crop extends Demo
{
public $order = 1000;
public function init()
{
$this->addField(new CoordinateField('left', 10));
$this->addField(new CoordinateField('top', 20));
$this->addField(new CoordinateField('width', 120));
$this->addField(new CoordinateField('height', 60));
}
public function execute($image, $request)
{
$left = $this->fields['left']->value;
$top = $this->fields['top']->value;
$width = $this->fields['width']->value;
$height = $this->fields['height']->value;
return $image->crop($left, $top, $width, $height);
}
}

View File

@@ -1,13 +1,12 @@
<?php
/**
* @package Demos
*/
class Demo_flip extends Demo
{
public $order = 1200;
function execute($image, $request)
{
return $image->flip();
}
}
/**
*/
class Demo_flip extends Demo
{
public $order = 1200;
public function execute($image, $request)
{
return $image->flip();
}
}

View File

@@ -1,54 +1,53 @@
<?php
/**
* @package Demos
*/
class Demo_getCanvas extends Demo
{
public $order = 1300;
function init()
{
$this->addField(new Field('text', 'Hello world!'));
$this->addField(new CoordinateField('x', 'middle'));
$this->addField(new CoordinateField('y', 'bottom-5'));
$this->addField(new IntField('angle', 5));
$this->addField(new FileSelectField('font', 'fonts', array('show' => false, 'pattern' => '/(.*)\.ttf$/', 'default' => 'VeraSe.ttf')));
$this->addField(new IntField('size', 18));
}
function execute($image, $request)
{
$text = $this->fields['text']->value;
$x = $this->fields['x']->value;
$y = $this->fields['y']->value;
$angle = $this->fields['angle']->value;
$font = $this->fields['font']->value;
$font_size = $this->fields['size']->value;
$canvas = $image->getCanvas();
$canvas->filledRectangle(10, 10, 80, 40, $image->allocateColor(255, 127, 255));
$canvas->line(60, 80, 30, 100, $image->allocateColor(255, 0, 0));
$font_file = DEMO_PATH . 'fonts/' . $font;
$canvas->useFont($font_file, $font_size, $image->allocateColor(0, 0, 0));
$canvas->writeText("$x+1", "$y+1", $text, $angle);
$canvas->useFont($font_file, $font_size, $image->allocateColor(200, 220, 255));
$canvas->writeText($x, $y, $text, $angle);
return $image;
}
function et($name)
{
return htmlentities($this->fval($name));
}
function text()
{
echo "This demo executes:
/**
*/
class Demo_getCanvas extends Demo
{
public $order = 1300;
public function init()
{
$this->addField(new Field('text', 'Hello world!'));
$this->addField(new CoordinateField('x', 'middle'));
$this->addField(new CoordinateField('y', 'bottom-5'));
$this->addField(new IntField('angle', 5));
$this->addField(new FileSelectField('font', 'fonts', ['show' => false, 'pattern' => '/(.*)\.ttf$/', 'default' => 'VeraSe.ttf']));
$this->addField(new IntField('size', 18));
}
public function execute($image, $request)
{
$text = $this->fields['text']->value;
$x = $this->fields['x']->value;
$y = $this->fields['y']->value;
$angle = $this->fields['angle']->value;
$font = $this->fields['font']->value;
$font_size = $this->fields['size']->value;
$canvas = $image->getCanvas();
$canvas->filledRectangle(10, 10, 80, 40, $image->allocateColor(255, 127, 255));
$canvas->line(60, 80, 30, 100, $image->allocateColor(255, 0, 0));
$font_file = DEMO_PATH.'fonts/'.$font;
$canvas->useFont($font_file, $font_size, $image->allocateColor(0, 0, 0));
$canvas->writeText("$x+1", "$y+1", $text, $angle);
$canvas->useFont($font_file, $font_size, $image->allocateColor(200, 220, 255));
$canvas->writeText($x, $y, $text, $angle);
return $image;
}
public function et($name)
{
return htmlentities($this->fval($name));
}
public function text()
{
echo "This demo executes:
<pre>
\$canvas->filledRectangle(10, 10, 80, 40, \$img->allocateColor(255, 127, 255));
\$canvas->line(60, 80, 30, 100, \$img->allocateColor(255, 0, 0));
@@ -59,5 +58,5 @@
\$canvas->useFont('{$this->et('font')}', '{$this->et('size')}', \$image->allocateColor(200, 220, 255));
\$canvas->writeText('{$this->et('x')}', '{$this->et('y')}', '{$this->et('text')}', {$this->et('angle')});
</pre>";
}
}
}
}

View File

@@ -1,28 +1,29 @@
<?php
/**
* @package Demos
*/
class Demo_getChannels extends Demo
{
public $order = 500;
protected $channels = array('red', 'green', 'blue', 'alpha');
function init()
{
$this->addField(new CheckboxField('red', true));
$this->addField(new CheckboxField('green', false));
$this->addField(new CheckboxField('blue', true));
$this->addField(new CheckboxField('alpha', false));
}
function execute($img, $request)
{
$on = array();
foreach ($this->channels as $name)
if ($this->fields[$name]->value)
$on[] = $name;
return $img->getChannels($on);
}
}
/**
*/
class Demo_getChannels extends Demo
{
public $order = 500;
protected $channels = ['red', 'green', 'blue', 'alpha'];
public function init()
{
$this->addField(new CheckboxField('red', true));
$this->addField(new CheckboxField('green', false));
$this->addField(new CheckboxField('blue', true));
$this->addField(new CheckboxField('alpha', false));
}
public function execute($img, $request)
{
$on = [];
foreach ($this->channels as $name) {
if ($this->fields[$name]->value) {
$on[] = $name;
}
}
return $img->getChannels($on);
}
}

View File

@@ -1,13 +1,12 @@
<?php
/**
* @package Demos
*/
class Demo_getMask extends Demo
{
public $order = 550;
function execute($img, $request)
{
return $img->getMask();
}
}
/**
*/
class Demo_getMask extends Demo
{
public $order = 550;
public function execute($img, $request)
{
return $img->getMask();
}
}

View File

@@ -1,31 +1,30 @@
<?php
/**
* @package Demos
*/
class Demo_merge extends Demo
{
public $order = 800;
function init()
{
$this->addField(new FileSelectField('overlay', 'images', array('default' => '6-logo.gif')));
$this->addField(new CoordinateField('left', 'right-10'));
$this->addField(new CoordinateField('top', 'bottom-15%'));
$this->addField(new IntField('opacity', 50));
}
function execute($image, $request)
{
$overlay = WideImage::load(DEMO_PATH . 'images/' . $this->fields['overlay']->value);
$left = $this->fields['left']->value;
$top = $this->fields['top']->value;
$opacity = $this->fields['opacity']->value;
return $image->merge($overlay, $left, $top, $opacity);
}
function text()
{
echo "For alpha images, set opacity=100, otherwise alpha channel won't work.";
}
}
/**
*/
class Demo_merge extends Demo
{
public $order = 800;
public function init()
{
$this->addField(new FileSelectField('overlay', 'images', ['default' => '6-logo.gif']));
$this->addField(new CoordinateField('left', 'right-10'));
$this->addField(new CoordinateField('top', 'bottom-15%'));
$this->addField(new IntField('opacity', 50));
}
public function execute($image, $request)
{
$overlay = WideImage::load(DEMO_PATH.'images/'.$this->fields['overlay']->value);
$left = $this->fields['left']->value;
$top = $this->fields['top']->value;
$opacity = $this->fields['opacity']->value;
return $image->merge($overlay, $left, $top, $opacity);
}
public function text()
{
echo "For alpha images, set opacity=100, otherwise alpha channel won't work.";
}
}

View File

@@ -1,13 +1,12 @@
<?php
/**
* @package Demos
*/
class Demo_mirror extends Demo
{
public $order = 1150;
function execute($image, $request)
{
return $image->mirror();
}
}
/**
*/
class Demo_mirror extends Demo
{
public $order = 1150;
public function execute($image, $request)
{
return $image->mirror();
}
}

View File

@@ -1,26 +1,25 @@
<?php
/**
* @package Demos
*/
class Demo_resize extends Demo
{
public $order = 900;
function init()
{
$this->addField(new CoordinateField('width', 120));
$this->addField(new CoordinateField('height', null));
$this->addField(new SelectField('fit', array('inside', 'fill', 'outside')));
$this->addField(new SelectField('scale', array('any', 'down', 'up')));
}
function execute($image, $request)
{
$width = $this->fields['width']->value;
$height = $this->fields['height']->value;
$fit = $this->fields['fit']->value;
$scale = $this->fields['scale']->value;
return $image->resize($width, $height, $fit, $scale);
}
}
/**
*/
class Demo_resize extends Demo
{
public $order = 900;
public function init()
{
$this->addField(new CoordinateField('width', 120));
$this->addField(new CoordinateField('height', null));
$this->addField(new SelectField('fit', ['inside', 'fill', 'outside']));
$this->addField(new SelectField('scale', ['any', 'down', 'up']));
}
public function execute($image, $request)
{
$width = $this->fields['width']->value;
$height = $this->fields['height']->value;
$fit = $this->fields['fit']->value;
$scale = $this->fields['scale']->value;
return $image->resize($width, $height, $fit, $scale);
}
}

View File

@@ -1,32 +1,31 @@
<?php
/**
* @package Demos
*/
class Demo_resizeCanvas extends Demo
{
public $order = 910;
function init()
{
$this->addField(new CoordinateField('width', '100%+30'));
$this->addField(new CoordinateField('height', 200));
$this->addField(new CoordinateField('left', '2'));
$this->addField(new CoordinateField('top', 'bottom-10'));
$this->addField(new ColorField('color', 'ffffff'));
$this->addField(new SelectField('scale', array('any', 'down', 'up'), 'any'));
$this->addField(new CheckboxField('merge', false, "Merge or copy over"));
}
function execute($image, $request)
{
$width = $this->fields['width']->value;
$height = $this->fields['height']->value;
$left = $this->fields['left']->value;
$top = $this->fields['top']->value;
$color = $this->fields['color']->value;
$scale = $this->fields['scale']->value;
$merge = $this->fields['merge']->value;
return $image->resizeCanvas($width, $height, $left, $top, $color ? hexdec($color) : null, $scale, $merge);
}
}
/**
*/
class Demo_resizeCanvas extends Demo
{
public $order = 910;
public function init()
{
$this->addField(new CoordinateField('width', '100%+30'));
$this->addField(new CoordinateField('height', 200));
$this->addField(new CoordinateField('left', '2'));
$this->addField(new CoordinateField('top', 'bottom-10'));
$this->addField(new ColorField('color', 'ffffff'));
$this->addField(new SelectField('scale', ['any', 'down', 'up'], 'any'));
$this->addField(new CheckboxField('merge', false, 'Merge or copy over'));
}
public function execute($image, $request)
{
$width = $this->fields['width']->value;
$height = $this->fields['height']->value;
$left = $this->fields['left']->value;
$top = $this->fields['top']->value;
$color = $this->fields['color']->value;
$scale = $this->fields['scale']->value;
$merge = $this->fields['merge']->value;
return $image->resizeCanvas($width, $height, $left, $top, $color ? hexdec($color) : null, $scale, $merge);
}
}

View File

@@ -1,22 +1,21 @@
<?php
/**
* @package Demos
*/
class Demo_rotate extends Demo
{
public $order = 1100;
/**
*/
class Demo_rotate extends Demo
{
public $order = 1100;
function init()
{
$this->addField(new AngleField('angle', 25));
$this->addField(new ColorField('color', ''));
}
function execute($image, $request)
{
$angle = $this->fields['angle']->value;
$color = $this->fields['color']->value;
return $image->rotate($angle, $color ? hexdec($color) : null);
}
}
public function init()
{
$this->addField(new AngleField('angle', 25));
$this->addField(new ColorField('color', ''));
}
public function execute($image, $request)
{
$angle = $this->fields['angle']->value;
$color = $this->fields['color']->value;
return $image->rotate($angle, $color ? hexdec($color) : null);
}
}

View File

@@ -1,42 +1,45 @@
<?php
/**
* @package Demos
*/
class Demo_roundCorners extends Demo
{
public $order = 1075;
function init()
{
$this->addField(new IntField('radius', 30));
$this->addField(new ColorField('color', 'ffffff'));
$this->addField(new IntField('smoothness', 2));
$this->addField(new CheckboxField('top-left', true));
$this->addField(new CheckboxField('top-right', true));
$this->addField(new CheckboxField('bottom-right', true));
$this->addField(new CheckboxField('bottom-left', true));
}
function execute($image, $request)
{
$color = $this->fields['color']->value;
$radius = $this->fields['radius']->value;
$smoothness = $this->fields['smoothness']->value;
$corners = 0;
if ($this->fval('top-left'))
$corners += WideImage::SIDE_TOP_LEFT;
if ($this->fval('top-right'))
$corners += WideImage::SIDE_TOP_RIGHT;
if ($this->fval('bottom-right'))
$corners += WideImage::SIDE_BOTTOM_RIGHT;
if ($this->fval('bottom-left'))
$corners += WideImage::SIDE_BOTTOM_LEFT;
return $image->roundCorners($radius, $color ? hexdec($color) : null, $smoothness, $corners);
}
}
/**
*/
class Demo_roundCorners extends Demo
{
public $order = 1075;
public function init()
{
$this->addField(new IntField('radius', 30));
$this->addField(new ColorField('color', 'ffffff'));
$this->addField(new IntField('smoothness', 2));
$this->addField(new CheckboxField('top-left', true));
$this->addField(new CheckboxField('top-right', true));
$this->addField(new CheckboxField('bottom-right', true));
$this->addField(new CheckboxField('bottom-left', true));
}
public function execute($image, $request)
{
$color = $this->fields['color']->value;
$radius = $this->fields['radius']->value;
$smoothness = $this->fields['smoothness']->value;
$corners = 0;
if ($this->fval('top-left')) {
$corners += WideImage::SIDE_TOP_LEFT;
}
if ($this->fval('top-right')) {
$corners += WideImage::SIDE_TOP_RIGHT;
}
if ($this->fval('bottom-right')) {
$corners += WideImage::SIDE_BOTTOM_RIGHT;
}
if ($this->fval('bottom-left')) {
$corners += WideImage::SIDE_BOTTOM_LEFT;
}
return $image->roundCorners($radius, $color ? hexdec($color) : null, $smoothness, $corners);
}
}

View File

@@ -1,20 +1,19 @@
<?php
/**
* @package Demos
*/
class Demo_unsharp extends Demo
{
public $order = 1350;
/**
*/
class Demo_unsharp extends Demo
{
public $order = 1350;
function init()
{
$this->addField(new IntField('amount', 300));
$this->addField(new IntField('radius', 3));
$this->addField(new IntField('threshold', 2));
}
function execute($image, $request)
{
return $image->unsharp($this->fields['amount']->value, $this->fields['radius']->value, $this->fields['threshold']->value);
}
}
public function init()
{
$this->addField(new IntField('amount', 300));
$this->addField(new IntField('radius', 3));
$this->addField(new IntField('threshold', 2));
}
public function execute($image, $request)
{
return $image->unsharp($this->fields['amount']->value, $this->fields['radius']->value, $this->fields['threshold']->value);
}
}