#include <cstdint>#include <vector>Go to the source code of this file.
Classes | |
| struct | pulp::canvas::GradientInterpolation |
Namespaces | |
| namespace | pulp |
| namespace | pulp::canvas |
Enumerations | |
| enum class | pulp::canvas::GradientColorSpace : std::uint8_t { pulp::canvas::srgb , pulp::canvas::srgb_linear , pulp::canvas::display_p3 , pulp::canvas::a98_rgb , pulp::canvas::prophoto_rgb , pulp::canvas::rec2020 , pulp::canvas::lab , pulp::canvas::oklab , pulp::canvas::hsl , pulp::canvas::hwb , pulp::canvas::lch , pulp::canvas::oklch } |
| Interpolation colour spaces a gradient can be painted in. More... | |
| enum class | pulp::canvas::GradientHueMethod : std::uint8_t { pulp::canvas::shorter , pulp::canvas::longer , pulp::canvas::increasing , pulp::canvas::decreasing } |
| Which way round the colour wheel a polar space travels between two hues. More... | |
Functions | |
| constexpr bool | pulp::canvas::is_polar (GradientColorSpace space) |
| True for the cylindrical spaces, which interpolate a hue angle. | |
| Color | pulp::canvas::interpolate_gradient_color (const Color &a, const Color &b, float t, GradientInterpolation method) |
| The sRGB colour t of the way from a to b when the two are blended in method's space, per CSS Color 4 ยง12: premultiplied by alpha, a powerless hue (an achromatic stop) takes the other stop's hue, and the result is clipped to the sRGB gamut, as Chrome clips it. | |
| void | pulp::canvas::resample_gradient_stops (const Color *colors, const float *positions, int count, GradientInterpolation method, int samples_per_segment, std::vector< Color > &out_colors, std::vector< float > &out_positions) |
| Expand a stop list into one whose plain sRGB blend follows method's curve: every segment between two stops gains samples_per_segment - 1 interior stops taken from interpolate_gradient_color(). | |