Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
hazeremoval.c File Reference
#include "widgets/bauhaus.h"
#include "pixel/box_filters.h"
#include "system/macros.h"
#include "system/openmp.h"
#include "system/target_clones.h"
#include "system/mem_alloc.h"
#include "common/logging.h"
#include "common/module_versioning.h"
#include "caches/pixelpipe_cache_alloc.h"
#include "pixel/guided_filter.h"
#include "control/signal.h"
#include "develop/imageop.h"
#include "develop/imageop_math.h"
#include "develop/imageop_gui.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:

Go to the source code of this file.

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

typedef struct const_rgb_image const_rgb_image

◆ dt_iop_hazeremoval_data_t

◆ dt_iop_hazeremoval_global_data_t

typedef struct dt_iop_hazeremoval_global_data_t dt_iop_hazeremoval_global_data_t

◆ dt_iop_hazeremoval_gui_data_t

typedef struct dt_iop_hazeremoval_gui_data_t dt_iop_hazeremoval_gui_data_t

◆ dt_iop_hazeremoval_params_t

typedef struct dt_iop_hazeremoval_params_t dt_iop_hazeremoval_params_t

◆ rgb_image

typedef struct rgb_image rgb_image

◆ rgb_pixel

typedef float rgb_pixel[3]

Definition at line 89 of file hazeremoval.c.

◆ tile

typedef struct tile tile

Function Documentation

◆ _current_preview_hash()

◆ _history_resync_callback()

void _history_resync_callback ( gpointer instance,
gpointer user_data )
static

◆ aliases()

const char * aliases ( )

Definition at line 135 of file hazeremoval.c.

◆ ambient_light()

◆ ambient_light_cl()

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 )

Definition at line 174 of file hazeremoval.c.

References dt_free_align, piece, and pipe.

◆ commit_params()

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 )

Definition at line 101 of file hazeremoval.c.

References memcpy(), params, dt_iop_module_t::params_size, piece, pipe, and TRUE.

◆ dark_channel()

◆ default_colorspace()

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

Definition at line 161 of file hazeremoval.c.

References IOP_CS_RGB, piece, and pipe.

◆ default_group()

int default_group ( )

Definition at line 155 of file hazeremoval.c.

References IOP_GROUP_REPAIR.

◆ dehaze_cl()

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)

Definition at line 140 of file hazeremoval.c.

References dt_iop_set_description().

◆ flags()

int flags ( )

Definition at line 149 of file hazeremoval.c.

References IOP_FLAGS_INCLUDE_IN_STYLES, and IOP_FLAGS_SUPPORTS_BLENDING.

◆ 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

Definition at line 208 of file hazeremoval.c.

References dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), DT_PIXELPIPE_CACHE_HASH_INVALID, and g.

◆ init_global()

◆ init_pipe()

void init_pipe ( struct dt_iop_module_t * self,
dt_dev_pixelpipe_t * pipe,
dt_dev_pixelpipe_iop_t * piece )

Definition at line 167 of file hazeremoval.c.

References dt_calloc_align(), piece, and pipe.

◆ name()

const char * name ( )

Definition at line 129 of file hazeremoval.c.

◆ partition()

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

Definition at line 360 of file hazeremoval.c.

References i, and pointer_swap_f().

Referenced by code_health::collect_git(), and quick_select().

◆ pointer_swap_f()

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

Definition at line 303 of file hazeremoval.c.

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 )

Definition at line 385 of file hazeremoval.c.

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

Definition at line 790 of file hazeremoval.c.

References piece, and pipe.

◆ transition_map()

__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()

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