Flutter Impeller
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 
13 #include "impeller/geometry/path.h"
15 
16 namespace impeller {
17 
18 // If texture_size is 0 then the gradient is invalid.
19 struct GradientData {
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  */
32 GradientData CreateGradientBuffer(const std::vector<Color>& colors,
33  const std::vector<Scalar>& stops);
34 
35 } // namespace impeller
36 
37 #endif // FLUTTER_IMPELLER_GEOMETRY_GRADIENT_H_
path.h
point.h
impeller::GradientData::texture_size
uint32_t texture_size
Definition: gradient.h:21
impeller::GradientData::color_bytes
std::vector< uint8_t > color_bytes
Definition: gradient.h:20
impeller::CreateGradientBuffer
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
impeller::GradientData
Definition: gradient.h:19
color.h
impeller
Definition: aiks_blur_unittests.cc:20