aseprite/src/render/gradient.h
David Capello 3c1ea2f407 Add/process dynamic data in/from stroke points (related to #710)
* Converted Stroke points from gfx::Point to Stroke::Pt
* Process gradient data to create shading betweens points or dithering
  with new doc::Brush patterns
2020-04-22 20:17:14 -03:00

68 lines
1.4 KiB
C++

// Aseprite Render Library
// Copyright (c) 2019-2020 Igara Studio S.A.
// Copyright (c) 2017 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef RENDER_GRADIENT_H_INCLUDED
#define RENDER_GRADIENT_H_INCLUDED
#pragma once
#include "doc/brush.h"
#include "doc/color.h"
#include "gfx/point.h"
namespace doc {
class Image;
}
namespace render {
class DitheringMatrix;
enum class GradientType {
Linear,
Radial,
};
void render_rgba_gradient(
doc::Image* img,
const gfx::Point imgPos,
const gfx::Point p0,
const gfx::Point p1,
doc::color_t c0,
doc::color_t c1,
const render::DitheringMatrix& matrix,
const GradientType type);
void render_rgba_linear_gradient(
doc::Image* img,
const gfx::Point imgPos,
const gfx::Point p0,
const gfx::Point p1,
doc::color_t c0,
doc::color_t c1,
const render::DitheringMatrix& matrix);
void render_rgba_radial_gradient(
doc::Image* img,
const gfx::Point imgPos,
const gfx::Point p0,
const gfx::Point p1,
doc::color_t c0,
doc::color_t c1,
const render::DitheringMatrix& matrix);
void convert_bitmap_brush_to_dithering_brush(
doc::Brush* brush,
const doc::PixelFormat pixelFormat,
const render::DitheringMatrix& matrix,
const float f,
const doc::color_t c0,
const doc::color_t c1);
} // namespace render
#endif