Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
brush_profile.h File Reference

Inline brush profile and mass primitives shared by paint/brush code. More...

#include "iop/drawlayer/brush.h"
#include <math.h>
+ 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.

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 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.
 

Detailed Description

Inline brush profile and mass primitives shared by paint/brush code.

Definition in file brush_profile.h.

Function Documentation

◆ dt_drawlayer_brush_mass_primitive_eval()

static float dt_drawlayer_brush_mass_primitive_eval ( const dt_drawlayer_brush_dab_t dab,
const float  u_in 
)
inlinestatic

Evaluate radial mass primitive from center to normalized radius u_in.

Note
Used by stroke-level overlap normalization.

Definition at line 121 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().

◆ dt_drawlayer_brush_profile_clamp01()

static float dt_drawlayer_brush_profile_clamp01 ( const float  v)
inlinestatic

Clamp scalar value to [0, 1].

Definition at line 30 of file brush_profile.h.

References v.

Referenced by dt_drawlayer_brush_mass_primitive_eval(), dt_drawlayer_brush_profile_eval(), and dt_drawlayer_brush_transition_mass_primitive_eval().

◆ dt_drawlayer_brush_profile_eval()

static float dt_drawlayer_brush_profile_eval ( const dt_drawlayer_brush_dab_t dab,
const float  norm2 
)
inlinestatic

◆ dt_drawlayer_brush_transition_mass_primitive_eval()

static float dt_drawlayer_brush_transition_mass_primitive_eval ( const int  shape,
const float  u,
const float  inner,
const float  w,
const float  base 
)
inlinestatic

Evaluate integrated mass primitive of transition zone by shape.

Definition at line 54 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().

◆ dt_drawlayer_brush_transition_profile_eval()

static float dt_drawlayer_brush_transition_profile_eval ( const int  shape,
const float  t,
const float  inv_t 
)
inlinestatic

Evaluate normalized edge-falloff transition profile by shape.

Definition at line 36 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().