Issue #1 resolved

Create a base class for procedual pens

Marcus von Appen
created an issue

A basic procedural pen could be implemented as following:

  • width and height property. Used for repeating procedure (like tiling effects)

  • procedure callable slot. Called upon every fill operation for each pixel on the mask to acquire the current color for that pixel.

The procedure callable could have something like the following signature:

//procfunc(curx, cury) -> Color//

Use cases:

if width <= 0 or height <= 0: curx, cury = real offset on the mask

else: curx, cury = relative offset to width, height (could be done using a simple modulo operation)

In the above case procedure callbacks could be any type implementing the call() method.

Comments (4)

  1. schlangen repo owner

    Is this enough or do we need more options like passing the current/old color to the procedure, specifying whether to set or blend returned rgb(a) colors, etc.?

  2. Log in to comment