|
Haio 0.2.X
Homebrew Asset IO/CDN
|
Functions | |
| constexpr int | bayer (int side, int x, int y) |
| constexpr int | bayerSideFor (int levels) |
what the gpu containers need to agree on. these always spoke about colour rather than about files; the old single enum just made it look otherwise. ordered dithering, which is a threshold that depends on where a pixel is rather than on what its neighbours became.
it lives here and not in the palette code because the matrix is not about colour at all: the same thresholds order a gradient, pick which pixels of a mask survive a downscale, or break up a banded sky. a caller that needs one of those should not have to reach into a quantiser to find it.
|
constexpr |
the threshold at x,y of a side by side matrix, from 0 to side*side-1.
the matrix is defined by doubling: each step turns one cell into four, keeping the order top left, bottom right, top right, bottom left. that is why the side has to be a power of two, and why the same function answers for a four colour palette and a two hundred and fifty six colour one.
Definition at line 71 of file haio_util.hpp.

|
constexpr |
how wide a matrix has to be to hold that many levels, rounded up to a power of two
Definition at line 84 of file haio_util.hpp.
