2017-06-09 20:18:28 +00:00
|
|
|
// Aseprite Render Library
|
2020-04-22 23:17:14 +00:00
|
|
|
// Copyright (c) 2019-2020 Igara Studio S.A.
|
2017-06-09 20:18:28 +00:00
|
|
|
// 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
|
|
|
|
|
2020-04-22 23:17:14 +00:00
|
|
|
#include "doc/brush.h"
|
2017-06-09 20:18:28 +00:00
|
|
|
#include "doc/color.h"
|
|
|
|
#include "gfx/point.h"
|
|
|
|
|
|
|
|
namespace doc {
|
|
|
|
class Image;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace render {
|
|
|
|
|
|
|
|
class DitheringMatrix;
|
|
|
|
|
2019-03-19 23:54:25 +00:00
|
|
|
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);
|
|
|
|
|
2017-06-09 20:18:28 +00:00
|
|
|
void render_rgba_linear_gradient(
|
|
|
|
doc::Image* img,
|
2017-11-10 15:19:44 +00:00
|
|
|
const gfx::Point imgPos,
|
2017-06-09 20:18:28 +00:00
|
|
|
const gfx::Point p0,
|
|
|
|
const gfx::Point p1,
|
|
|
|
doc::color_t c0,
|
|
|
|
doc::color_t c1,
|
|
|
|
const render::DitheringMatrix& matrix);
|
|
|
|
|
2019-03-19 23:54:25 +00:00
|
|
|
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);
|
|
|
|
|
2020-04-22 23:17:14 +00:00
|
|
|
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);
|
|
|
|
|
2017-06-09 20:18:28 +00:00
|
|
|
} // namespace render
|
|
|
|
|
|
|
|
#endif
|