Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
exposure.c File Reference
#include <assert.h>
#include <math.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "bauhaus/bauhaus.h"
#include "common/histogram.h"
#include "common/image_cache.h"
#include "common/mipmap_cache.h"
#include "common/opencl.h"
#include "control/control.h"
#include "develop/develop.h"
#include "develop/imageop.h"
#include "develop/imageop_math.h"
#include "develop/imageop_gui.h"
#include "develop/pixelpipe.h"
#include "dtgtk/paint.h"
#include "dtgtk/resetlabel.h"
#include "gui/gtk.h"
#include "gui/presets.h"
#include "gui/color_picker_proxy.h"
#include "iop/iop_api.h"
+ Include dependency graph for exposure.c:

Data Structures

struct  dt_iop_exposure_params_t
 
struct  dt_iop_exposure_gui_data_t
 
struct  dt_iop_exposure_data_t
 
struct  dt_iop_exposure_global_data_t
 

Macros

#define exposure2white(x)   exp2f(-(x))
 
#define white2exposure(x)   -dt_log2f(fmaxf(1e-20f, x))
 
#define DEFLICKER_BINS_COUNT   (UINT16_MAX + 1)
 

Typedefs

typedef enum dt_iop_exposure_mode_t dt_iop_exposure_mode_t
 
typedef enum dt_spot_mode_t dt_spot_mode_t
 
typedef struct dt_iop_exposure_params_t dt_iop_exposure_params_t
 
typedef struct dt_iop_exposure_gui_data_t dt_iop_exposure_gui_data_t
 
typedef struct dt_iop_exposure_data_t dt_iop_exposure_data_t
 
typedef struct dt_iop_exposure_global_data_t dt_iop_exposure_global_data_t
 

Enumerations

enum  dt_iop_exposure_mode_t {
  EXPOSURE_MODE_MANUAL ,
  EXPOSURE_MODE_DEFLICKER
}
 
enum  dt_spot_mode_t {
  DT_SPOT_MODE_CORRECT = 0 ,
  DT_SPOT_MODE_MEASURE = 1 ,
  DT_SPOT_MODE_LAST
}
 

Functions

const char * name ()
 
const char ** description (struct dt_iop_module_t *self)
 
int default_group ()
 
int flags ()
 
int default_colorspace (dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
 
static float _exposure_proxy_get_exposure (struct dt_iop_module_t *self)
 
static float _exposure_proxy_get_black (struct dt_iop_module_t *self)
 
static void _paint_hue (dt_iop_module_t *self)
 
static void _exposure_set_black (struct dt_iop_module_t *self, const float black)
 
int legacy_params (dt_iop_module_t *self, const void *const old_params, const int old_version, void *new_params, const int new_version)
 
void init_presets (dt_iop_module_so_t *self)
 
static void _deflicker_prepare_histogram (dt_iop_module_t *self, uint32_t **histogram, dt_dev_histogram_stats_t *histogram_stats)
 
static double _raw_to_ev (uint32_t raw, uint32_t black_level, uint32_t white_level)
 
static void _compute_correction (dt_iop_module_t *self, dt_iop_params_t *p1, dt_dev_pixelpipe_t *pipe, const uint32_t *const histogram, const dt_dev_histogram_stats_t *const histogram_stats, float *correction)
 
static void _process_common_setup (dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece)
 
void process (struct dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, const void *const i, void *const o, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out)
 
static float _get_exposure_bias (const struct dt_iop_module_t *self)
 
void commit_params (struct dt_iop_module_t *self, dt_iop_params_t *p1, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
 
void init_pipe (struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
 
void cleanup_pipe (struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
 
static void _autoexp_disable (dt_iop_module_t *self)
 
void gui_update (struct dt_iop_module_t *self)
 
void init_global (dt_iop_module_so_t *module)
 
void cleanup_global (dt_iop_module_so_t *module)
 
static void _exposure_set_white (struct dt_iop_module_t *self, const float white)
 
static void _auto_set_exposure (dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe)
 
void color_picker_apply (dt_iop_module_t *self, GtkWidget *picker, dt_dev_pixelpipe_iop_t *piece)
 
void gui_changed (dt_iop_module_t *self, GtkWidget *w, void *previous)
 
static gboolean _draw (GtkWidget *widget, cairo_t *cr, dt_iop_module_t *self)
 
static gboolean _target_color_draw (GtkWidget *widget, cairo_t *crf, gpointer user_data)
 
static gboolean _origin_color_draw (GtkWidget *widget, cairo_t *crf, gpointer user_data)
 
static void _spot_settings_changed_callback (GtkWidget *slider, dt_iop_module_t *self)
 
void gui_reset (struct dt_iop_module_t *self)
 
void gui_init (struct dt_iop_module_t *self)
 
void gui_cleanup (struct dt_iop_module_t *self)
 

Macro Definition Documentation

◆ DEFLICKER_BINS_COUNT

#define DEFLICKER_BINS_COUNT   (UINT16_MAX + 1)

◆ exposure2white

#define exposure2white (   x)    exp2f(-(x))

◆ white2exposure

#define white2exposure (   x)    -dt_log2f(fmaxf(1e-20f, x))

Typedef Documentation

◆ dt_iop_exposure_data_t

◆ dt_iop_exposure_global_data_t

◆ dt_iop_exposure_gui_data_t

◆ dt_iop_exposure_mode_t

◆ dt_iop_exposure_params_t

◆ dt_spot_mode_t

Enumeration Type Documentation

◆ dt_iop_exposure_mode_t

Enumerator
EXPOSURE_MODE_MANUAL 
EXPOSURE_MODE_DEFLICKER 

◆ dt_spot_mode_t

Enumerator
DT_SPOT_MODE_CORRECT 
DT_SPOT_MODE_MEASURE 
DT_SPOT_MODE_LAST 

Function Documentation

◆ _auto_set_exposure()

◆ _autoexp_disable()

static void _autoexp_disable ( dt_iop_module_t self)
static

References dt_iop_color_picker_reset(), and TRUE.

Referenced by gui_changed(), and gui_update().

◆ _compute_correction()

◆ _deflicker_prepare_histogram()

◆ _draw()

static gboolean _draw ( GtkWidget *  widget,
cairo_t *  cr,
dt_iop_module_t self 
)
static

◆ _exposure_proxy_get_black()

static float _exposure_proxy_get_black ( struct dt_iop_module_t self)
static

References dt_iop_module_t::params.

Referenced by gui_init().

◆ _exposure_proxy_get_exposure()

static float _exposure_proxy_get_exposure ( struct dt_iop_module_t self)
static

◆ _exposure_set_black()

◆ _exposure_set_white()

◆ _get_exposure_bias()

static float _get_exposure_bias ( const struct dt_iop_module_t self)
static

◆ _origin_color_draw()

static gboolean _origin_color_draw ( GtkWidget *  widget,
cairo_t *  crf,
gpointer  user_data 
)
static

◆ _paint_hue()

◆ _process_common_setup()

◆ _raw_to_ev()

static double _raw_to_ev ( uint32_t  raw,
uint32_t  black_level,
uint32_t  white_level 
)
static

References MAX.

Referenced by _compute_correction().

◆ _spot_settings_changed_callback()

◆ _target_color_draw()

static gboolean _target_color_draw ( GtkWidget *  widget,
cairo_t *  crf,
gpointer  user_data 
)
static

◆ cleanup_global()

◆ cleanup_pipe()

void cleanup_pipe ( struct dt_iop_module_t self,
dt_dev_pixelpipe_t pipe,
dt_dev_pixelpipe_iop_t piece 
)

◆ color_picker_apply()

void color_picker_apply ( dt_iop_module_t self,
GtkWidget *  picker,
dt_dev_pixelpipe_iop_t piece 
)

◆ commit_params()

◆ default_colorspace()

int default_colorspace ( dt_iop_module_t self,
dt_dev_pixelpipe_t pipe,
dt_dev_pixelpipe_iop_t piece 
)

References IOP_CS_RGB.

◆ default_group()

int default_group ( )

References IOP_GROUP_TONES.

◆ description()

const char ** description ( struct dt_iop_module_t self)

◆ flags()

int flags ( )

◆ gui_changed()

◆ gui_cleanup()

◆ gui_init()

◆ gui_reset()

void gui_reset ( struct dt_iop_module_t self)

◆ gui_update()

◆ init_global()

◆ init_pipe()

◆ init_presets()

◆ legacy_params()

◆ name()

const char * name ( )

◆ process()