palette
palette copied to clipboard
Split out the `Scalar` from `Premultiply` to allow `PreAlpha<&T>` and more
Description
Create a separate trait (Premultiplied? Something more generic?) with only the Scalar type that both Premultiply and PreAlpha can depend on. This is breaking because it (re)moves an associated type and changes the requirements.
Motivation
Separating the operation of premultiplying from the requirements for being in PreAlpha allows us to construct PreAlpha<&T>, PreAlpha<&mut T>, PreAlpha<&mut [T]> and so on, without having to allow them to be alpha unmasked. This is useful for struct-of-arrays algorithms, among other things.