public function __construct(\ImagickDemo\ImagickKernel\Control\usage $usageControl, VariableMap $variableMap) { $this->usageControl = $usageControl; $this->morphologyType = $variableMap->getVariable('morphologyType', \Imagick::MORPHOLOGY_EDGE_IN); parent::__construct($usageControl); $this->functionTable = [\Imagick::MORPHOLOGY_CONVOLVE => "renderConvolve", \Imagick::MORPHOLOGY_CORRELATE => "renderCorrelate", \Imagick::MORPHOLOGY_ERODE => "renderErode", \Imagick::MORPHOLOGY_DILATE => "renderDilate", \Imagick::MORPHOLOGY_ERODE_INTENSITY => "renderErodeIntensity", \Imagick::MORPHOLOGY_DILATE_INTENSITY => "renderDilateIntensity", \Imagick::MORPHOLOGY_DISTANCE => "renderDistance", \Imagick::MORPHOLOGY_DISTANCE . "Chebyshev" => "renderDistanceChebyshev", \Imagick::MORPHOLOGY_DISTANCE . "Manhattan" => "renderDistanceManhattan", \Imagick::MORPHOLOGY_DISTANCE . "Octagonal" => "renderDistanceOctagonal", \Imagick::MORPHOLOGY_DISTANCE . "Euclidian" => "renderDistanceEuclidian", \Imagick::MORPHOLOGY_ITERATIVE => "renderDistanceIterative", \Imagick::MORPHOLOGY_OPEN => "renderOpen", \Imagick::MORPHOLOGY_CLOSE => "renderClose", \Imagick::MORPHOLOGY_OPEN_INTENSITY => "renderOpenIntensity", \Imagick::MORPHOLOGY_CLOSE_INTENSITY => "renderCloseIntensity", \Imagick::MORPHOLOGY_SMOOTH => "renderSmooth", \Imagick::MORPHOLOGY_EDGE_IN => "renderEdgeIn", \Imagick::MORPHOLOGY_EDGE_OUT => "renderEdgeOut", \Imagick::MORPHOLOGY_EDGE => "renderEdge", \Imagick::MORPHOLOGY_TOP_HAT => "renderTopHat", \Imagick::MORPHOLOGY_BOTTOM_HAT => "renderBottomHat", \Imagick::MORPHOLOGY_HIT_AND_MISS => "renderHitAndMiss", \Imagick::MORPHOLOGY_THINNING => "renderThinning", \Imagick::MORPHOLOGY_THICKEN . "Standard" => "renderThicken", \Imagick::MORPHOLOGY_THICKEN . "Convex" => "renderThickenConvexHull"]; }
public function __construct(VariableMap $variableMap) { $elements = $this->colorMatrixSize; for ($i = 0; $i < $elements; $i++) { $name = 'colorMatrix_' . $i; $newValue = $variableMap->getVariable($name, $this->colorMatrix[$i]); $newValue = floatval($newValue); $this->colorMatrix[$i] = $newValue; } }
public function __construct(VariableMap $variableMap) { $this->h20 = $variableMap->getVariable(self::H20_NAME, $this->h20); $this->h20 = intval($this->h20); if ($this->h20 < 0) { $this->h20 = 0; } if ($this->h20 > 20) { $this->h20 = 20; } }
public function __construct(VariableMap $variableMap) { $this->key = $this->getDefault(); $newKey = $variableMap->getVariable($this->getVariableName(), $this->key); foreach ($this->getOptions() as $key => $value) { if (strcmp($newKey, $key) === 0) { $this->key = $key; $this->value = $value; break; } } }
function __construct(VariableMap $variableMap) { $value = $this->getDefault(); $newValue = $variableMap->getVariable($this->getVariableName(), $value); $options = $this->getOptions(); $needle = array_search($newValue, $options); if ($needle !== null) { $this->key = $needle; $this->value = $newValue; } if (array_key_exists($newValue, $options)) { $this->key = $newValue; $this->value = $options[$newValue]; } }
public function __construct(VariableMap $variableMap) { $value = $this->getDefault(); $nextColor = $variableMap->getVariable($this->getVariableName(), $value); try { new \ImagickPixel($nextColor); //This code is only reached if ImagePixel parses the color //and thinks it is valid $value = $nextColor; } catch (\Exception $e) { //$this->errors[] = "Color '$nextColor' for $colorType was not valid."; //TODO Add error message } $this->value = $value; //zendcode eats braces }
function __construct(VariableMap $variableMap) { $value = $this->getDefault(); if ($value !== false) { if ($this->getDefault() > $this->getMax()) { trigger_error("Default is bigger than max in " . get_class($this) . ", someone has dun goofed", E_USER_NOTICE); } if ($this->getDefault() < $this->getMin()) { trigger_error("Default is smaller than min in " . get_class($this) . ", someone has dun goofed", E_USER_NOTICE); } } $value = $variableMap->getVariable($this->getVariableName(), $value); if ($value !== false && strlen(trim($value) != 0)) { if ($value < $this->getMin()) { $value = $this->getMin(); } if ($value > $this->getMax()) { $value = $this->getMax(); } } $this->value = $this->filterValue($value); }
function __construct(CompositeExampleControl $compositeExampleControl, VariableMap $variableMap) { $this->compositeExampleControl = $compositeExampleControl; $this->type = $variableMap->getVariable('type', self::SOURCE_1); }
public function __construct(\ImagickDemo\Control $control, VariableMap $variableMap) { $this->control = $control; $this->firstLayer = $variableMap->getVariable('firstLayer', 0); }
public function __construct(VariableMap $variableMap) { $this->loadedFiles = $variableMap->getVariable('filesOnly', false); }
function createImageTask(VariableMap $variableMap, ImagickTaskQueue $taskQueue, PageInfo $pageInfo, Request $request, Response $response, $customImage, $params) { $job = $variableMap->getVariable('job', false); if ($job === false) { if ($taskQueue->isActive() == false) { //Queue isn't active - don't bother queueing a task return false; } $task = new \ImagickDemo\Queue\ImagickTask($pageInfo, $params, $customImage, $request->getPath()); $taskQueue->addTask($task); } if ($variableMap->getVariable('noredirect') == true) { return new \ImagickDemo\Response\ErrorResponse(503, "image still processing {$job} is " . $job); } $caching = new \Room11\Caching\LastModified\Disabled(); foreach ($caching->getHeaders(time()) as $key => $value) { $response->addHeader($key, $value); } $response->setStatus(420); return new TextBody("Image is generating."); }
function __construct(\ImagickDemo\Control $control, VariableMap $variableMap) { $this->control = $control; $this->deconstruct = $variableMap->getVariable('deconstruct', false); }
function __construct(\ImagickDemo\Control $control, VariableMap $variableMap) { $this->control = $control; $this->type = $variableMap->getVariable('type', 'simple'); }