![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
Inline brush profile and mass primitives shared by paint/brush code. More...
Include dependency graph for brush_profile.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_profile_const_t |
| The part of the profile that depends on the dab and not on the pixel. More... | |
Typedefs | |
| typedef struct dt_drawlayer_brush_profile_const_t | dt_drawlayer_brush_profile_const_t |
| The part of the profile that depends on the dab and not on the pixel. | |
Functions | |
| static float | dt_drawlayer_brush_profile_clamp01 (const float v) |
| Clamp scalar value to [0, 1]. | |
| static float | dt_drawlayer_brush_transition_profile_eval (const int shape, const float t, const float inv_t) |
| Evaluate normalized edge-falloff transition profile by shape. | |
| static float | dt_drawlayer_brush_transition_mass_primitive_eval (const int shape, const float u, const float inner, const float w, const float base) |
| Evaluate integrated mass primitive of transition zone by shape. | |
| static void | dt_drawlayer_brush_profile_prepare (const dt_drawlayer_brush_dab_t *dab, dt_drawlayer_brush_profile_const_t *out) |
| Resolve the per-dab half of the profile once. | |
| static float | dt_drawlayer_brush_profile_eval_fast (const dt_drawlayer_brush_profile_const_t *pc, const float norm2) |
| Evaluate the profile against pre-resolved dab constants. | |
| static float | dt_drawlayer_brush_profile_eval (const dt_drawlayer_brush_dab_t *dab, const float norm2) |
| Evaluate normalized brush profile at squared normalized radius. | |
| static float | dt_drawlayer_brush_mass_primitive_eval (const dt_drawlayer_brush_dab_t *dab, const float u_in) |
Evaluate radial mass primitive from center to normalized radius u_in. | |
Inline brush profile and mass primitives shared by paint/brush code.
Definition in file brush_profile.h.
The part of the profile that depends on the dab and not on the pixel.
dt_drawlayer_brush_profile_eval recomputed hardness, min_inner, inner and the transition width for EVERY pixel of every dab, although all four are properties of the dab. Resolve them once with dt_drawlayer_brush_profile_prepare and evaluate with dt_drawlayer_brush_profile_eval_fast, which performs the identical arithmetic on the identical operands and therefore returns identical floats.
|
inlinestatic |
Evaluate radial mass primitive from center to normalized radius u_in.
Definition at line 187 of file brush_profile.h.
References dt_drawlayer_brush_profile_clamp01(), DT_DRAWLAYER_BRUSH_SHAPE_GAUSSIAN, dt_drawlayer_brush_transition_mass_primitive_eval(), dt_drawlayer_brush_dab_t::hardness, IS_NULL_PTR, dt_drawlayer_brush_dab_t::radius, dt_drawlayer_brush_dab_t::shape, and u2.
Referenced by _paint_stroke_sample_opacity_scale().
|
inlinestatic |
Clamp scalar value to [0, 1].
Definition at line 31 of file brush_profile.h.
References v.
Referenced by dt_drawlayer_brush_mass_primitive_eval(), dt_drawlayer_brush_profile_eval(), dt_drawlayer_brush_profile_eval_fast(), dt_drawlayer_brush_profile_prepare(), and dt_drawlayer_brush_transition_mass_primitive_eval().
|
inlinestatic |
Evaluate normalized brush profile at squared normalized radius.
| dab | Current dab parameters. |
| norm2 | Squared normalized radius (r^2 in [0, inf)). |
Definition at line 159 of file brush_profile.h.
References dt_drawlayer_brush_profile_clamp01(), DT_DRAWLAYER_BRUSH_SHAPE_GAUSSIAN, dt_drawlayer_brush_transition_profile_eval(), dt_drawlayer_brush_dab_t::hardness, IS_NULL_PTR, dt_drawlayer_brush_dab_t::radius, dt_drawlayer_brush_dab_t::shape, and t.
Referenced by _paint_stroke_sample_opacity_scale(), dt_drawlayer_brush_rasterize_dab_argb8(), and dt_drawlayer_brush_rasterize_dab_rgbaf().
|
inlinestatic |
Evaluate the profile against pre-resolved dab constants.
Definition at line 132 of file brush_profile.h.
References dt_drawlayer_brush_profile_clamp01(), dt_drawlayer_brush_transition_profile_eval(), dt_drawlayer_brush_profile_const_t::flat, dt_drawlayer_brush_profile_const_t::gaussian, dt_drawlayer_brush_profile_const_t::inner, dt_drawlayer_brush_profile_const_t::shape, t, and dt_drawlayer_brush_profile_const_t::width.
Referenced by _brush_alpha_at(), _brush_alpha_at_noise(), _prepare_analytic_pixel_context(), and _prepare_blur_context().
|
inlinestatic |
Resolve the per-dab half of the profile once.
Definition at line 109 of file brush_profile.h.
References dt_drawlayer_brush_profile_clamp01(), DT_DRAWLAYER_BRUSH_SHAPE_GAUSSIAN, FALSE, dt_drawlayer_brush_dab_t::hardness, IS_NULL_PTR, out, dt_drawlayer_brush_dab_t::radius, dt_drawlayer_brush_dab_t::shape, dt_drawlayer_brush_profile_const_t::shape, and TRUE.
Referenced by _brush_runtime_view_from_bounds().
|
inlinestatic |
Evaluate integrated mass primitive of transition zone by shape.
Definition at line 55 of file brush_profile.h.
References delta, dt_drawlayer_brush_profile_clamp01(), DT_DRAWLAYER_BRUSH_SHAPE_LINEAR, DT_DRAWLAYER_BRUSH_SHAPE_QUADRATIC, and DT_DRAWLAYER_BRUSH_SHAPE_SIGMOIDAL.
Referenced by dt_drawlayer_brush_mass_primitive_eval().
|
inlinestatic |
Evaluate normalized edge-falloff transition profile by shape.
Definition at line 37 of file brush_profile.h.
References DT_DRAWLAYER_BRUSH_SHAPE_LINEAR, DT_DRAWLAYER_BRUSH_SHAPE_QUADRATIC, DT_DRAWLAYER_BRUSH_SHAPE_SIGMOIDAL, and t.
Referenced by dt_drawlayer_brush_profile_eval(), and dt_drawlayer_brush_profile_eval_fast().