Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
hazeremoval.c File Reference
#include "bauhaus/bauhaus.h"
#include "common/box_filters.h"
#include "common/darktable.h"
#include "common/guided_filter.h"
#include "control/control.h"
#include "control/signal.h"
#include "develop/imageop.h"
#include "develop/imageop_math.h"
#include "develop/imageop_gui.h"
#include "gui/gtk.h"
#include "develop/tiling.h"
#include "iop/iop_api.h"
#include "common/opencl.h"
#include <float.h>
#include <gtk/gtk.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
+ Include dependency graph for hazeremoval.c:

Data Structures

struct  dt_iop_hazeremoval_params_t
 
struct  dt_iop_hazeremoval_gui_data_t
 
struct  dt_iop_hazeremoval_global_data_t
 
struct  tile
 
struct  rgb_image
 
struct  const_rgb_image
 

Typedefs

typedef float rgb_pixel[3]
 
typedef struct dt_iop_hazeremoval_params_t dt_iop_hazeremoval_params_t
 
typedef dt_iop_hazeremoval_params_t dt_iop_hazeremoval_data_t
 
typedef struct dt_iop_hazeremoval_gui_data_t dt_iop_hazeremoval_gui_data_t
 
typedef struct dt_iop_hazeremoval_global_data_t dt_iop_hazeremoval_global_data_t
 
typedef struct tile tile
 
typedef struct rgb_image rgb_image
 
typedef struct const_rgb_image const_rgb_image
 

Functions

void commit_params (struct dt_iop_module_t *self, dt_iop_params_t *params, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
 
const char * name ()
 
const char * aliases ()
 
const char ** description (struct dt_iop_module_t *self)
 
int flags ()
 
int default_group ()
 
int default_colorspace (dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, const 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)
 
void init_global (dt_iop_module_so_t *self)
 
void cleanup_global (dt_iop_module_so_t *self)
 
void gui_update (struct dt_iop_module_t *self)
 Refresh GUI controls from current params and configuration.
 
static uint64_t _current_preview_hash (dt_iop_module_t *self)
 
static void _history_resync_callback (gpointer instance, gpointer user_data)
 
void gui_init (dt_iop_module_t *self)
 
void gui_cleanup (dt_iop_module_t *self)
 
static void pointer_swap_f (float *a, float *b)
 
static __DT_CLONE_TARGETS__ int dark_channel (const const_rgb_image img1, const gray_image img2, const int w)
 
static __DT_CLONE_TARGETS__ int transition_map (const const_rgb_image img1, const gray_image img2, const int w, const float *const A0, const float strength)
 
static float * partition (float *first, float *last, float val)
 
__DT_CLONE_TARGETS__ void quick_select (float *first, float *nth, float *last)
 
static __DT_CLONE_TARGETS__ int ambient_light (const const_rgb_image img, int w1, rgb_pixel *pA0, float *max_depth_out)
 
__DT_CLONE_TARGETS__ int process (struct dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, const void *const ivoid, void *const ovoid)
 
static int ambient_light_cl (struct dt_iop_module_t *self, int devid, cl_mem img, int w1, rgb_pixel *pA0, float *max_depth_out)
 
static int box_min_cl (struct dt_iop_module_t *self, int devid, cl_mem in, cl_mem out, const int w)
 
static int box_max_cl (struct dt_iop_module_t *self, int devid, cl_mem in, cl_mem out, const int w)
 
static int transition_map_cl (struct dt_iop_module_t *self, int devid, cl_mem img1, cl_mem img2, const int w1, const float strength, const float *const A0)
 
static int dehaze_cl (struct dt_iop_module_t *self, int devid, cl_mem img_in, cl_mem trans_map, cl_mem img_out, const float t_min, const float *const A0)
 
void tiling_callback (struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe, const struct dt_dev_pixelpipe_iop_t *piece, struct dt_develop_tiling_t *tiling)
 
int process_cl (struct dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, cl_mem img_in, cl_mem img_out)
 

Typedef Documentation

◆ const_rgb_image

◆ dt_iop_hazeremoval_data_t

◆ dt_iop_hazeremoval_global_data_t

◆ dt_iop_hazeremoval_gui_data_t

◆ dt_iop_hazeremoval_params_t

◆ rgb_image

typedef struct rgb_image rgb_image

◆ rgb_pixel

typedef float rgb_pixel[3]

◆ tile

typedef struct tile tile

Function Documentation

◆ _current_preview_hash()

◆ _history_resync_callback()

static void _history_resync_callback ( gpointer  instance,
gpointer  user_data 
)
static

◆ aliases()

const char * aliases ( )

◆ ambient_light()

◆ ambient_light_cl()

static int ambient_light_cl ( struct dt_iop_module_t self,
int  devid,
cl_mem  img,
int  w1,
rgb_pixel pA0,
float *  max_depth_out 
)
static

◆ box_max_cl()

◆ box_min_cl()

◆ cleanup_global()

◆ cleanup_pipe()

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

◆ commit_params()

◆ dark_channel()

◆ default_colorspace()

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

References IOP_CS_RGB.

◆ default_group()

int default_group ( )

References IOP_GROUP_REPAIR.

◆ dehaze_cl()

static int dehaze_cl ( struct dt_iop_module_t self,
int  devid,
cl_mem  img_in,
cl_mem  trans_map,
cl_mem  img_out,
const float  t_min,
const float *const  A0 
)
static

◆ description()

const char ** description ( struct dt_iop_module_t self)

◆ flags()

◆ gui_cleanup()

◆ gui_init()

◆ gui_update()

void gui_update ( struct dt_iop_module_t self)

Refresh GUI controls from current params and configuration.

Todo:
check why needed
Todo:
by hand

References dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), DT_PIXELPIPE_CACHE_HASH_INVALID, g, and dt_iop_module_t::gui_data.

◆ init_global()

◆ init_pipe()

◆ name()

const char * name ( )

◆ partition()

static float * partition ( float *  first,
float *  last,
float  val 
)
static

References i, and pointer_swap_f().

Referenced by quick_select().

◆ pointer_swap_f()

static void pointer_swap_f ( float *  a,
float *  b 
)
inlinestatic

References t.

Referenced by partition(), and quick_select().

◆ process()

◆ process_cl()

◆ quick_select()

__DT_CLONE_TARGETS__ void quick_select ( float *  first,
float *  nth,
float *  last 
)

References partition(), and pointer_swap_f().

Referenced by ambient_light().

◆ tiling_callback()

void tiling_callback ( struct dt_iop_module_t self,
const struct dt_dev_pixelpipe_t pipe,
const struct dt_dev_pixelpipe_iop_t piece,
struct dt_develop_tiling_t tiling 
)
Todo:
: check if that's sufficiently large

◆ transition_map()

static __DT_CLONE_TARGETS__ int transition_map ( const const_rgb_image  img1,
const gray_image  img2,
const int  w,
const float *const  A0,
const float  strength 
)
static

◆ transition_map_cl()

static int transition_map_cl ( struct dt_iop_module_t self,
int  devid,
cl_mem  img1,
cl_mem  img2,
const int  w1,
const float  strength,
const float *const  A0 
)
static