Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3declare(strict_types=1);
4
5namespace Phpdftk\Raster\Filter;
6
7use Phpdftk\Raster\RasterSurface;
8
9/**
10 * One SVG / CSS filter primitive — `feGaussianBlur`, `feColorMatrix`,
11 * `feConvolveMatrix`, `feMorphology`, `feFlood`, `feImage`,
12 * `feTurbulence`, `feDisplacementMap`, `feSpecularLighting`,
13 * `feDiffuseLighting`, `feMerge`, `feTile`, `feOffset`,
14 * `feDropShadow`, `feComponentTransfer`, `feComposite`.
15 *
16 * Each primitive maps one or more input surfaces to one output
17 * surface. The CSS Filter Effects 1 + SVG 2 §15 spec defines the
18 * exact pixel math; Phase 4C.3 implements them one primitive at a
19 * time.
20 *
21 * The interface is stable from this scaffold so the translator
22 * can be written against it now and pick up real implementations
23 * as they land.
24 */
25interface FilterPrimitiveInterface
26{
27    /**
28     * Apply the primitive to `$input` and return a new surface.
29     * The input is not modified (primitives are pure functions of
30     * their inputs).
31     *
32     * Multi-input primitives (`feBlend`, `feComposite`, `feMerge`,
33     * `feDisplacementMap`) accept a list of surfaces in their
34     * declared input order via the implementation's constructor;
35     * the `apply` signature stays single-input so the type stays
36     * uniform across the filter chain.
37     */
38    public function apply(RasterSurface $input): RasterSurface;
39}