@@ -91,7 +91,7 @@ int main(void)
9191  - [Out](#composite-out) 
9292  - [Atop](#composite-atop) 
9393  - [Xor](#composite-xor) 
94-   - [Arithmetic](#arithmetic-composite ) 
94+   - [Arithmetic](#arithmetic) 
9595
9696## Roadmap 
9797
@@ -276,3 +276,34 @@ Blends two surfaces using the specified blend mode. The source surface (`in1`) i
276276| <a id="blend-soft-light"></a>Soft Light   |  |  |   | 
277277| <a id="blend-difference"></a>Difference   |  |  |   | 
278278| <a id="blend-exclusion"></a>Exclusion     |  |  |    | 
279+ 
280+ ## Composite 
281+ 
282+ ```c 
283+ void plutofilter_composite(plutofilter_surface_t in1, plutofilter_surface_t in2, plutofilter_surface_t out, plutofilter_composite_operator_t op); 
284+ ``` 
285+ 
286+ Composites two surfaces using a Porter–Duff compositing operator. The source surface (`in1`) is composited over the backdrop (`in2`) using the specified operator. The result is written to `out`. 
287+ 
288+ | Operator | Input 1                           | Input 2                      | Output                        | 
289+ | -------- | --------------------------------- | ---------------------------- | ----------------------------- | 
290+ | <a id="composite-over"></a>Over |  |  |  | 
291+ | <a id="composite-in"></a>In     |  |  |  | 
292+ | <a id="composite-out"></a>Out   |  |  |  | 
293+ | <a id="composite-atop"></a>Atop |  |  |  | 
294+ | <a id="composite-xor"></a>Xor   |  |  |  | 
295+ 
296+ ### Arithmetic 
297+ 
298+ ```c 
299+ void plutofilter_composite_arithmetic(plutofilter_surface_t in1, plutofilter_surface_t in2, plutofilter_surface_t out, float k1, float k2, float k3, float k4); 
300+ ``` 
301+ 
302+ Blends two input surfaces using a flexible arithmetic combination of their color values. The output is based on the colors from both inputs, combined according to the four constants: `k1`, `k2`, `k3`, and `k4`. 
303+ 
304+ | Input 1 | Input 2 | k1 | k2 | k3 | k4  | Output | 
305+ |---------|---------|----|----|----|-----|--------| 
306+ |  |  | `0` | `1` | `0.5` | `0`    |  | 
307+ |  |  | `0` | `1` | `1`   | `0.5`  |  | 
308+ |  |  | `0` | `1` | `1`   | `0`    |  | 
309+ |  |  | `4` | `1` | `1`   | `-0.5` |  | 
0 commit comments