![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
Dab-level brush rasterization API for drawlayer. More...
#include <glib.h>#include <stdint.h>
Include dependency graph for brush.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | dt_drawlayer_brush_dab_t |
| Fully resolved input dab descriptor. More... | |
Macros | |
| #define | OUTER_LOOP 1 |
Typedefs | |
| typedef struct dt_drawlayer_cache_patch_t | dt_drawlayer_cache_patch_t |
| typedef enum dt_drawlayer_brush_shape_t | dt_drawlayer_brush_shape_t |
| Supported analytic fall-off profiles for brush alpha. | |
| typedef enum dt_drawlayer_brush_mode_t | dt_drawlayer_brush_mode_t |
| Pixel blending behavior used while stamping a dab. | |
| typedef dt_drawlayer_brush_shape_t | dt_iop_drawlayer_brush_shape_t |
| typedef dt_drawlayer_brush_mode_t | dt_iop_drawlayer_brush_mode_t |
| typedef struct dt_drawlayer_brush_dab_t | dt_drawlayer_brush_dab_t |
| Fully resolved input dab descriptor. | |
Enumerations | |
| enum | dt_drawlayer_brush_shape_t { DT_DRAWLAYER_BRUSH_SHAPE_LINEAR = 0 , DT_DRAWLAYER_BRUSH_SHAPE_GAUSSIAN = 1 , DT_DRAWLAYER_BRUSH_SHAPE_QUADRATIC = 2 , DT_DRAWLAYER_BRUSH_SHAPE_SIGMOIDAL = 3 } |
| Supported analytic fall-off profiles for brush alpha. More... | |
| enum | dt_drawlayer_brush_mode_t { DT_DRAWLAYER_BRUSH_MODE_PAINT = 0 , DT_DRAWLAYER_BRUSH_MODE_ERASE = 1 , DT_DRAWLAYER_BRUSH_MODE_BLUR = 2 , DT_DRAWLAYER_BRUSH_MODE_SMUDGE = 3 } |
| Pixel blending behavior used while stamping a dab. More... | |
Functions | |
| 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. | |
| 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. | |
| 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. | |
Dab-level brush rasterization API for drawlayer.
This API is intentionally independent from drawlayer module internals. Callers provide fully resolved dab inputs in target buffer coordinates.
| #define OUTER_LOOP 1 |
| typedef struct dt_drawlayer_brush_dab_t dt_drawlayer_brush_dab_t |
Fully resolved input dab descriptor.
Instances are produced by the stroke-level paint API (or equivalent caller code) and consumed by the brush rasterizer.
| typedef enum dt_drawlayer_brush_mode_t dt_drawlayer_brush_mode_t |
Pixel blending behavior used while stamping a dab.
| typedef enum dt_drawlayer_brush_shape_t dt_drawlayer_brush_shape_t |
Supported analytic fall-off profiles for brush alpha.
| typedef struct dt_drawlayer_cache_patch_t dt_drawlayer_cache_patch_t |
Pixel blending behavior used while stamping a dab.
Supported analytic fall-off profiles for brush alpha.
| gboolean dt_drawlayer_brush_rasterize | ( | dt_drawlayer_cache_patch_t * | patch, |
| const float | scale, | ||
| const dt_drawlayer_brush_dab_t * | dab, | ||
| const float | sample_opacity_scale, | ||
| dt_drawlayer_cache_patch_t * | stroke_mask, | ||
| dt_drawlayer_paint_stroke_t * | runtime_private | ||
| ) |
Rasterize one dab into a float RGBA buffer.
| patch | Destination premultiplied RGBA float patch. |
| scale | Layer-to-buffer scale factor, must be >0. |
| dab | Fully resolved dab input (coordinates already in layer space). |
| sample_opacity_scale | Opacity normalization factor derived from spacing. |
| stroke_mask | Optional stroke-local alpha mask patch for overlap-aware flow. |
| stroke | Mutable stroke runtime payload (smudge context + dab bounds output). |
dab->radius > 0, dab->opacity > 0, scale > 0. Rasterize one dab into a float RGBA buffer.
Assumes caller already converted coordinates to layer space.
References _apply_smudge_stroke_mode(), _brush_runtime_view_from_state(), _clamp01(), _estimate_alpha_noise_gain(), _prepare_analytic_pixel_context(), _prepare_blur_context(), dt_drawlayer_brush_runtime_view_t::alpha_noise_gain, dt_drawlayer_paint_stroke_t::bounds, DT_DRAWLAYER_BRUSH_MODE_BLUR, DT_DRAWLAYER_BRUSH_MODE_ERASE, DT_DRAWLAYER_BRUSH_MODE_PAINT, DT_DRAWLAYER_BRUSH_MODE_SMUDGE, dt_drawlayer_paint_runtime_ensure_smudge_pixels(), dt_drawlayer_paint_runtime_prepare_dab_context(), dt_simd_set1(), dt_store_simd(), FALSE, dt_drawlayer_brush_dab_t::flow, height, dt_drawlayer_cache_patch_t::height, dt_drawlayer_brush_dab_t::opacity, dt_drawlayer_cache_patch_t::pixels, dt_drawlayer_brush_dab_t::radius, dt_drawlayer_damaged_rect_t::se, dt_drawlayer_brush_pixel_eval_t::src_alpha, dt_drawlayer_brush_pixel_eval_t::stroke_alpha, dt_drawlayer_brush_pixel_eval_t::stroke_old_alpha, TRUE, view(), width, dt_drawlayer_cache_patch_t::width, x, dt_drawlayer_cache_patch_t::x, and dt_drawlayer_cache_patch_t::y.
Referenced by dt_drawlayer_paint_rasterize_segment_to_buffer().
| gboolean dt_drawlayer_brush_rasterize_dab_argb8 | ( | const dt_drawlayer_brush_dab_t * | dab, |
| uint8_t * | argb, | ||
| const int | width, | ||
| const int | height, | ||
| const int | stride, | ||
| const float | center_x, | ||
| const float | center_y, | ||
| const float | opacity_multiplier | ||
| ) |
Rasterize a single dab preview into ARGB8 for GUI overlays.
| dab | Input dab descriptor. |
| argb | Destination 8-bit ARGB surface memory. |
| width | Surface width. |
| height | Surface height. |
| stride | Surface stride in bytes. |
| center_x | Dab center X in surface coordinates. |
| center_y | Dab center Y in surface coordinates. |
| opacity_multiplier | Additional UI-time opacity scalar in [0,1]. |
Rasterize a single dab preview into ARGB8 for GUI overlays.
References _clamp01(), _prepare_sprinkle_preview(), _sample_sprinkle_preview(), dt_drawlayer_brush_dab_t::display_color, dt_drawlayer_brush_profile_eval(), FALSE, height, dt_drawlayer_brush_dab_t::opacity, dt_drawlayer_brush_dab_t::radius, TRUE, width, and x.
Referenced by _ensure_cursor_stamp_surface().
| 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.
| dab | Input dab descriptor. |
| rgba | Destination float RGBA buffer (width*height*4), filled in linear display RGB. |
| width | Surface width. |
| height | Surface height. |
| center_x | Dab center X in surface coordinates. |
| center_y | Dab center Y in surface coordinates. |
| opacity_multiplier | Additional UI-time opacity scalar in [0,1]. |
| background_rgb | Opaque linear RGB background color, or NULL for white. |
References _clamp01(), _prepare_sprinkle_preview(), _sample_sprinkle_preview(), dt_drawlayer_brush_dab_t::color, dt_drawlayer_brush_profile_eval(), FALSE, height, i, dt_drawlayer_brush_dab_t::opacity, dt_drawlayer_brush_dab_t::radius, TRUE, width, and x.
Referenced by _render_brush_profile_cell().