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#ifndef OUTER_LOOP
25#define OUTER_LOOP 1
26#endif
27
29
46
55
58
66{
67 float x;
68 float y;
69 float wx;
70 float wy;
71 float radius;
72 float dir_x;
73 float dir_y;
76 float opacity;
77 float flow;
78 float sprinkles;
81 float hardness;
82 float color[4];
83 float display_color[3];
84 int shape;
85 int mode;
86 uint32_t stroke_batch;
87 uint8_t stroke_pos;
89
91
107 const dt_drawlayer_brush_dab_t *dab,
108 float sample_opacity_scale,
109 dt_drawlayer_cache_patch_t *stroke_mask,
110 struct dt_drawlayer_paint_stroke_t *stroke);
111
129 int width, int height, int stride,
130 float center_x, float center_y,
131 float opacity_multiplier);
132
147 int width, int height,
148 float center_x, float center_y,
149 float opacity_multiplier,
150 const float background_rgb[3]);
int width
Definition bilateral.h:1
int height
Definition bilateral.h:1
gboolean dt_drawlayer_brush_rasterize(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:636
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:828
dt_drawlayer_brush_mode_t dt_iop_drawlayer_brush_mode_t
Definition brush.h:57
dt_drawlayer_brush_mode_t
Pixel blending behavior used while stamping a dab.
Definition brush.h:49
@ DT_DRAWLAYER_BRUSH_MODE_ERASE
Definition brush.h:51
@ DT_DRAWLAYER_BRUSH_MODE_PAINT
Definition brush.h:50
@ DT_DRAWLAYER_BRUSH_MODE_BLUR
Definition brush.h:52
@ DT_DRAWLAYER_BRUSH_MODE_SMUDGE
Definition brush.h:53
dt_drawlayer_brush_shape_t dt_iop_drawlayer_brush_shape_t
Definition brush.h:56
dt_drawlayer_brush_shape_t
Supported analytic fall-off profiles for brush alpha.
Definition brush.h:40
@ DT_DRAWLAYER_BRUSH_SHAPE_SIGMOIDAL
Definition brush.h:44
@ DT_DRAWLAYER_BRUSH_SHAPE_GAUSSIAN
Definition brush.h:42
@ DT_DRAWLAYER_BRUSH_SHAPE_LINEAR
Definition brush.h:41
@ DT_DRAWLAYER_BRUSH_SHAPE_QUADRATIC
Definition brush.h:43
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:775
Fully resolved input dab descriptor.
Definition brush.h:66
float flow
Definition brush.h:77
float x
Definition brush.h:67
float sample_opacity_scale
Definition brush.h:75
float radius
Definition brush.h:71
float display_color[3]
Definition brush.h:83
float wx
Definition brush.h:69
int mode
Definition brush.h:85
uint32_t stroke_batch
Definition brush.h:86
int shape
Definition brush.h:84
float color[4]
Definition brush.h:82
float y
Definition brush.h:68
float sprinkles
Definition brush.h:78
uint8_t stroke_pos
Definition brush.h:87
float opacity
Definition brush.h:76
float sprinkle_coarseness
Definition brush.h:80
float sample_spacing
Definition brush.h:74
float hardness
Definition brush.h:81
float sprinkle_size
Definition brush.h:79
float dir_x
Definition brush.h:72
float dir_y
Definition brush.h:73
float wy
Definition brush.h:70
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