Gradient class.
Nothing here is a public API, it's only internal to dplug:canvas.
A gradient owns:
- a list of colours and positions (known as stops) along a single dimension from 0 to 1. The colors are a 32-bit RGBA quadruplet.
- a look-up table of colors (LUT) indexed by blitters.
It has a lookup table for the rasterizer, built lazily (was originally always 256 samples).
FUTURE: size of look-up is dynamically choosen
Add a color stop.
Get look-up length. This is invalidated in cases the color stops are redone with .reset or .addStop.
Reset things, have zero color stop. Invalidate look-up.
See Implementation
Gradient class.
Nothing here is a public API, it's only internal to dplug:canvas.
A gradient owns:
- a list of colours and positions (known as stops) along a single dimension from 0 to 1. The colors are a 32-bit RGBA quadruplet.
- a look-up table of colors (LUT) indexed by blitters.
It has a lookup table for the rasterizer, built lazily (was originally always 256 samples).
FUTURE: size of look-up is dynamically choosen