![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "bauhaus/bauhaus.h"#include "common/bspline.h"#include "common/darktable.h"#include "common/dwt.h"#include "common/gaussian.h"#include "common/image.h"#include "common/imagebuf.h"#include "common/iop_profile.h"#include "common/opencl.h"#include "control/control.h"#include "develop/develop.h"#include "develop/imageop_gui.h"#include "develop/imageop_math.h"#include "develop/noise_generator.h"#include "develop/openmp_maths.h"#include "develop/tiling.h"#include "dtgtk/button.h"#include "dtgtk/drawingarea.h"#include "dtgtk/expander.h"#include "dtgtk/paint.h"#include "gui/gtk.h"#include "gui/presets.h"#include "iop/iop_api.h"
Include dependency graph for diffuse.c:Data Structures | |
| struct | dt_iop_diffuse_params_t |
| struct | dt_iop_diffuse_gui_data_t |
| struct | dt_iop_diffuse_global_data_t |
Macros | |
| #define | DEBUG_DUMP_PFM 0 |
| #define | DIFFUSE_V3 0 |
| #define | MAX_NUM_SCALES 10 |
| #define | H 1 |
| #define | KAPPA 0.25f |
Typedefs | |
| typedef struct dt_iop_diffuse_params_t | dt_iop_diffuse_params_t |
| typedef struct dt_iop_diffuse_gui_data_t | dt_iop_diffuse_gui_data_t |
| typedef struct dt_iop_diffuse_global_data_t | dt_iop_diffuse_global_data_t |
| typedef struct dt_iop_diffuse_params_t | dt_iop_diffuse_data_t |
| typedef enum dt_isotropy_t | dt_isotropy_t |
Enumerations | |
| enum | dt_isotropy_t { DT_ISOTROPY_ISOTROPE = 0 , DT_ISOTROPY_ISOPHOTE = 1 , DT_ISOTROPY_GRADIENT = 2 } |
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) |
| static dt_isotropy_t | check_isotropy_mode (const float anisotropy) |
| const char * | name () |
| const char * | aliases () |
| 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, const dt_dev_pixelpipe_iop_t *piece) |
| 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) |
| 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 __DT_CLONE_TARGETS__ void | init_reconstruct (float *const restrict reconstructed, const size_t width, const size_t height) |
| static | __attribute__ ((always_inline)) |
| static __DT_CLONE_TARGETS__ void | heat_PDE_diffusion (const float *const restrict high_freq, const float *const restrict low_freq, const uint8_t *const restrict mask, const int has_mask, float *const restrict output, const size_t width, const size_t height, const dt_aligned_pixel_simd_t anisotropy, const dt_isotropy_t isotropy_type[4], const float variance_threshold, const int mult, const float normalized_regularization, const dt_aligned_pixel_simd_t ABCD, const float strength, const int use_nontemporal) |
| static float | compute_anisotropy_factor (const float user_param) |
| static __DT_CLONE_TARGETS__ int | wavelets_process (const float *const restrict in, float *const restrict reconstructed, const uint8_t *const restrict mask, const size_t width, const size_t height, const dt_iop_diffuse_data_t *const data, const float zoom, const int scales, const int has_mask, float *const restrict HF[10], float *const restrict LF_odd, float *const restrict LF_even) |
| static __DT_CLONE_TARGETS__ void | build_mask (const float *const restrict input, uint8_t *const restrict mask, const float threshold, const size_t width, const size_t height) |
| static __DT_CLONE_TARGETS__ void | inpaint_mask (float *const restrict inpainted, const float *const restrict original, const uint8_t *const restrict mask, const size_t width, const size_t height) |
| __DT_CLONE_TARGETS__ int | process (dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, const void *const restrict ivoid, void *const restrict ovoid) |
| static cl_int | wavelets_process_cl (const int devid, cl_mem in, cl_mem reconstructed, cl_mem mask, const size_t sizes[3], const int width, const int height, const dt_iop_diffuse_data_t *const data, dt_iop_diffuse_global_data_t *const gd, const float zoom, const int scales, const int has_mask, cl_mem HF[10], cl_mem LF_odd, cl_mem LF_even) |
| int | process_cl (struct dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, cl_mem dev_in, cl_mem dev_out) |
| void | init_global (dt_iop_module_so_t *module) |
| void | cleanup_global (dt_iop_module_so_t *module) |
| void | gui_init (struct dt_iop_module_t *self) |
| #define DEBUG_DUMP_PFM 0 |
| #define DIFFUSE_V3 0 |
| float H 1 |
| #define KAPPA 0.25f |
| #define MAX_NUM_SCALES 10 |
| typedef struct dt_iop_diffuse_params_t dt_iop_diffuse_data_t |
| typedef struct dt_iop_diffuse_global_data_t dt_iop_diffuse_global_data_t |
| typedef struct dt_iop_diffuse_gui_data_t dt_iop_diffuse_gui_data_t |
| typedef struct dt_iop_diffuse_params_t dt_iop_diffuse_params_t |
| typedef enum dt_isotropy_t dt_isotropy_t |
| enum dt_isotropy_t |
|
inlinestatic |
References dt_simd_set1().
| const char * aliases | ( | ) |
|
inlinestatic |
|
inlinestatic |
References DT_ISOTROPY_GRADIENT, DT_ISOTROPY_ISOPHOTE, and DT_ISOTROPY_ISOTROPE.
Referenced by wavelets_process(), and wavelets_process_cl().
| void cleanup_global | ( | dt_iop_module_so_t * | module | ) |
References dt_iop_module_so_t::data, dt_free, dt_opencl_free_kernel(), dt_iop_diffuse_global_data_t::kernel_diffuse_build_mask, dt_iop_diffuse_global_data_t::kernel_diffuse_inpaint_mask, dt_iop_diffuse_global_data_t::kernel_diffuse_pde, dt_iop_diffuse_global_data_t::kernel_filmic_bspline_horizontal, dt_iop_diffuse_global_data_t::kernel_filmic_bspline_horizontal_local, dt_iop_diffuse_global_data_t::kernel_filmic_bspline_vertical, dt_iop_diffuse_global_data_t::kernel_filmic_bspline_vertical_local, and dt_iop_diffuse_global_data_t::kernel_filmic_wavelets_detail.
| 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 | ||
| ) |
|
inlinestatic |
Referenced by wavelets_process(), and wavelets_process_cl().
| 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_SHARPNESS.
| const char ** description | ( | struct dt_iop_module_t * | self | ) |
References dt_iop_set_description().
| int flags | ( | ) |
References IOP_FLAGS_ALLOW_TILING, IOP_FLAGS_INCLUDE_IN_STYLES, and IOP_FLAGS_SUPPORTS_BLENDING.
| void gui_init | ( | struct dt_iop_module_t * | self | ) |
|
inlinestatic |
References __OMP_PARALLEL_FOR__, ABCD, c2, DT_IS_ALIGNED, dt_omploop_sfence, dt_simd_set1(), dt_store_simd_aligned(), dwt_interleave_rows(), for_each_channel, H, height, i, k, MAX, MIN, out, row, strength(), and width.
Referenced by wavelets_process().
| void init_global | ( | dt_iop_module_so_t * | module | ) |
References dt_opencl_create_kernel(), dt_iop_diffuse_global_data_t::kernel_diffuse_build_mask, dt_iop_diffuse_global_data_t::kernel_diffuse_inpaint_mask, dt_iop_diffuse_global_data_t::kernel_diffuse_pde, dt_iop_diffuse_global_data_t::kernel_filmic_bspline_horizontal, dt_iop_diffuse_global_data_t::kernel_filmic_bspline_horizontal_local, dt_iop_diffuse_global_data_t::kernel_filmic_bspline_vertical, dt_iop_diffuse_global_data_t::kernel_filmic_bspline_vertical_local, and dt_iop_diffuse_global_data_t::kernel_filmic_wavelets_detail.
| void init_presets | ( | dt_iop_module_so_t * | self | ) |
References DEVELOP_BLEND_CS_RGB_SCENE, dt_gui_presets_add_generic(), dt_iop_module_so_t::op, and p.
|
inlinestatic |
References __OMP_PARALLEL_FOR_SIMD__, height, k, and width.
|
inlinestatic |
References __OMP_PARALLEL_FOR__, DT_ALIGNED_ARRAY, for_four_channels, height, i, k, splitmix32(), state, width, and xoshiro128plus().
Referenced by process().
| int legacy_params | ( | dt_iop_module_t * | self, |
| const void *const | old_params, | ||
| const int | old_version, | ||
| void * | new_params, | ||
| const int | new_version | ||
| ) |
References d, dt_iop_module_t::default_params, n, and threshold.
| const char * name | ( | ) |
Referenced by wavelets_process().
| __DT_CLONE_TARGETS__ int process | ( | dt_iop_module_t * | self, |
| const dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece, | ||
| const void *const restrict | ivoid, | ||
| void *const restrict | ovoid | ||
| ) |
References B_SPLINE_SIGMA, build_mask(), dt_dev_pixelpipe_iop_t::data, dt_dev_get_module_scale(), DT_IS_ALIGNED, dt_pixelpipe_cache_alloc_align, dt_pixelpipe_cache_alloc_align_float, dt_pixelpipe_cache_free_align, error(), dt_iop_roi_t::height, inpaint_mask(), IS_NULL_PTR, dt_iop_diffuse_params_t::iterations, MAX, MAX_NUM_SCALES, num_steps_to_reach_equivalent_sigma(), out, ovoid, dt_iop_diffuse_params_t::radius, dt_iop_diffuse_params_t::radius_center, dt_dev_pixelpipe_iop_t::roi_in, dt_dev_pixelpipe_iop_t::roi_out, dt_iop_diffuse_params_t::threshold, TRUE, wavelets_process(), 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 | dev_in, | ||
| cl_mem | dev_out | ||
| ) |
References B_SPLINE_SIGMA, dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_t::devid, DT_DEBUG_OPENCL, dt_dev_get_module_scale(), dt_opencl_alloc_device(), dt_opencl_enqueue_kernel_2d(), dt_opencl_release_mem_object(), dt_opencl_set_kernel_arg(), dt_print(), error(), FALSE, dt_iop_module_t::global_data, height, dt_iop_roi_t::height, IS_NULL_PTR, dt_iop_diffuse_params_t::iterations, dt_iop_diffuse_global_data_t::kernel_diffuse_build_mask, dt_iop_diffuse_global_data_t::kernel_diffuse_inpaint_mask, MAX, MAX_NUM_SCALES, num_steps_to_reach_equivalent_sigma(), dt_iop_diffuse_params_t::radius, dt_iop_diffuse_params_t::radius_center, dt_dev_pixelpipe_iop_t::roi_in, dt_dev_pixelpipe_iop_t::roi_out, ROUNDUPDHT, ROUNDUPDWD, dt_iop_diffuse_params_t::threshold, TRUE, wavelets_process_cl(), width, and dt_iop_roi_t::width.
| 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 | ||
| ) |
References B_SPLINE_SIGMA, dt_dev_pixelpipe_iop_t::data, dt_dev_get_module_scale(), MAX_NUM_SCALES, num_steps_to_reach_equivalent_sigma(), dt_iop_diffuse_params_t::radius, dt_iop_diffuse_params_t::radius_center, and dt_dev_pixelpipe_iop_t::roi_in.
|
inlinestatic |
References ABCD, dt_iop_diffuse_params_t::anisotropy_first, dt_iop_diffuse_params_t::anisotropy_fourth, dt_iop_diffuse_params_t::anisotropy_second, dt_iop_diffuse_params_t::anisotropy_third, B_SPLINE_SIGMA, check_isotropy_mode(), compute_anisotropy_factor(), decompose_2D_Bspline(), DT_ALIGNED_PIXEL, dt_pixelpipe_cache_alloc_perthread_float, dt_pixelpipe_cache_free_align, equivalent_sigma_at_step(), dt_iop_diffuse_params_t::first, dt_iop_diffuse_params_t::fourth, heat_PDE_diffusion(), height, IS_NULL_PTR, KAPPA, name(), dt_iop_diffuse_params_t::radius, dt_iop_diffuse_params_t::radius_center, dt_iop_diffuse_params_t::regularization, dt_iop_diffuse_params_t::second, dt_iop_diffuse_params_t::sharpness, strength(), dt_iop_diffuse_params_t::third, dt_iop_diffuse_params_t::variance_threshold, and width.
Referenced by process().
|
inlinestatic |
References ABCD, dt_iop_diffuse_params_t::anisotropy_first, dt_iop_diffuse_params_t::anisotropy_fourth, dt_iop_diffuse_params_t::anisotropy_second, dt_iop_diffuse_params_t::anisotropy_third, B_SPLINE_SIGMA, check_isotropy_mode(), compute_anisotropy_factor(), DT_ALIGNED_PIXEL, dt_opencl_enqueue_kernel_2d(), dt_opencl_enqueue_kernel_2d_with_local(), dt_opencl_local_buffer_opt(), dt_opencl_set_kernel_arg(), equivalent_sigma_at_step(), dt_iop_diffuse_params_t::first, dt_iop_diffuse_params_t::fourth, height, KAPPA, dt_iop_diffuse_global_data_t::kernel_diffuse_pde, dt_iop_diffuse_global_data_t::kernel_filmic_bspline_horizontal, dt_iop_diffuse_global_data_t::kernel_filmic_bspline_horizontal_local, dt_iop_diffuse_global_data_t::kernel_filmic_bspline_vertical, dt_iop_diffuse_global_data_t::kernel_filmic_bspline_vertical_local, dt_iop_diffuse_global_data_t::kernel_filmic_wavelets_detail, dt_iop_diffuse_params_t::radius, dt_iop_diffuse_params_t::radius_center, dt_iop_diffuse_params_t::regularization, ROUNDUP, ROUNDUPDHT, ROUNDUPDWD, dt_iop_diffuse_params_t::second, dt_iop_diffuse_params_t::sharpness, dt_opencl_local_buffer_t::sizex, dt_opencl_local_buffer_t::sizey, strength(), dt_iop_diffuse_params_t::third, dt_iop_diffuse_params_t::variance_threshold, width, and dt_opencl_local_buffer_t::xoffset.
Referenced by process_cl().