forked from aseprite/aseprite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
blend_funcs.h
73 lines (63 loc) · 4.1 KB
/
blend_funcs.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
68
69
70
71
72
73
// Aseprite Document Library
// Copyright (C) 2019 Igara Studio S.A.
// Copyright (c) 2001-2017 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef DOC_BLEND_FUNCS_H_INCLUDED
#define DOC_BLEND_FUNCS_H_INCLUDED
#pragma once
#include "doc/blend_mode.h"
#include "doc/color.h"
namespace doc {
typedef color_t (*BlendFunc)(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_src(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_merge(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_neg_bw(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_red_tint(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_blue_tint(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_normal(color_t backdrop, color_t src, int opacity = 255);
color_t rgba_blender_normal_dst_over(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_multiply(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_screen(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_overlay(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_darken(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_lighten(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_color_dodge(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_color_burn(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_hard_light(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_soft_light(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_difference(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_exclusion(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_hsl_hue(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_hsl_saturation(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_hsl_color(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_hsl_luminosity(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_addition(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_subtract(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_divide(color_t backdrop, color_t src, int opacity);
color_t graya_blender_src(color_t backdrop, color_t src, int opacity);
color_t graya_blender_merge(color_t backdrop, color_t src, int opacity);
color_t graya_blender_neg_bw(color_t backdrop, color_t src, int opacity);
color_t graya_blender_normal(color_t backdrop, color_t src, int opacity = 255);
color_t graya_blender_normal_dst_over(color_t backdrop, color_t src, int opacity);
color_t graya_blender_multiply(color_t backdrop, color_t src, int opacity);
color_t graya_blender_screen(color_t backdrop, color_t src, int opacity);
color_t graya_blender_overlay(color_t backdrop, color_t src, int opacity);
color_t graya_blender_darken(color_t backdrop, color_t src, int opacity);
color_t graya_blender_lighten(color_t backdrop, color_t src, int opacity);
color_t graya_blender_color_dodge(color_t backdrop, color_t src, int opacity);
color_t graya_blender_color_burn(color_t backdrop, color_t src, int opacity);
color_t graya_blender_hard_light(color_t backdrop, color_t src, int opacity);
color_t graya_blender_soft_light(color_t backdrop, color_t src, int opacity);
color_t graya_blender_difference(color_t backdrop, color_t src, int opacity);
color_t graya_blender_exclusion(color_t backdrop, color_t src, int opacity);
color_t graya_blender_addition(color_t backdrop, color_t src, int opacity);
color_t graya_blender_subtract(color_t backdrop, color_t src, int opacity);
color_t graya_blender_divide(color_t backdrop, color_t src, int opacity);
color_t indexed_blender_src(color_t dst, color_t src, int opacity);
BlendFunc get_rgba_blender(BlendMode blendmode, const bool newBlend);
BlendFunc get_graya_blender(BlendMode blendmode, const bool newBlend);
BlendFunc get_indexed_blender(BlendMode blendmode, const bool newBlend);
} // namespace doc
#endif