Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
gradient.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_IMPELLER_GEOMETRY_GRADIENT_H_
6#define FLUTTER_IMPELLER_GEOMETRY_GRADIENT_H_
7
8#include <cstdint>
9#include <memory>
10#include <vector>
11
15
16namespace impeller {
17
18// If texture_size is 0 then the gradient is invalid.
20 std::vector<uint8_t> color_bytes;
21 uint32_t texture_size;
22};
23
24/**
25 * @brief Populate a vector with the interpolated color bytes for the linear
26 * gradient described by colors and stops.
27 *
28 * @param colors
29 * @param stops
30 * @return GradientData
31 */
32GradientData CreateGradientBuffer(const std::vector<Color>& colors,
33 const std::vector<Scalar>& stops);
34
35} // namespace impeller
36
37#endif // FLUTTER_IMPELLER_GEOMETRY_GRADIENT_H_
GradientData CreateGradientBuffer(const std::vector< Color > &colors, const std::vector< Scalar > &stops)
Populate a vector with the interpolated color bytes for the linear gradient described by colors and s...
Definition gradient.cc:20
std::vector< uint8_t > color_bytes
Definition gradient.h:20