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 #pragma once
6 
7 #include <memory>
8 #include <vector>
9 
11 #include "impeller/geometry/path.h"
13 
14 namespace impeller {
15 
16 // If texture_size is 0 then the gradient is invalid.
17 struct GradientData {
18  std::vector<uint8_t> color_bytes;
19  uint32_t texture_size;
20 };
21 
22 /**
23  * @brief Populate a vector with the interpolated color bytes for the linear
24  * gradient described by colors and stops.
25  *
26  * @param colors
27  * @param stops
28  * @return GradientData
29  */
30 GradientData CreateGradientBuffer(const std::vector<Color>& colors,
31  const std::vector<Scalar>& stops);
32 
33 } // namespace impeller
path.h
point.h
impeller::GradientData::texture_size
uint32_t texture_size
Definition: gradient.h:19
impeller::GradientData::color_bytes
std::vector< uint8_t > color_bytes
Definition: gradient.h:18
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:17
color.h
impeller
Definition: aiks_context.cc:10