Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
common.h File Reference
#include "system/openmp.h"
#include "system/simd.h"
#include "pixel/gaussian.h"
#include "develop/pixelpipe_hb.h"
#include <glib.h>
#include <math.h>
#include <stdint.h>
+ Include dependency graph for src/iop/highlights/common.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _hl_gauss_slot_t
 
struct  _hl_region_t
 
struct  _hl_knee_curve_t
 
struct  _hl_region_ctx_t
 
struct  dt_iop_highlights_params_t
 
struct  dt_iop_highlights_global_data_t
 

Macros

#define DT_HL_BIHARMONIC   1
 
#define DT_HL_BAND_OVR   0.9f
 
#define HL_PFOR(...)   __OMP_PARALLEL_FOR__(__VA_ARGS__)
 
#define HL_GAUSS_SLOTS   4
 
#define DT_HL_PAIR_VARIANCE   1
 
#define DT_HL_GUIDE_GATE   2
 
#define DT_HL_CLIP_FLOOR   1
 
#define CF_EDGE_RANGE   0.15f
 
#define CF_EDGE_GUIDE_SIGMA   3.f
 
#define CF_JOINT_TAU   0.10f
 
#define CF_REGION_LO   0.005f
 
#define CF_REGION_HI   0.015f
 
#define CF_AUTHORED_RAMP   1.12f
 
#define DT_HL_A3_COLLAR_PX   24.f
 
#define DT_HL_MIN_CLIPPED_PIXELS   25
 
#define DT_HL_DOME_NMAX   2000
 
#define DT_HL_DOME_NMAX_SPARSE   8192
 
#define DT_HL_SELF_DOME   1
 
#define DT_HL_ANISO_CHROMA   1
 
#define DT_HL_KNEE   1
 
#define DT_HL_COEFF_FIELD   1
 
#define DT_HL_HF_GUIDE   1
 
#define DT_HL_CF_K   0.15f
 
#define DT_HL_FILL_CL_MAXP   3
 
#define DT_HL_SPARSE_SOLVE   1
 
#define DT_HL_SPARSE_MAX   (1 << 14)
 
#define DT_HL_ANISO_SOLVER   2
 
#define DT_HL_FILL_MAXP   4
 
#define DT_HL_CL_CPU_REGION_PX   (1u << 20)
 
#define DT_HL_KNEE_LO   0.80f
 
#define DT_HL_KNEE_DET   0.995f
 
#define DT_HL_KNEE_BINS   24
 
#define DT_HL_KNEE_FMIN   0.02f
 
#define DT_HL_KNEE_R2MIN   0.25f
 
#define DT_HL_KNEE_MINVOTES   100
 
#define DT_HL_KNEE_NSIGMA   2.0f
 
#define DT_HL_KNEE_ENGAGE   0.005f
 
#define DT_HL_KNEE_NSIGMAS   5
 
#define MAX_NUM_SCALES   12
 
#define REDUCESIZE   64
 
#define DS_FACTOR   4
 
#define SQRT3   1.7320508075688772935274463415058723669L
 
#define SQRT12   3.4641016151377545870548926830117447339L
 

Typedefs

typedef struct _hl_knee_curve_t _hl_knee_curve_t
 
typedef struct _hl_region_ctx_t _hl_region_ctx_t
 
typedef enum dt_iop_highlights_mode_t dt_iop_highlights_mode_t
 
typedef enum dt_atrous_wavelets_scales_t dt_atrous_wavelets_scales_t
 
typedef struct dt_iop_highlights_params_t dt_iop_highlights_params_t
 
typedef dt_iop_highlights_params_t dt_iop_highlights_data_t
 
typedef struct dt_iop_highlights_global_data_t dt_iop_highlights_global_data_t
 
typedef enum diffuse_reconstruct_variant_t diffuse_reconstruct_variant_t
 

Enumerations

enum  dt_iop_highlights_mode_t {
  DT_IOP_HIGHLIGHTS_CLIP = 0 ,
  DT_IOP_HIGHLIGHTS_LCH = 1 ,
  DT_IOP_HIGHLIGHTS_INPAINT = 2 ,
  DT_IOP_HIGHLIGHTS_LAPLACIAN = 3 ,
  DT_IOP_HIGHLIGHTS_HARMONIC = 4
}
 
enum  dt_atrous_wavelets_scales_t {
  WAVELETS_1_SCALE = 0 ,
  WAVELETS_2_SCALE = 1 ,
  WAVELETS_3_SCALE = 2 ,
  WAVELETS_4_SCALE = 3 ,
  WAVELETS_5_SCALE = 4 ,
  WAVELETS_6_SCALE = 5 ,
  WAVELETS_7_SCALE = 6 ,
  WAVELETS_8_SCALE = 7 ,
  WAVELETS_9_SCALE = 8 ,
  WAVELETS_10_SCALE = 9 ,
  WAVELETS_11_SCALE = 10 ,
  WAVELETS_12_SCALE = 11
}
 
enum  diffuse_reconstruct_variant_t {
  DIFFUSE_RECONSTRUCT_RGB = 0 ,
  DIFFUSE_RECONSTRUCT_CHROMA
}
 
enum  wavelets_scale_t {
  ANY_SCALE = 1 << 0 ,
  FIRST_SCALE = 1 << 1 ,
  LAST_SCALE = 1 << 2
}
 

Functions

static float _hl_floor_gate (const float clips[4])
 
static float _hl_ring_flat_mean_vote (const float *const restrict estimate, const float *const restrict valid, const dt_aligned_pixel_t cmean, const size_t region_pixels)
 
static float _hl_region_worth (const float region_benefit)
 
static float _hl_floor_worth (const float chroma_gain)
 

Macro Definition Documentation

◆ CF_AUTHORED_RAMP

#define CF_AUTHORED_RAMP   1.12f

Definition at line 266 of file src/iop/highlights/common.h.

◆ CF_EDGE_GUIDE_SIGMA

#define CF_EDGE_GUIDE_SIGMA   3.f

Definition at line 208 of file src/iop/highlights/common.h.

◆ CF_EDGE_RANGE

#define CF_EDGE_RANGE   0.15f

Definition at line 204 of file src/iop/highlights/common.h.

◆ CF_JOINT_TAU

#define CF_JOINT_TAU   0.10f

Definition at line 213 of file src/iop/highlights/common.h.

◆ CF_REGION_HI

#define CF_REGION_HI   0.015f

Definition at line 237 of file src/iop/highlights/common.h.

◆ CF_REGION_LO

#define CF_REGION_LO   0.005f

Definition at line 236 of file src/iop/highlights/common.h.

◆ DS_FACTOR

#define DS_FACTOR   4

Definition at line 683 of file src/iop/highlights/common.h.

◆ DT_HL_A3_COLLAR_PX

#define DT_HL_A3_COLLAR_PX   24.f

Definition at line 268 of file src/iop/highlights/common.h.

◆ DT_HL_ANISO_CHROMA

#define DT_HL_ANISO_CHROMA   1

Definition at line 298 of file src/iop/highlights/common.h.

◆ DT_HL_ANISO_SOLVER

#define DT_HL_ANISO_SOLVER   2

Definition at line 388 of file src/iop/highlights/common.h.

◆ DT_HL_BAND_OVR

#define DT_HL_BAND_OVR   0.9f

Definition at line 78 of file src/iop/highlights/common.h.

◆ DT_HL_BIHARMONIC

#define DT_HL_BIHARMONIC   1

Definition at line 68 of file src/iop/highlights/common.h.

◆ DT_HL_CF_K

#define DT_HL_CF_K   0.15f

Definition at line 372 of file src/iop/highlights/common.h.

◆ DT_HL_CL_CPU_REGION_PX

#define DT_HL_CL_CPU_REGION_PX   (1u << 20)

Definition at line 400 of file src/iop/highlights/common.h.

◆ DT_HL_CLIP_FLOOR

#define DT_HL_CLIP_FLOOR   1

Definition at line 189 of file src/iop/highlights/common.h.

◆ DT_HL_COEFF_FIELD

#define DT_HL_COEFF_FIELD   1

Definition at line 335 of file src/iop/highlights/common.h.

◆ DT_HL_DOME_NMAX

#define DT_HL_DOME_NMAX   2000

Definition at line 272 of file src/iop/highlights/common.h.

◆ DT_HL_DOME_NMAX_SPARSE

#define DT_HL_DOME_NMAX_SPARSE   8192

Definition at line 276 of file src/iop/highlights/common.h.

◆ DT_HL_FILL_CL_MAXP

#define DT_HL_FILL_CL_MAXP   3

Definition at line 375 of file src/iop/highlights/common.h.

◆ DT_HL_FILL_MAXP

#define DT_HL_FILL_MAXP   4

Definition at line 394 of file src/iop/highlights/common.h.

◆ DT_HL_GUIDE_GATE

#define DT_HL_GUIDE_GATE   2

Definition at line 182 of file src/iop/highlights/common.h.

◆ DT_HL_HF_GUIDE

#define DT_HL_HF_GUIDE   1

Definition at line 344 of file src/iop/highlights/common.h.

◆ DT_HL_KNEE

#define DT_HL_KNEE   1

Definition at line 310 of file src/iop/highlights/common.h.

◆ DT_HL_KNEE_BINS

#define DT_HL_KNEE_BINS   24

Definition at line 404 of file src/iop/highlights/common.h.

◆ DT_HL_KNEE_DET

#define DT_HL_KNEE_DET   0.995f

Definition at line 403 of file src/iop/highlights/common.h.

◆ DT_HL_KNEE_ENGAGE

#define DT_HL_KNEE_ENGAGE   0.005f

Definition at line 409 of file src/iop/highlights/common.h.

◆ DT_HL_KNEE_FMIN

#define DT_HL_KNEE_FMIN   0.02f

Definition at line 405 of file src/iop/highlights/common.h.

◆ DT_HL_KNEE_LO

#define DT_HL_KNEE_LO   0.80f

Definition at line 402 of file src/iop/highlights/common.h.

◆ DT_HL_KNEE_MINVOTES

#define DT_HL_KNEE_MINVOTES   100

Definition at line 407 of file src/iop/highlights/common.h.

◆ DT_HL_KNEE_NSIGMA

#define DT_HL_KNEE_NSIGMA   2.0f

Definition at line 408 of file src/iop/highlights/common.h.

◆ DT_HL_KNEE_NSIGMAS

#define DT_HL_KNEE_NSIGMAS   5

Definition at line 410 of file src/iop/highlights/common.h.

◆ DT_HL_KNEE_R2MIN

#define DT_HL_KNEE_R2MIN   0.25f

Definition at line 406 of file src/iop/highlights/common.h.

◆ DT_HL_MIN_CLIPPED_PIXELS

#define DT_HL_MIN_CLIPPED_PIXELS   25

Definition at line 270 of file src/iop/highlights/common.h.

◆ DT_HL_PAIR_VARIANCE

#define DT_HL_PAIR_VARIANCE   1

Definition at line 181 of file src/iop/highlights/common.h.

◆ DT_HL_SELF_DOME

#define DT_HL_SELF_DOME   1

Definition at line 292 of file src/iop/highlights/common.h.

◆ DT_HL_SPARSE_MAX

#define DT_HL_SPARSE_MAX   (1 << 14)

Definition at line 385 of file src/iop/highlights/common.h.

◆ DT_HL_SPARSE_SOLVE

#define DT_HL_SPARSE_SOLVE   1

Definition at line 380 of file src/iop/highlights/common.h.

◆ HL_GAUSS_SLOTS

#define HL_GAUSS_SLOTS   4

Definition at line 169 of file src/iop/highlights/common.h.

◆ HL_PFOR

#define HL_PFOR (   ...)    __OMP_PARALLEL_FOR__(__VA_ARGS__)

Definition at line 80 of file src/iop/highlights/common.h.

◆ MAX_NUM_SCALES

#define MAX_NUM_SCALES   12

Definition at line 681 of file src/iop/highlights/common.h.

◆ REDUCESIZE

#define REDUCESIZE   64

Definition at line 682 of file src/iop/highlights/common.h.

◆ SQRT12

#define SQRT12   3.4641016151377545870548926830117447339L

Definition at line 685 of file src/iop/highlights/common.h.

◆ SQRT3

#define SQRT3   1.7320508075688772935274463415058723669L

Definition at line 684 of file src/iop/highlights/common.h.

Typedef Documentation

◆ _hl_knee_curve_t

◆ _hl_region_ctx_t

◆ diffuse_reconstruct_variant_t

◆ dt_atrous_wavelets_scales_t

◆ dt_iop_highlights_data_t

◆ dt_iop_highlights_global_data_t

◆ dt_iop_highlights_mode_t

◆ dt_iop_highlights_params_t

Enumeration Type Documentation

◆ diffuse_reconstruct_variant_t

Enumerator
DIFFUSE_RECONSTRUCT_RGB 
DIFFUSE_RECONSTRUCT_CHROMA 

Definition at line 686 of file src/iop/highlights/common.h.

◆ dt_atrous_wavelets_scales_t

Enumerator
WAVELETS_1_SCALE 
WAVELETS_2_SCALE 
WAVELETS_3_SCALE 
WAVELETS_4_SCALE 
WAVELETS_5_SCALE 
WAVELETS_6_SCALE 
WAVELETS_7_SCALE 
WAVELETS_8_SCALE 
WAVELETS_9_SCALE 
WAVELETS_10_SCALE 
WAVELETS_11_SCALE 
WAVELETS_12_SCALE 

Definition at line 496 of file src/iop/highlights/common.h.

◆ dt_iop_highlights_mode_t

Enumerator
DT_IOP_HIGHLIGHTS_CLIP 
DT_IOP_HIGHLIGHTS_LCH 
DT_IOP_HIGHLIGHTS_INPAINT 
DT_IOP_HIGHLIGHTS_LAPLACIAN 
DT_IOP_HIGHLIGHTS_HARMONIC 

Definition at line 487 of file src/iop/highlights/common.h.

◆ wavelets_scale_t

Enumerator
ANY_SCALE 
FIRST_SCALE 
LAST_SCALE 

Definition at line 691 of file src/iop/highlights/common.h.

Function Documentation

◆ _hl_floor_gate()

static float _hl_floor_gate ( const float  clips[4])
inlinestatic

Definition at line 95 of file src/iop/highlights/common.h.

References t.

Referenced by _harmonic_reconstruct_cl(), _harmonic_reconstruct_host(), and process_harmonic().

◆ _hl_floor_worth()

static float _hl_floor_worth ( const float  chroma_gain)
inlinestatic

Definition at line 256 of file src/iop/highlights/common.h.

References CF_JOINT_TAU, and t.

Referenced by _cf_reconstruct(), and _selfdome().

◆ _hl_region_worth()

static float _hl_region_worth ( const float  region_benefit)
inlinestatic

Definition at line 239 of file src/iop/highlights/common.h.

References CF_REGION_HI, CF_REGION_LO, and t.

Referenced by _cf_reconstruct().

◆ _hl_ring_flat_mean_vote()

static float _hl_ring_flat_mean_vote ( const float *const restrict  estimate,
const float *const restrict  valid,
const dt_aligned_pixel_t  cmean,
const size_t  region_pixels 
)
inlinestatic

Definition at line 117 of file src/iop/highlights/common.h.

References double(), i, and t.

Referenced by _joint_core(), and _selfdome().