blob: d9f943de7717761093e2da4b536d5bf885c32c1e [file] [log] [blame]
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#pragma once
#include <memory>
#include <vector>
#include "impeller/geometry/color.h"
#include "impeller/geometry/path.h"
#include "impeller/geometry/point.h"
namespace impeller {
// If texture_size is 0 then the gradient is invalid.
struct GradientData {
std::vector<uint8_t> color_bytes;
uint32_t texture_size;
};
/**
* @brief Populate a vector with the interpolated colors for the linear gradient
* described colors and stops.
*
* @param colors
* @param stops
* @return GradientData
*/
GradientData CreateGradientBuffer(const std::vector<Color>& colors,
const std::vector<Scalar>& stops);
} // namespace impeller