|
aest 0.1.0
Collection of C++ utility libraries
|
Partition aest.colors:compositing: premultiplied alpha and Porter-Duff compositing. More...
Go to the source code of this file.
Classes | |
| class | aest::colors::Premultiplied< Space > |
| A color of a linear space with premultiplied alpha: each color channel is already multiplied by alpha. More... | |
| struct | aest::colors::ParentSpace< Premultiplied< Space > > |
| A premultiplied color converts through its straight-alpha space. More... | |
| struct | aest::colors::Converter< Premultiplied< Space >, Space > |
| Converts straight alpha to premultiplied alpha. More... | |
| struct | aest::colors::Converter< Space, Premultiplied< Space > > |
| Converts premultiplied alpha to straight alpha. More... | |
| struct | aest::colors::LinearSpaceOf< Premultiplied< Space > > |
| A premultiplied color follows its straight-alpha space. More... | |
Concepts | |
| concept | aest::colors::LinearSpace |
| A color space whose channels are proportional to light, so that adding and scaling them is physically meaningful. | |
Functions | |
| template<typename Space = void, ColorType Foreground, ColorType Background> requires LinearSpace<WorkingSpace<Space, Background>> && ConvertibleTo<Premultiplied<WorkingSpace<Space, Background>>, Foreground> && ConvertibleTo<Premultiplied<WorkingSpace<Space, Background>>, Background> && ConvertibleTo<Background, Premultiplied <WorkingSpace<Space, Background>>> | |
| constexpr Background | aest::colors::over (const Foreground &foreground, const Background &background, In< Space > space={}) |
| Composites a color over another: Porter-Duff source-over. | |
Partition aest.colors:compositing: premultiplied alpha and Porter-Duff compositing.
Definition in file Compositing.cppm.
|
constexprexport |
Composites a color over another: Porter-Duff source-over.
Both colors are converted to the premultiplied working space, where the result is foreground + background * (1 - foreground alpha), then converted to the type of background. Alpha combines the same way, so a half-transparent color over another gives alpha 0.75. By default the working space is the LinearSpaceOf Background, linear light in the background's gamut, so P3 colors composite without clipping to sRGB.
| Space | The linear color space the colors are composited in; void, the default, follows Background |
| Foreground | Color type of foreground |
| Background | Color type of background and of the result |
| [in] | foreground | The color on top |
| [in] | background | The color underneath |
| [in] | space | The working space, e.g. in<LinSRGB>; the LinearSpaceOf Background when omitted |
background. Definition at line 242 of file Compositing.cppm.