forked from aseprite/aseprite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgradient.h
67 lines (55 loc) · 1.35 KB
/
gradient.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// 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