forked from contao/imagine-svg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
|
||
|
||
namespace Contao\ImagineSvg; | ||
|
||
|
||
use Imagine\Effects\EffectsInterface; | ||
use Imagine\Exception\RuntimeException; | ||
use Imagine\Image\Palette\Color\ColorInterface; | ||
|
||
class Effects implements EffectsInterface | ||
{ | ||
|
||
/** @var Image */ | ||
private $image; | ||
|
||
public function __construct(Image $image) | ||
{ | ||
$this->image = $image; | ||
} | ||
|
||
public function gamma($correction) | ||
{ | ||
throw new RuntimeException('This method is not implemented'); | ||
|
||
// TODO: Implement gamma() method. | ||
} | ||
|
||
public function negative() | ||
{ | ||
throw new RuntimeException('This method is not implemented'); | ||
// TODO: Implement negative() method. | ||
} | ||
|
||
public function grayscale() | ||
{ | ||
throw new RuntimeException('This method is not implemented'); | ||
// TODO: Implement grayscale() method. | ||
} | ||
|
||
public function colorize(ColorInterface $color) | ||
{ | ||
throw new RuntimeException('This method is not implemented'); | ||
// TODO: Implement colorize() method. | ||
} | ||
|
||
public function sharpen() | ||
{ | ||
throw new RuntimeException('This method is not implemented'); | ||
// TODO: Implement sharpen() method. | ||
} | ||
|
||
public function blur($sigma) | ||
{ | ||
|
||
$dom = $this->image->getDomDocument(); | ||
$dom->documentElement->setAttribute("filter", "url(#rokkaBlur)"); | ||
$filter = $dom->createDocumentFragment(); | ||
$filter->appendXML('<filter id="rokkaBlur"> | ||
<feGaussianBlur in="SourceGraphic" stdDeviation="'.$sigma.'" /> | ||
</filter>'); | ||
$dom->documentElement->insertBefore($filter, $dom->documentElement->firstChild); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters