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.
Description
Create a separate trait (
Premultiplied
? Something more generic?) with only theScalar
type that bothPremultiply
andPreAlpha
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 constructPreAlpha<&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.