Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
heal.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dt_heal_solver_t
 
struct  dt_heal_cl_global_t
 
struct  heal_params_cl_t
 

Typedefs

typedef enum dt_heal_domain_t dt_heal_domain_t
 
typedef struct dt_heal_solver_t dt_heal_solver_t
 
typedef struct dt_heal_cl_global_t dt_heal_cl_global_t
 
typedef struct heal_params_cl_t heal_params_cl_t
 

Enumerations

enum  dt_heal_domain_t {
  DT_HEAL_DOMAIN_LINEAR = 0 ,
  DT_HEAL_DOMAIN_SQRT = 1
}
 

Functions

void dt_heal (const float *const src_buffer, float *dest_buffer, const float *const mask_buffer, const int width, const int height, const int ch, const dt_heal_solver_t solver)
 
void dt_heal_init_cl_global (void)
 
void dt_heal_free_cl_global (void)
 
heal_params_cl_t * dt_heal_init_cl (const int devid)
 
void dt_heal_free_cl (heal_params_cl_t *p)
 
cl_int dt_heal_cl (heal_params_cl_t *p, cl_mem dev_src, cl_mem dev_dest, const float *const mask_buffer, const int width, const int height, const dt_heal_solver_t solver)
 

Typedef Documentation

◆ dt_heal_cl_global_t

◆ dt_heal_domain_t

The domain the source-to-destination difference is interpolated in.

LINEAR adds a harmonic correction to the source pixels as they are, so a source brighter than the destination keeps its absolute noise and texture amplitude on a darker base: once encoded for display, that noise is stronger than the destination's own.

SQRT interpolates the difference of square roots, the variance-stabilising transform of shot noise, so the pasted noise takes the amplitude it would have had at the destination level. Only the three colour channels are transformed; the fourth stays linear.

◆ dt_heal_solver_t

How the fill is solved; both settings come from the calling module.

◆ heal_params_cl_t

Enumeration Type Documentation

◆ dt_heal_domain_t

The domain the source-to-destination difference is interpolated in.

LINEAR adds a harmonic correction to the source pixels as they are, so a source brighter than the destination keeps its absolute noise and texture amplitude on a darker base: once encoded for display, that noise is stronger than the destination's own.

SQRT interpolates the difference of square roots, the variance-stabilising transform of shot noise, so the pasted noise takes the amplitude it would have had at the destination level. Only the three colour channels are transformed; the fourth stays linear.

Enumerator
DT_HEAL_DOMAIN_LINEAR 
DT_HEAL_DOMAIN_SQRT 

Definition at line 34 of file heal.h.

Function Documentation

◆ dt_heal()

void dt_heal ( const float *const  src_buffer,
float *  dest_buffer,
const float *const  mask_buffer,
const int  width,
const int  height,
const int  ch,
const dt_heal_solver_t  solver 
)

Heal dest_buffer using src_buffer as a reference and mask_buffer to define the area to be healed. The 3 buffers must have the same size, but mask_buffer is 1 channel and is tested for != 0.f.

Definition at line 410 of file heal.c.

References _heal_add(), _heal_laplace_loop(), _heal_sub(), ch, cleanup(), dt_heal_solver_t::domain, dt_pixelpipe_cache_alloc_align_float_cache, dt_pixelpipe_cache_free_align, height, IS_NULL_PTR, dt_heal_solver_t::max_iter, and width.

Referenced by _retouch_heal(), and dt_heal_cl().

◆ dt_heal_cl()

cl_int dt_heal_cl ( heal_params_cl_t *  p,
cl_mem  dev_src,
cl_mem  dev_dest,
const float *const  mask_buffer,
const int  width,
const int  height,
const dt_heal_solver_t  solver 
)

◆ dt_heal_free_cl()

void dt_heal_free_cl ( heal_params_cl_t *  p)

Definition at line 477 of file heal.c.

References dt_free, IS_NULL_PTR, and p.

Referenced by _retouch_heal_cl().

◆ dt_heal_free_cl_global()

void dt_heal_free_cl_global ( void  )

Definition at line 456 of file heal.c.

References _heal_cl_global, dt_free, g, and IS_NULL_PTR.

Referenced by dt_opencl_cleanup().

◆ dt_heal_init_cl()

heal_params_cl_t * dt_heal_init_cl ( const int  devid)

Definition at line 465 of file heal.c.

References _heal_cl_global, heal_params_cl_t::global, IS_NULL_PTR, and p.

Referenced by _retouch_heal_cl().

◆ dt_heal_init_cl_global()

void dt_heal_init_cl_global ( void  )

Definition at line 449 of file heal.c.

References _heal_cl_global, and g.

Referenced by dt_opencl_init().