tiny-skia-cpp
A C++20 2D rendering library (port of tiny-skia)
Loading...
Searching...
No Matches
LinearGradient.h
Go to the documentation of this file.
1#pragma once
2
5
6#include <optional>
7#include <variant>
8#include <vector>
9
11
12namespace tiny_skia {
13
19 public:
22 static std::optional<std::variant<Color, LinearGradient>> create(Point start, Point end,
23 std::vector<GradientStop> stops,
24 SpreadMode mode,
25 Transform transform);
26
28 [[nodiscard]] bool isOpaque() const { return base_.colorsAreOpaque(); }
29
31 [[nodiscard]] bool pushStages(ColorSpace cs, pipeline::RasterPipelineBuilder& p) const;
32
34 Gradient base_;
35};
36
37} // namespace tiny_skia
ColorSpace
Colorspace for gamma-correct blending.
Definition Color.h:167
Base gradient data and gradient stop type.
Two-point linear gradient shader.
Definition LinearGradient.h:18
static std::optional< std::variant< Color, LinearGradient > > create(Point start, Point end, std::vector< GradientStop > stops, SpreadMode mode, Transform transform)
Creates a linear gradient between two points. Returns a Color if the gradient degenerates to a single...
2D affine transformation: [sx kx tx; ky sy ty; 0 0 1].
Definition Transform.h:17
2D point / vector with float components.
Definition Point.h:14