Closed p0nce closed 2 years ago
Mmmm we can store that as flags into the Image, in order to stay self-contained: So it is 2 bits for extra "gap" pixels, 2 bits for multiplicity, and 3 for scanline alignment. The only flag combination that ensures to be gapless is 0.
Basically we can use whatever the decoder can already provide as automatic conversion (for example, stb_image can force to 1/2/3/4 channels and do 8-bit/10-bit conversion at the row level), and then support other flags with convertTo, which is itself trained to see cases that needs nothing to do.
What we cannot do for now is force "gapless" contraint.
ubyte[]
Basically works.
The LayoutOptions would be an optional struct, allowing to control sitting of the pixel data.
In Dplug, OwnedImage has different constraints that can be combined.
This wouldn't be kept after allocation.Cloning would not preserve those constraints....unless it is kept through a pointer?I don't think borders should be in.Image decoders should return an allocation made from a given LayoutOptions.
The need is that some image processing need to access by 4, on aligned boundaries. dplug:canvas also need 3 trailing bytes after each line.