![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "iop/drawlayer/brush.h"#include "iop/drawlayer/cache.h"#include "iop/drawlayer/paint.h"#include "iop/drawlayer/brush_profile.h"#include "system/macros.h"#include "system/simd.h"#include "iop/noise_generator.h"#include <math.h>#include <string.h>
Include dependency graph for iop/drawlayer/brush.c:Go to the source code of this file.
Data Structures | |
| struct | dt_drawlayer_sprinkle_preview_t |
| struct | dt_drawlayer_brush_runtime_view_t |
| struct | dt_drawlayer_brush_pixel_eval_t |
Typedefs | |
| typedef struct dt_drawlayer_sprinkle_preview_t | dt_drawlayer_sprinkle_preview_t |
| typedef struct dt_drawlayer_brush_runtime_view_t | dt_drawlayer_brush_runtime_view_t |
| typedef struct dt_drawlayer_brush_pixel_eval_t | dt_drawlayer_brush_pixel_eval_t |
Functions | |
| static float | _clamp01 (const float v) |
| Clamp scalar to [0,1]. | |
| static float | _lerpf (const float a, const float b, const float t) |
| Linear interpolation helper. | |
| static float | _cell_hash01_from_seed (const uint64_t cell_seed, const uint64_t salt) |
| Stable scalar hash in [0,1] from precomputed cell seed. | |
| static float | _cellular_grain_2d (const uint64_t seed, const float x, const float y) |
| Grain-like round cellular field. Peaks at grain centers, falls off radially. | |
| static void | _sprinkle_octave_weights (const float coarseness, float *w0, float *w1, float *w2) |
| Resolve octave weights from coarseness control. | |
| static float | _sprinkle_noise_at_pixel_precomputed (const float px, const float py, const float scale, const float strength, const float w0, const float w1, const float w2, const uint64_t seed0, const uint64_t seed1, const uint64_t seed2) |
| Evaluate sprinkle modulation from precomputed dab constants. | |
| static void | _prepare_sprinkle_preview (const dt_drawlayer_brush_dab_t *dab, const float center_x, const float center_y, const float radius, dt_drawlayer_sprinkle_preview_t *preview) |
| static float | _sample_sprinkle_preview (const dt_drawlayer_sprinkle_preview_t *preview, const float px, const float py) |
| static gboolean | _brush_runtime_view_from_bounds (const dt_drawlayer_damaged_rect_t *bounds, const dt_drawlayer_brush_dab_t *dab, const int origin_x, const int origin_y, const float scale, dt_drawlayer_brush_runtime_view_t *view) |
| Build immutable per-dab raster view from stroke runtime state. | |
| static gboolean | _brush_runtime_view_from_state (const dt_drawlayer_paint_stroke_t *stroke, const dt_drawlayer_brush_dab_t *dab, const int origin_x, const int origin_y, const float scale, dt_drawlayer_brush_runtime_view_t *view) |
| static float | _sample_alpha_noise_raw (const dt_drawlayer_brush_dab_t *dab, const dt_drawlayer_brush_runtime_view_t *view, const int pixel_x, const int pixel_y) |
| Resolve multiplicative alpha noise at one pixel. | |
| static float | _estimate_alpha_noise_gain (const dt_drawlayer_brush_dab_t *dab, const dt_drawlayer_brush_runtime_view_t *view) |
| Estimate per-dab texture gain so noise preserves average opacity across samples. | |
| static float | _stroke_flow_alpha (const dt_drawlayer_brush_dab_t *dab, const float opacity, const float flow, const float sample_opacity_scale, const float profile, const float brush_alpha, const float old_alpha, const float stroke_old_alpha, const gboolean have_stroke_alpha) |
| Compute per-pixel source alpha from opacity/flow model. | |
| static gboolean | _prepare_analytic_pixel_context (const dt_drawlayer_brush_runtime_view_t *view, const float sample_opacity_scale, float *stroke_mask, const int stroke_mask_width, const int stroke_mask_height, const int x, const int y, const float old_alpha, dt_drawlayer_brush_pixel_eval_t *pixel_eval) |
| Compute full analytic per-pixel brush context. | |
| static gboolean | _prepare_blur_context (dt_aligned_pixel_simd_t *blur_px, const float *buffer, const int width, const int height, const int source_origin_x, const int source_origin_y, const int patch_origin_x, const int patch_origin_y, const dt_drawlayer_brush_runtime_view_t *view) |
| Build blur gather color for current dab footprint. | |
| static float | _smudge_hash_signed (const int x, const int y, const int lane) |
| Stable signed pseudo-random helper in [-1,1]. | |
| static | __attribute__ ((always_inline)) |
| Bilinear RGBA sample from float buffer. | |
| static float | _smudge_deposit_alpha (const float src_alpha, const float carried_alpha, const float opacity) |
| Resolve effective smudge deposit alpha for one pixel. | |
| static dt_aligned_pixel_simd_t | _apply_smudge_stroke_mode (const float *source_buffer, const int source_width, const int source_height, const int source_origin_x, const int source_origin_y, dt_drawlayer_paint_stroke_t *runtime_private, const dt_drawlayer_brush_runtime_view_t *view, const float scale, const int patch_origin_x, const int patch_origin_y, const int x, const int y, const float src_alpha, const dt_aligned_pixel_simd_t old_px) |
| Apply smudge mode for one pixel and update carried sample. | |
| gboolean | dt_drawlayer_brush_rasterize (const dt_drawlayer_cache_patch_t *sample_patch, 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) |
| Public dab rasterization entry point. | |
| static float | _brush_alpha_at (const dt_drawlayer_brush_runtime_view_t *const view, const int x, const int y) |
| Per-pixel brush alpha, the part of the pixel context that owes nothing to the destination. | |
| static float | _brush_alpha_at_noise (const dt_drawlayer_brush_runtime_view_t *const view, const int x, const int y, const float raw_noise) |
As _brush_alpha_at, with the shared sprinkle field already sampled. | |
| gboolean | dt_drawlayer_brush_batch_is_uniform (const dt_drawlayer_brush_dab_t *dabs, const guint count, dt_drawlayer_brush_batch_t *out) |
| Decide whether a run of dabs can take the batch path, and describe it if so. | |
| gboolean | dt_drawlayer_brush_rasterize_batch (const dt_drawlayer_brush_batch_t *batch, dt_drawlayer_cache_patch_t *patch, const float scale, dt_drawlayer_cache_patch_t *stroke_mask, float *const transmittance, float *const noise_scratch, dt_drawlayer_damaged_rect_t *batch_damage) |
| Rasterize a whole batch in two passes: accumulate transmittance, then composite once. | |
| 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) |
| Render one dab to 8-bit ARGB surface for GUI cursor preview. | |
| gboolean | dt_drawlayer_brush_rasterize_dab_rgbaf (const dt_drawlayer_brush_dab_t *dab, float *rgba, const int width, const int height, const float center_x, const float center_y, const float opacity_multiplier, const float background_rgb[3]) |
| Rasterize a single dab preview in linear float RGBA over an opaque background. | |
| typedef struct dt_drawlayer_brush_pixel_eval_t dt_drawlayer_brush_pixel_eval_t |
| typedef struct dt_drawlayer_sprinkle_preview_t dt_drawlayer_sprinkle_preview_t |
|
inlinestatic |
Bilinear RGBA sample from float buffer.
Multi-tap smudge source sample with directional jitter.
| motion_dx | Motion X used to orient anisotropic taps. |
| motion_dy | Motion Y used to orient anisotropic taps. |
Definition at line 505 of file iop/drawlayer/brush.c.
References dt_simd_set1(), fx, height, IS_NULL_PTR, MIN, width, and x.
|
static |
Apply smudge mode for one pixel and update carried sample.
Definition at line 606 of file iop/drawlayer/brush.c.
References _clamp01(), _smudge_deposit_alpha(), dt_drawlayer_paint_runtime_get_smudge_pickup(), dt_drawlayer_paint_runtime_have_smudge_pickup(), dt_drawlayer_paint_runtime_smudge_pixels(), dt_drawlayer_paint_runtime_smudge_width(), dt_simd_set1(), dt_store_simd(), IS_NULL_PTR, dt_drawlayer_brush_dab_t::opacity, view, and x.
Referenced by dt_drawlayer_brush_rasterize().
|
inlinestatic |
Per-pixel brush alpha, the part of the pixel context that owes nothing to the destination.
Definition at line 851 of file iop/drawlayer/brush.c.
References _clamp01(), _sample_alpha_noise_raw(), dt_drawlayer_brush_profile_eval_fast(), view, and x.
Referenced by dt_drawlayer_brush_rasterize_batch().
|
inlinestatic |
As _brush_alpha_at, with the shared sprinkle field already sampled.
Definition at line 867 of file iop/drawlayer/brush.c.
References _clamp01(), dt_drawlayer_brush_profile_eval_fast(), view, and x.
Referenced by dt_drawlayer_brush_rasterize_batch().
|
static |
Build immutable per-dab raster view from stroke runtime state.
Definition at line 251 of file iop/drawlayer/brush.c.
References _clamp01(), _sprinkle_octave_weights(), dt_drawlayer_brush_dab_t::dir_x, dt_drawlayer_brush_dab_t::dir_y, DT_DRAWLAYER_BRUSH_MODE_ERASE, DT_DRAWLAYER_BRUSH_MODE_PAINT, dt_drawlayer_brush_profile_prepare(), FALSE, IS_NULL_PTR, dt_drawlayer_brush_dab_t::mode, dt_drawlayer_damaged_rect_t::nw, origin_x, origin_y, dt_drawlayer_brush_dab_t::radius, dt_drawlayer_damaged_rect_t::se, dt_drawlayer_brush_dab_t::sprinkle_coarseness, dt_drawlayer_brush_dab_t::sprinkle_size, dt_drawlayer_brush_dab_t::sprinkles, dt_drawlayer_brush_dab_t::stroke_batch, TRUE, dt_drawlayer_damaged_rect_t::valid, view, dt_drawlayer_brush_dab_t::x, and dt_drawlayer_brush_dab_t::y.
Referenced by _brush_runtime_view_from_state(), and dt_drawlayer_brush_rasterize_batch().
|
static |
Definition at line 294 of file iop/drawlayer/brush.c.
References _brush_runtime_view_from_bounds(), dt_drawlayer_paint_stroke_t::bounds, FALSE, origin_x, origin_y, and view.
Referenced by dt_drawlayer_brush_rasterize().
Stable scalar hash in [0,1] from precomputed cell seed.
Definition at line 51 of file iop/drawlayer/brush.c.
References splitmix32().
Referenced by _cellular_grain_2d().
|
inlinestatic |
Grain-like round cellular field. Peaks at grain centers, falls off radially.
Definition at line 57 of file iop/drawlayer/brush.c.
References _cell_hash01_from_seed(), _clamp01(), and x.
Referenced by _sprinkle_noise_at_pixel_precomputed().
|
inlinestatic |
Clamp scalar to [0,1].
Definition at line 39 of file iop/drawlayer/brush.c.
References v.
Referenced by _apply_smudge_stroke_mode(), _blend_layer_over_input(), _brush_alpha_at(), _brush_alpha_at_noise(), _brush_pipeline_color_from_display(), _brush_runtime_view_from_bounds(), _build_raw_input_event(), _cellular_grain_2d(), _compute_hud_brush_state(), _conf_softness(), _fill_current_layer(), _fill_input_brush_settings(), _prepare_analytic_pixel_context(), _prepare_sprinkle_preview(), _process_backend_dab(), _rasterize_pending_dab_batch(), _smudge_deposit_alpha(), _sprinkle_octave_weights(), _stroke_flow_alpha(), _working_rgb_to_display_rgb(), button_pressed(), button_released(), dt_drawlayer_brush_batch_is_uniform(), dt_drawlayer_brush_rasterize(), dt_drawlayer_brush_rasterize_batch(), dt_drawlayer_brush_rasterize_dab_argb8(), dt_drawlayer_brush_rasterize_dab_rgbaf(), dt_drawlayer_build_worker_input_dab(), dt_drawlayer_conf_apply_display_brush_color(), dt_drawlayer_conf_display_color(), dt_drawlayer_conf_load_color_history(), and dt_drawlayer_sync_cached_brush_colors().
|
inlinestatic |
Estimate per-dab texture gain so noise preserves average opacity across samples.
Definition at line 331 of file iop/drawlayer/brush.c.
References _sample_alpha_noise_raw(), IS_NULL_PTR, and view.
Referenced by dt_drawlayer_brush_rasterize(), and dt_drawlayer_brush_rasterize_batch().
|
inlinestatic |
Linear interpolation helper.
Definition at line 45 of file iop/drawlayer/brush.c.
References t.
Referenced by _sprinkle_octave_weights(), and _stroke_flow_alpha().
|
static |
Compute full analytic per-pixel brush context.
Definition at line 413 of file iop/drawlayer/brush.c.
References _clamp01(), _sample_alpha_noise_raw(), _stroke_flow_alpha(), dt_drawlayer_brush_pixel_eval_t::brush_alpha, dt_drawlayer_brush_profile_eval_fast(), FALSE, dt_drawlayer_brush_dab_t::flow, IS_NULL_PTR, dt_drawlayer_brush_dab_t::opacity, dt_drawlayer_brush_pixel_eval_t::profile, 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, view, and x.
Referenced by dt_drawlayer_brush_rasterize().
|
static |
Build blur gather color for current dab footprint.
Definition at line 457 of file iop/drawlayer/brush.c.
References dt_drawlayer_brush_profile_eval_fast(), dt_simd_set1(), FALSE, height, IS_NULL_PTR, TRUE, view, width, and x.
Referenced by dt_drawlayer_brush_rasterize().
|
inlinestatic |
Definition at line 141 of file iop/drawlayer/brush.c.
References _clamp01(), _sprinkle_noise_at_pixel_precomputed(), _sprinkle_octave_weights(), FALSE, IS_NULL_PTR, preview, dt_drawlayer_sprinkle_preview_t::scale, dt_drawlayer_brush_dab_t::sprinkle_coarseness, dt_drawlayer_brush_dab_t::sprinkle_size, dt_drawlayer_brush_dab_t::sprinkles, dt_drawlayer_brush_dab_t::stroke_batch, and TRUE.
Referenced by dt_drawlayer_brush_rasterize_dab_argb8(), and dt_drawlayer_brush_rasterize_dab_rgbaf().
|
inlinestatic |
Resolve multiplicative alpha noise at one pixel.
Definition at line 308 of file iop/drawlayer/brush.c.
References _sprinkle_noise_at_pixel_precomputed(), IS_NULL_PTR, and view.
Referenced by _brush_alpha_at(), _estimate_alpha_noise_gain(), _prepare_analytic_pixel_context(), and dt_drawlayer_brush_rasterize_batch().
|
inlinestatic |
Definition at line 199 of file iop/drawlayer/brush.c.
References _sprinkle_noise_at_pixel_precomputed(), IS_NULL_PTR, and preview.
Referenced by dt_drawlayer_brush_rasterize_dab_argb8(), and dt_drawlayer_brush_rasterize_dab_rgbaf().
|
inlinestatic |
Resolve effective smudge deposit alpha for one pixel.
Definition at line 594 of file iop/drawlayer/brush.c.
References _clamp01().
Referenced by _apply_smudge_stroke_mode().
|
inlinestatic |
Stable signed pseudo-random helper in [-1,1].
Definition at line 492 of file iop/drawlayer/brush.c.
References x.
|
inlinestatic |
Evaluate sprinkle modulation from precomputed dab constants.
Definition at line 111 of file iop/drawlayer/brush.c.
References _cellular_grain_2d(), strength(), w1, w2, and x.
Referenced by _prepare_sprinkle_preview(), _sample_alpha_noise_raw(), and _sample_sprinkle_preview().
|
inlinestatic |
Resolve octave weights from coarseness control.
Definition at line 91 of file iop/drawlayer/brush.c.
References _clamp01(), _lerpf(), IS_NULL_PTR, t, w1, and w2.
Referenced by _brush_runtime_view_from_bounds(), and _prepare_sprinkle_preview().
|
inlinestatic |
Compute per-pixel source alpha from opacity/flow model.
Assumptions:
flow uses internal brush convention (see caller conversion),sample_opacity_scale already reflects spacing normalization. Definition at line 365 of file iop/drawlayer/brush.c.
References _clamp01(), _lerpf(), DT_DRAWLAYER_BRUSH_MODE_BLUR, DT_DRAWLAYER_BRUSH_MODE_ERASE, DT_DRAWLAYER_BRUSH_MODE_SMUDGE, dt_drawlayer_brush_dab_t::mode, and void().
Referenced by _prepare_analytic_pixel_context().
| gboolean dt_drawlayer_brush_batch_is_uniform | ( | const dt_drawlayer_brush_dab_t * | dabs, |
| guint | count, | ||
| dt_drawlayer_brush_batch_t * | out | ||
| ) |
Decide whether a run of dabs can take the batch path, and describe it if so.
Requires one mode across the run (PAINT or ERASE), one opacity, one colour, and UI Flow at 100% (internal flow 0). Those are the conditions under which the per-pixel stroke alpha collapses to a product of per-dab transmittance factors clamped once – see the derivation above dt_drawlayer_brush_rasterize_batch in brush.c. SMUDGE and BLUR never qualify: they read the destination per dab.
out when the run qualifies, FALSE otherwise. Definition at line 879 of file iop/drawlayer/brush.c.
References _clamp01(), dt_drawlayer_brush_dab_t::color, d, DT_DRAWLAYER_BRUSH_MODE_ERASE, DT_DRAWLAYER_BRUSH_MODE_PAINT, FALSE, dt_drawlayer_brush_dab_t::flow, i, IS_NULL_PTR, dt_drawlayer_brush_dab_t::mode, dt_drawlayer_brush_dab_t::opacity, out, dt_drawlayer_brush_dab_t::sprinkle_coarseness, dt_drawlayer_brush_dab_t::sprinkle_size, dt_drawlayer_brush_dab_t::sprinkles, dt_drawlayer_brush_dab_t::stroke_batch, and TRUE.
Referenced by _rasterize_pending_dab_batch(), _report_speedup(), _run_batch(), and test_gate_refuses_non_uniform().
| gboolean dt_drawlayer_brush_rasterize | ( | const dt_drawlayer_cache_patch_t * | sample_patch, |
| 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 | ||
| ) |
Public dab rasterization entry point.
Rasterize one dab into a float RGBA buffer.
Assumes caller already converted coordinates to layer space.
Definition at line 667 of file iop/drawlayer/brush.c.
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, IS_NULL_PTR, dt_drawlayer_brush_dab_t::opacity, origin_x, origin_y, 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 _report_speedup(), _run_serial(), and dt_drawlayer_paint_rasterize_segment_to_buffer().
| gboolean dt_drawlayer_brush_rasterize_batch | ( | const dt_drawlayer_brush_batch_t * | batch, |
| dt_drawlayer_cache_patch_t * | patch, | ||
| float | scale, | ||
| dt_drawlayer_cache_patch_t * | stroke_mask, | ||
| float * | transmittance, | ||
| float * | noise_scratch, | ||
| dt_drawlayer_damaged_rect_t * | batch_damage | ||
| ) |
Rasterize a whole batch in two passes: accumulate transmittance, then composite once.
| batch | Uniform run from dt_drawlayer_brush_batch_is_uniform. |
| patch | Destination premultiplied RGBA float patch (the heartbeat scratch). |
| scale | Layer-to-buffer scale factor, must be >0. |
| stroke_mask | Stroke-local alpha, same dimensions as patch. Read as the batch's starting alpha and overwritten with the batch's result. |
| transmittance | Caller-owned scratch plane of at least patch->width * patch->height floats. Contents on entry are irrelevant; the batch box is initialised. |
| noise_scratch | Optional second plane of the same size. When the batch carries texture, the sprinkle field – a function of LAYER position alone, hence identical for every overlapping dab – is evaluated into it once instead of once per dab per pixel. NULL falls back to evaluating it per dab. |
| batch_damage | Optional; the batch's footprint is unioned into it. |
Both passes are parallel over disjoint rows, so the result does not depend on the thread schedule – unlike the per-dab loop it replaces, whose tile locks excluded but did not order.
Definition at line 917 of file iop/drawlayer/brush.c.
References _brush_alpha_at(), _brush_alpha_at_noise(), _brush_runtime_view_from_bounds(), _clamp01(), _estimate_alpha_noise_gain(), _sample_alpha_noise_raw(), bbox, dt_drawlayer_brush_batch_t::cap, dt_drawlayer_brush_batch_t::color, dt_drawlayer_brush_batch_t::count, dt_drawlayer_brush_batch_t::dabs, DT_DRAWLAYER_BRUSH_MODE_ERASE, dt_drawlayer_paint_runtime_note_dab_damage(), dt_simd_set1(), dt_store_simd(), FALSE, dt_drawlayer_brush_dab_t::flow, height, dt_drawlayer_cache_patch_t::height, i, IS_NULL_PTR, MAX, MIN, dt_drawlayer_brush_batch_t::mode, dt_drawlayer_damaged_rect_t::nw, dt_drawlayer_brush_dab_t::opacity, dt_drawlayer_cache_patch_t::pixels, dt_drawlayer_brush_dab_t::radius, row, dt_drawlayer_damaged_rect_t::se, dt_drawlayer_brush_batch_t::sprinkles, t, TRUE, dt_drawlayer_damaged_rect_t::valid, view, views(), width, dt_drawlayer_cache_patch_t::width, x, dt_drawlayer_brush_dab_t::x, dt_drawlayer_cache_patch_t::x, dt_drawlayer_brush_dab_t::y, and dt_drawlayer_cache_patch_t::y.
Referenced by _rasterize_pending_dab_batch(), _report_speedup(), and _run_batch().
| 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 | ||
| ) |
Render one dab to 8-bit ARGB surface for GUI cursor preview.
Rasterize a single dab preview into ARGB8 for GUI overlays.
Definition at line 1081 of file iop/drawlayer/brush.c.
References _clamp01(), _prepare_sprinkle_preview(), _sample_sprinkle_preview(), dt_drawlayer_brush_profile_eval(), FALSE, height, IS_NULL_PTR, dt_drawlayer_brush_dab_t::opacity, preview, 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. |
Definition at line 1134 of file iop/drawlayer/brush.c.
References _clamp01(), _prepare_sprinkle_preview(), _sample_sprinkle_preview(), dt_drawlayer_brush_profile_eval(), FALSE, height, i, IS_NULL_PTR, dt_drawlayer_brush_dab_t::opacity, preview, dt_drawlayer_brush_dab_t::radius, TRUE, width, and x.
Referenced by _render_brush_profile_cell().