Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
brush.h
Go to the documentation of this file.
1/*
2 This file is part of the Ansel project.
3 Copyright (C) 2026 Aurélien PIERRE.
4
5 Ansel is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 Ansel is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with Ansel. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#pragma once
20
21#include <glib.h>
22#include <stdint.h>
23
24#define OUTER_LOOP 1
25
27
44
53
56
64{
65 float x;
66 float y;
67 float wx;
68 float wy;
69 float radius;
70 float dir_x;
71 float dir_y;
74 float opacity;
75 float flow;
76 float sprinkles;
79 float hardness;
80 float color[4];
81 float display_color[3];
82 int shape;
83 int mode;
84 uint32_t stroke_batch;
85 uint8_t stroke_pos;
87
89
107 dt_drawlayer_cache_patch_t *patch, float scale,
108 const dt_drawlayer_brush_dab_t *dab,
109 float sample_opacity_scale,
110 dt_drawlayer_cache_patch_t *stroke_mask,
111 struct dt_drawlayer_paint_stroke_t *stroke);
112
130 int width, int height, int stride,
131 float center_x, float center_y,
132 float opacity_multiplier);
133
148 int width, int height,
149 float center_x, float center_y,
150 float opacity_multiplier,
151 const float background_rgb[3]);
int width
Definition bilateral.h:1
int height
Definition bilateral.h:1
gboolean dt_drawlayer_brush_rasterize_dab_rgbaf(const dt_drawlayer_brush_dab_t *dab, float *rgba, int width, int height, float center_x, float center_y, float opacity_multiplier, const float background_rgb[3])
Rasterize a single dab preview in linear float RGBA over an opaque background.
Definition iop/drawlayer/brush.c:850
dt_drawlayer_brush_mode_t dt_iop_drawlayer_brush_mode_t
Definition brush.h:55
dt_drawlayer_brush_mode_t
Pixel blending behavior used while stamping a dab.
Definition brush.h:47
@ DT_DRAWLAYER_BRUSH_MODE_ERASE
Definition brush.h:49
@ DT_DRAWLAYER_BRUSH_MODE_PAINT
Definition brush.h:48
@ DT_DRAWLAYER_BRUSH_MODE_BLUR
Definition brush.h:50
@ DT_DRAWLAYER_BRUSH_MODE_SMUDGE
Definition brush.h:51
dt_drawlayer_brush_shape_t dt_iop_drawlayer_brush_shape_t
Definition brush.h:54
dt_drawlayer_brush_shape_t
Supported analytic fall-off profiles for brush alpha.
Definition brush.h:38
@ DT_DRAWLAYER_BRUSH_SHAPE_SIGMOIDAL
Definition brush.h:42
@ DT_DRAWLAYER_BRUSH_SHAPE_GAUSSIAN
Definition brush.h:40
@ DT_DRAWLAYER_BRUSH_SHAPE_LINEAR
Definition brush.h:39
@ DT_DRAWLAYER_BRUSH_SHAPE_QUADRATIC
Definition brush.h:41
gboolean dt_drawlayer_brush_rasterize(const dt_drawlayer_cache_patch_t *sample_patch, dt_drawlayer_cache_patch_t *patch, float scale, const dt_drawlayer_brush_dab_t *dab, float sample_opacity_scale, dt_drawlayer_cache_patch_t *stroke_mask, struct dt_drawlayer_paint_stroke_t *stroke)
Rasterize one dab into a float RGBA buffer.
Definition iop/drawlayer/brush.c:648
gboolean dt_drawlayer_brush_rasterize_dab_argb8(const dt_drawlayer_brush_dab_t *dab, uint8_t *argb, int width, int height, int stride, float center_x, float center_y, float opacity_multiplier)
Rasterize a single dab preview into ARGB8 for GUI overlays.
Definition iop/drawlayer/brush.c:797
Fully resolved input dab descriptor.
Definition brush.h:64
float flow
Definition brush.h:75
float x
Definition brush.h:65
float sample_opacity_scale
Definition brush.h:73
float radius
Definition brush.h:69
float display_color[3]
Definition brush.h:81
float wx
Definition brush.h:67
int mode
Definition brush.h:83
uint32_t stroke_batch
Definition brush.h:84
int shape
Definition brush.h:82
float color[4]
Definition brush.h:80
float y
Definition brush.h:66
float sprinkles
Definition brush.h:76
uint8_t stroke_pos
Definition brush.h:85
float opacity
Definition brush.h:74
float sprinkle_coarseness
Definition brush.h:78
float sample_spacing
Definition brush.h:72
float hardness
Definition brush.h:79
float sprinkle_size
Definition brush.h:77
float dir_x
Definition brush.h:70
float dir_y
Definition brush.h:71
float wy
Definition brush.h:68
Generic float RGBA patch stored either in malloc memory or pixel cache.
Definition iop/drawlayer/cache.h:37
Mutable stroke runtime state owned by worker/backend code.
Definition iop/drawlayer/paint.h:100