Addresses the `alpha-blend` half of [crates-lurey-io/retroglyph#547][rg547]: three different
`/255` rounding conventions across this crate, `gem`, and `retroglyph`, one of which silently
truncated.
[rg547]: https://github.com/crates-lurey-io/retroglyph/issues/547
### Fixed
- **`U8x4Rgba::source_over` no longer truncates.** It used `(v + (v >> 8) + 1) >> 8`, which is
exactly `floor(v / 255)` for all 65026 reachable inputs, not the round-to-nearest its doc
comment claimed. Every channel was biased downward by up to a full LSB, so repeated
compositing drifted darker. It now rounds to nearest, once, from a widened intermediate.
**Output values change.**
- **`U8x4Rgba::source_over` was wrong for translucent destinations.** It assumed `dst.a == 255`
and produced incorrect colors otherwise. The general case now costs one division per channel;
the opaque-destination case still costs none.
- **`SourceOver` alpha is now correct for `f32` too.** 0.2.1 fixed `as * as + ab * (1 - as)` to
`as + ab * (1 - as)` for the `u8` path only; the `f32` path had the same bug.
- `Plus` saturates at `1.0` instead of returning out-of-range channels.
### Added
- `channel::Channel`: normalized channel arithmetic, implemented for `u8` and `f32`. Blend and
composite modes are generic over it, so the integer path is exact rather than a detour
through floats. Not sealed; a downstream `u16` or fixed-point channel gets every mode for
free.
- Eight more separable blend modes, completing the W3C set of twelve: `Normal`, `Multiply`,
`Darken`, `Lighten`, `HardLight`, `SoftLight`, `Difference`, `Exclusion`.
- `Composite`, pairing a `BlendMode` with a `CompositeMode`, and `Composite::composite`, which
returns a premultiplied result without the lossy unpremultiply that `apply` performs.
- `rgba::Premultiplied<T>`, with `PremultipliedU8x4Rgba` and `PremultipliedF32x4Rgba` aliases,
so a premultiplied pixel cannot be passed where a straight-alpha one is expected.
- `Rgba::<C>::lerp`, generic over the channel type. `U8x4Rgba` now has integer `lerp`, exact at
both endpoints.
- `F32x4Rgba::is_transparent` / `is_opaque`, matching the `u8` versions.
- `BlendMode::ALL` and `CompositeMode::ALL`.
- `U8x4Rgba::source_over` is now `const fn`.
- The example renders all 25 modes; the README shows them.
### Changed
- **Breaking**: `BlendMode` is renamed `CompositeMode`. The name `BlendMode` now refers to what
was `blend_modes::SeparableBlendMode`, matching the W3C spec and every comparable library.
There is no deprecated alias for the old `BlendMode`, because the name is now taken.
- **Breaking**: `RgbaBlend`'s `Channel` associated type becomes a type parameter,
`RgbaBlend<C: Channel>`. An associated type permits only one channel per implementor, which
is incompatible with a generic `Composite`.
- **Breaking**: `porter_duff::PorterDuff<C, F>` is removed. Its closure-per-coefficient design
is `f32`-only and cannot be made generic; `CompositeMode::coefficients` replaces it.
- **Breaking**: `Rgba::premultiply` returns `Premultiplied<Rgba<C>>` rather than `Rgba<C>`, and
`unpremultiply` moves onto `Premultiplied`. Both are now available for `u8`, not just `f32`.
- **Breaking**: `F32x4Rgba::lerp` is now `Rgba::<C>::lerp` and applies to both channel types.
- `BlendMode` and `CompositeMode` are `#[non_exhaustive]`, so future modes are a minor bump.
- `F32x4Rgba::clamp` is retained but no longer needed after `Plus`.
### Removed
- The internal `vec4` module, which existed only to serve `PorterDuff`, along with its
size-asserted transmutes.