![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#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 struct const_rgb_image const_rgb_image |
| typedef struct dt_iop_hazeremoval_global_data_t dt_iop_hazeremoval_global_data_t |
| typedef struct dt_iop_hazeremoval_gui_data_t dt_iop_hazeremoval_gui_data_t |
| typedef struct dt_iop_hazeremoval_params_t dt_iop_hazeremoval_params_t |
| typedef float rgb_pixel[3] |
|
static |
References dt_iop_module_t::dev, dt_dev_distort_get_iop_pipe(), DT_PIXELPIPE_CACHE_HASH_INVALID, dt_dev_pixelpipe_iop_t::enabled, dt_dev_pixelpipe_iop_t::global_hash, dt_iop_roi_t::height, IS_NULL_PTR, dt_develop_t::preview_pipe, dt_dev_pixelpipe_iop_t::roi_in, and dt_iop_roi_t::width.
Referenced by _history_resync_callback().
|
static |
References _current_preview_hash(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), g, dt_iop_module_t::gui_data, IS_NULL_PTR, and void().
Referenced by gui_cleanup(), and gui_init().
| const char * aliases | ( | ) |
|
static |
References __OMP_PARALLEL_FOR__, copy_gray_image(), dark_channel(), gray_image::data, const_rgb_image::data, error(), free_gray_image(), height, const_rgb_image::height, i, new_gray_image(), p, quick_select(), size, const_rgb_image::stride, w1, width, and const_rgb_image::width.
Referenced by ambient_light_cl(), and process().
|
static |
References ambient_light(), dt_opencl_get_image_element_size(), dt_opencl_get_image_height(), dt_opencl_get_image_width(), dt_opencl_read_host_from_device(), dt_pixelpipe_cache_alloc_align_float_cache, dt_pixelpipe_cache_free_align, error(), height, IS_NULL_PTR, w1, and width.
Referenced by process_cl().
|
static |
References DT_DEBUG_OPENCL, dt_opencl_alloc_device(), dt_opencl_enqueue_kernel_2d(), dt_opencl_get_image_height(), dt_opencl_get_image_width(), dt_opencl_release_mem_object(), dt_opencl_set_kernel_arg(), dt_print(), error(), dt_iop_module_t::global_data, height, dt_iop_hazeremoval_global_data_t::kernel_hazeremoval_box_max_x, dt_iop_hazeremoval_global_data_t::kernel_hazeremoval_box_max_y, out, ROUNDUPDHT, ROUNDUPDWD, and width.
Referenced by transition_map_cl().
|
static |
References DT_DEBUG_OPENCL, dt_opencl_alloc_device(), dt_opencl_enqueue_kernel_2d(), dt_opencl_get_image_height(), dt_opencl_get_image_width(), dt_opencl_release_mem_object(), dt_opencl_set_kernel_arg(), dt_print(), error(), dt_iop_module_t::global_data, height, dt_iop_hazeremoval_global_data_t::kernel_hazeremoval_box_min_x, dt_iop_hazeremoval_global_data_t::kernel_hazeremoval_box_min_y, out, ROUNDUPDHT, ROUNDUPDWD, and width.
Referenced by process_cl().
| void cleanup_global | ( | dt_iop_module_so_t * | self | ) |
References dt_iop_module_so_t::data, dt_free, dt_opencl_free_kernel(), dt_iop_hazeremoval_global_data_t::kernel_hazeremoval_box_max_x, dt_iop_hazeremoval_global_data_t::kernel_hazeremoval_box_max_y, dt_iop_hazeremoval_global_data_t::kernel_hazeremoval_box_min_x, dt_iop_hazeremoval_global_data_t::kernel_hazeremoval_box_min_y, dt_iop_hazeremoval_global_data_t::kernel_hazeremoval_dehaze, and dt_iop_hazeremoval_global_data_t::kernel_hazeremoval_transision_map.
| void cleanup_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
References dt_dev_pixelpipe_iop_t::data, and dt_free_align.
| 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 | ||
| ) |
|
static |
References __OMP_PARALLEL_FOR__, gray_image::data, const_rgb_image::data, dt_box_min(), gray_image::height, const_rgb_image::height, i, m, size, const_rgb_image::stride, gray_image::width, and const_rgb_image::width.
Referenced by ambient_light().
| int default_colorspace | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
References IOP_CS_RGB.
| int default_group | ( | ) |
References IOP_GROUP_REPAIR.
|
static |
References DT_DEBUG_OPENCL, dt_opencl_enqueue_kernel_2d(), dt_opencl_get_image_height(), dt_opencl_get_image_width(), dt_opencl_set_kernel_arg(), dt_print(), dt_iop_module_t::global_data, height, kernel(), dt_iop_hazeremoval_global_data_t::kernel_hazeremoval_dehaze, ROUNDUPDHT, ROUNDUPDWD, and width.
Referenced by process_cl().
| const char ** description | ( | struct dt_iop_module_t * | self | ) |
References dt_iop_set_description().
| int flags | ( | ) |
References IOP_FLAGS_INCLUDE_IN_STYLES, and IOP_FLAGS_SUPPORTS_BLENDING.
| void gui_cleanup | ( | dt_iop_module_t * | self | ) |
| void gui_init | ( | dt_iop_module_t * | self | ) |
| void gui_update | ( | struct dt_iop_module_t * | self | ) |
Refresh GUI controls from current params and configuration.
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.
| void init_global | ( | dt_iop_module_so_t * | self | ) |
References dt_iop_module_so_t::data, dt_opencl_create_kernel(), dt_iop_hazeremoval_global_data_t::kernel_hazeremoval_box_max_x, dt_iop_hazeremoval_global_data_t::kernel_hazeremoval_box_max_y, dt_iop_hazeremoval_global_data_t::kernel_hazeremoval_box_min_x, dt_iop_hazeremoval_global_data_t::kernel_hazeremoval_box_min_y, dt_iop_hazeremoval_global_data_t::kernel_hazeremoval_dehaze, and dt_iop_hazeremoval_global_data_t::kernel_hazeremoval_transision_map.
| void init_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
References dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_iop_t::data_size, and dt_calloc_align().
| const char * name | ( | ) |
|
static |
References i, and pointer_swap_f().
Referenced by quick_select().
|
inlinestatic |
References t.
Referenced by partition(), and quick_select().
| __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 | ||
| ) |
References __OMP_PARALLEL_FOR__, ambient_light(), ch, dt_iop_buffer_dsc_t::channels, d, gray_image::data, dt_dev_pixelpipe_iop_t::data, rgb_image::data, const_rgb_image::data, dt_iop_module_t::dev, dt_dev_pixelpipe_iop_t::dsc_in, dt_box_min(), DT_DEV_PIXELPIPE_DISPLAY_MASK, dt_dev_pixelpipe_has_preview_output(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), DT_PIXELPIPE_CACHE_HASH_INVALID, eps, error(), free_gray_image(), g, dt_dev_pixelpipe_iop_t::global_hash, dt_develop_t::gui_attached, dt_iop_module_t::gui_data, guided_filter(), height, gray_image::height, dt_iop_roi_t::height, i, IS_NULL_PTR, dt_dev_pixelpipe_t::mask_display, new_gray_image(), ovoid, dt_dev_pixelpipe_iop_t::roi_in, dt_dev_pixelpipe_iop_t::roi_out, size, strength(), rgb_image::stride, const_rgb_image::stride, t, transition_map(), w1, w2, width, gray_image::width, and dt_iop_roi_t::width.
| 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 | ||
| ) |
References ambient_light_cl(), box_min_cl(), ch, dt_iop_buffer_dsc_t::channels, d, dt_dev_pixelpipe_iop_t::data, dehaze_cl(), dt_iop_module_t::dev, dt_dev_pixelpipe_t::devid, dt_dev_pixelpipe_iop_t::dsc_in, dt_dev_pixelpipe_has_preview_output(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_opencl_alloc_device(), dt_opencl_release_mem_object(), DT_PIXELPIPE_CACHE_HASH_INVALID, eps, FALSE, g, dt_dev_pixelpipe_iop_t::global_hash, dt_develop_t::gui_attached, dt_iop_module_t::gui_data, guided_filter_cl(), height, dt_iop_roi_t::height, dt_dev_pixelpipe_iop_t::roi_in, dt_dev_pixelpipe_iop_t::roi_out, strength(), transition_map_cl(), TRUE, w1, w2, width, and dt_iop_roi_t::width.
| __DT_CLONE_TARGETS__ void quick_select | ( | float * | first, |
| float * | nth, | ||
| float * | last | ||
| ) |
References partition(), and pointer_swap_f().
Referenced by ambient_light().
| 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 | ||
| ) |
|
static |
References __OMP_PARALLEL_FOR__, gray_image::data, const_rgb_image::data, dt_box_max(), gray_image::height, const_rgb_image::height, i, m, size, strength(), const_rgb_image::stride, gray_image::width, and const_rgb_image::width.
Referenced by process().
|
static |
References box_max_cl(), DT_DEBUG_OPENCL, dt_opencl_enqueue_kernel_2d(), dt_opencl_get_image_height(), dt_opencl_get_image_width(), dt_opencl_set_kernel_arg(), dt_print(), dt_iop_module_t::global_data, height, kernel(), dt_iop_hazeremoval_global_data_t::kernel_hazeremoval_transision_map, ROUNDUPDHT, ROUNDUPDWD, strength(), w1, and width.
Referenced by process_cl().