palette icon indicating copy to clipboard operation
palette copied to clipboard

Split out the `Scalar` from `Premultiply` to allow `PreAlpha<&T>` and more

Open Ogeon opened this issue 2 years ago • 0 comments

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.

Ogeon avatar Apr 23 '23 15:04 Ogeon