![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "bauhaus/bauhaus.h"
#include "common/box_filters.h"
#include "common/bspline.h"
#include "common/opencl.h"
#include "common/imagebuf.h"
#include "common/fast_guided_filter.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/noise_generator.h"
#include "develop/tiling.h"
#include "gui/gtk.h"
#include "iop/iop_api.h"
#include <gtk/gtk.h>
#include <inttypes.h>
Data Structures | |
struct | dt_iop_highlights_params_t |
struct | dt_iop_highlights_gui_data_t |
struct | dt_iop_highlights_global_data_t |
Macros | |
#define | MAX_NUM_SCALES 12 |
#define | DS_FACTOR 4 |
#define | DEBUG_DUMP_PFM 0 |
#define | SQRT3 1.7320508075688772935274463415058723669L |
#define | SQRT12 3.4641016151377545870548926830117447339L |
Typedefs | |
typedef enum dt_iop_highlights_mode_t | dt_iop_highlights_mode_t |
typedef enum dt_atrous_wavelets_scales_t | dt_atrous_wavelets_scales_t |
typedef struct dt_iop_highlights_params_t | dt_iop_highlights_params_t |
typedef struct dt_iop_highlights_gui_data_t | dt_iop_highlights_gui_data_t |
typedef dt_iop_highlights_params_t | dt_iop_highlights_data_t |
typedef struct dt_iop_highlights_global_data_t | dt_iop_highlights_global_data_t |
typedef enum diffuse_reconstruct_variant_t | diffuse_reconstruct_variant_t |
Enumerations | |
enum | dt_iop_highlights_mode_t { DT_IOP_HIGHLIGHTS_CLIP = 0 , DT_IOP_HIGHLIGHTS_LCH = 1 , DT_IOP_HIGHLIGHTS_INPAINT = 2 , DT_IOP_HIGHLIGHTS_LAPLACIAN = 3 } |
enum | dt_atrous_wavelets_scales_t { WAVELETS_1_SCALE = 0 , WAVELETS_2_SCALE = 1 , WAVELETS_3_SCALE = 2 , WAVELETS_4_SCALE = 3 , WAVELETS_5_SCALE = 4 , WAVELETS_6_SCALE = 5 , WAVELETS_7_SCALE = 6 , WAVELETS_8_SCALE = 7 , WAVELETS_9_SCALE = 8 , WAVELETS_10_SCALE = 9 , WAVELETS_11_SCALE = 10 , WAVELETS_12_SCALE = 11 } |
enum | diffuse_reconstruct_variant_t { DIFFUSE_RECONSTRUCT_RGB = 0 , DIFFUSE_RECONSTRUCT_CHROMA } |
enum | wavelets_scale_t { ANY_SCALE = 1 << 0 , FIRST_SCALE = 1 << 1 , LAST_SCALE = 1 << 2 } |
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) |
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 | tiling_callback (struct dt_iop_module_t *self, struct dt_dev_pixelpipe_iop_t *piece, const dt_iop_roi_t *roi_in, const dt_iop_roi_t *roi_out, struct dt_develop_tiling_t *tiling) |
static float | interp_pix_xtrans (const int ratio_next, const ssize_t offset_next, const float clip0, const float clip_next, const float *const in, const float *const ratios) |
static void | interpolate_color_xtrans (const void *const ivoid, void *const ovoid, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out, int dim, int dir, int other, const float *const clip, const uint8_t(*const xtrans)[6], const int pass) |
static void | interpolate_color (const void *const ivoid, void *const ovoid, const dt_iop_roi_t *const roi_out, int dim, int dir, int other, const float *clip, const uint32_t filters, const int pass) |
static void | process_lch_bayer (dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, const void *const ivoid, void *const ovoid, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out, const float clip) |
static void | process_lch_xtrans (dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, const void *const ivoid, void *const ovoid, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out, const float clip) |
static void | _interpolate_and_mask (const float *const restrict input, float *const restrict interpolated, float *const restrict clipping_mask, const dt_aligned_pixel_t clips, const dt_aligned_pixel_t wb, const uint32_t filters, const size_t width, const size_t height) |
static void | _remosaic_and_replace (const float *const restrict input, const float *const restrict interpolated, const float *const restrict clipping_mask, float *const restrict output, const dt_aligned_pixel_t wb, const uint32_t filters, const size_t width, const size_t height) |
static uint8_t | scale_type (const int s, const int scales) |
static void | guide_laplacians (const float *const restrict high_freq, const float *const restrict low_freq, const float *const restrict clipping_mask, float *const restrict output, const size_t width, const size_t height, const int mult, const float noise_level, const int salt, const uint8_t scale, const float radius_sq) |
static void | heat_PDE_diffusion (const float *const restrict high_freq, const float *const restrict low_freq, const float *const restrict clipping_mask, float *const restrict output, const size_t width, const size_t height, const int mult, const uint8_t scale, const float first_order_factor) |
static gint | wavelets_process (const float *const restrict in, float *const restrict reconstructed, const float *const restrict clipping_mask, const size_t width, const size_t height, const int scales, float *const restrict HF, float *const restrict LF_odd, float *const restrict LF_even, const diffuse_reconstruct_variant_t variant, const float noise_level, const int salt, const float first_order_factor) |
static void | process_laplacian_bayer (struct dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, const void *const restrict ivoid, void *const restrict ovoid, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out, const dt_aligned_pixel_t clips) |
static void | process_clip (dt_dev_pixelpipe_iop_t *piece, const void *const ivoid, void *const ovoid, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out, const float clip) |
static void | process_visualize (dt_dev_pixelpipe_iop_t *piece, const void *const ivoid, void *const ovoid, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out, const uint32_t filters, dt_iop_highlights_data_t *data) |
void | process (struct dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, const void *const ivoid, void *const ovoid, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out) |
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_global (dt_iop_module_so_t *module) |
void | cleanup_global (dt_iop_module_so_t *module) |
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 | gui_changed (dt_iop_module_t *self, GtkWidget *w, void *previous) |
void | gui_update (struct dt_iop_module_t *self) |
void | reload_defaults (dt_iop_module_t *module) |
static void | _visualize_callback (GtkWidget *quad, gpointer user_data) |
void | gui_focus (struct dt_iop_module_t *self, gboolean in) |
void | gui_init (struct dt_iop_module_t *self) |
#define DEBUG_DUMP_PFM 0 |
#define DS_FACTOR 4 |
#define MAX_NUM_SCALES 12 |
#define SQRT12 3.4641016151377545870548926830117447339L |
#define SQRT3 1.7320508075688772935274463415058723669L |
typedef enum dt_atrous_wavelets_scales_t dt_atrous_wavelets_scales_t |
typedef struct dt_iop_highlights_global_data_t dt_iop_highlights_global_data_t |
typedef struct dt_iop_highlights_gui_data_t dt_iop_highlights_gui_data_t |
typedef enum dt_iop_highlights_mode_t dt_iop_highlights_mode_t |
typedef struct dt_iop_highlights_params_t dt_iop_highlights_params_t |
enum wavelets_scale_t |
|
static |
|
static |
References ALPHA, FC(), height, and width.
Referenced by process_laplacian_bayer().
|
static |
References darktable, dt_iop_module_t::dev, dt_bauhaus_widget_get_quad_active(), dt_dev_invalidate, DT_DEV_PIXELPIPE_DISPLAY_NONE, DT_DEV_PIXELPIPE_DISPLAY_PASSTHRU, dt_dev_refresh_ui_images, dt_iop_set_cache_bypass(), darktable_t::gui, dt_iop_module_t::gui_data, dt_iop_module_t::request_mask_display, and dt_gui_gtk_t::reset.
Referenced by gui_init().
void cleanup_global | ( | dt_iop_module_so_t * | module | ) |
References dt_iop_module_so_t::data, dt_opencl_free_kernel(), dt_iop_highlights_global_data_t::kernel_filmic_bspline_horizontal, dt_iop_highlights_global_data_t::kernel_filmic_bspline_vertical, dt_iop_highlights_global_data_t::kernel_filmic_wavelets_detail, dt_iop_highlights_global_data_t::kernel_highlights_1f_clip, dt_iop_highlights_global_data_t::kernel_highlights_1f_lch_bayer, dt_iop_highlights_global_data_t::kernel_highlights_1f_lch_xtrans, dt_iop_highlights_global_data_t::kernel_highlights_4f_clip, dt_iop_highlights_global_data_t::kernel_highlights_bilinear_and_mask, dt_iop_highlights_global_data_t::kernel_highlights_box_blur, dt_iop_highlights_global_data_t::kernel_highlights_diffuse_color, dt_iop_highlights_global_data_t::kernel_highlights_false_color, dt_iop_highlights_global_data_t::kernel_highlights_guide_laplacians, dt_iop_highlights_global_data_t::kernel_highlights_remosaic_and_replace, and dt_iop_highlights_global_data_t::kernel_interpolate_bilinear.
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.
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 | ||
) |
int default_colorspace | ( | dt_iop_module_t * | self, |
dt_dev_pixelpipe_t * | pipe, | ||
dt_dev_pixelpipe_iop_t * | piece | ||
) |
References IOP_CS_RAW.
int default_group | ( | ) |
References IOP_GROUP_REPAIR.
const char ** description | ( | struct dt_iop_module_t * | self | ) |
References dt_iop_set_description().
int flags | ( | ) |
References IOP_FLAGS_ALLOW_TILING, and IOP_FLAGS_SUPPORTS_BLENDING.
void gui_changed | ( | dt_iop_module_t * | self, |
GtkWidget * | w, | ||
void * | previous | ||
) |
References dt_image_t::buf_dsc, dt_iop_module_t::dev, dt_bauhaus_combobox_set_from_value(), dt_bauhaus_widget_set_quad_visibility(), dt_control_log(), DT_IOP_HIGHLIGHTS_CLIP, DT_IOP_HIGHLIGHTS_LAPLACIAN, dt_iop_buffer_dsc_t::filters, dt_iop_module_t::gui_data, dt_develop_t::image_storage, and dt_iop_module_t::params.
Referenced by gui_update().
void gui_focus | ( | struct dt_iop_module_t * | self, |
gboolean | in | ||
) |
void gui_init | ( | struct dt_iop_module_t * | self | ) |
References _visualize_callback(), dt_bauhaus_combobox_from_params(), dt_bauhaus_slider_from_params(), dt_bauhaus_slider_set_digits(), dt_bauhaus_slider_set_format(), dt_bauhaus_slider_set_soft_range(), DT_BAUHAUS_SPACE, dt_bauhaus_widget_set_quad_active(), dt_bauhaus_widget_set_quad_paint(), dt_bauhaus_widget_set_quad_toggle(), dt_ui_label_new(), dtgtk_cairo_paint_showmask(), FALSE, IOP_GUI_ALLOC, TRUE, and dt_iop_module_t::widget.
void gui_update | ( | struct dt_iop_module_t * | self | ) |
References dt_iop_module_t::default_enabled, dt_iop_module_t::dev, dt_bauhaus_widget_set_quad_active(), dt_image_is_monochrome(), dt_image_is_rawprepare_supported(), FALSE, gui_changed(), dt_iop_module_t::gui_data, dt_iop_module_t::hide_enable_button, dt_develop_t::image_storage, and dt_iop_module_t::widget.
|
inlinestatic |
References ALPHA, BLUE, DT_ALIGNED_ARRAY, DT_IS_ALIGNED, dt_noise_generator_simd(), DT_NOISE_POISSONIAN, dwt_interleave_rows(), FALSE, FIRST_SCALE, flip(), for_each_channel, for_four_channels, GREEN, height, LAST_SCALE, MAX, MIN, RED, splitmix32(), sqf(), TRUE, width, and xoshiro128plus().
Referenced by wavelets_process().
|
inlinestatic |
References ALPHA, B_SPLINE_TO_LAPLACIAN, BLUE, DT_ALIGNED_ARRAY, DT_IS_ALIGNED, dwt_interleave_rows(), FIRST_SCALE, for_each_channel, for_four_channels, GREEN, height, LAST_SCALE, MAX, MIN, RED, sqf(), and width.
Referenced by wavelets_process().
void init_global | ( | dt_iop_module_so_t * | module | ) |
References dt_opencl_create_kernel(), dt_iop_highlights_global_data_t::kernel_filmic_bspline_horizontal, dt_iop_highlights_global_data_t::kernel_filmic_bspline_vertical, dt_iop_highlights_global_data_t::kernel_filmic_wavelets_detail, dt_iop_highlights_global_data_t::kernel_highlights_1f_clip, dt_iop_highlights_global_data_t::kernel_highlights_1f_lch_bayer, dt_iop_highlights_global_data_t::kernel_highlights_1f_lch_xtrans, dt_iop_highlights_global_data_t::kernel_highlights_4f_clip, dt_iop_highlights_global_data_t::kernel_highlights_bilinear_and_mask, dt_iop_highlights_global_data_t::kernel_highlights_box_blur, dt_iop_highlights_global_data_t::kernel_highlights_diffuse_color, dt_iop_highlights_global_data_t::kernel_highlights_false_color, dt_iop_highlights_global_data_t::kernel_highlights_guide_laplacians, dt_iop_highlights_global_data_t::kernel_highlights_remosaic_and_replace, and dt_iop_highlights_global_data_t::kernel_interpolate_bilinear.
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, and dt_dev_pixelpipe_iop_t::data_size.
|
inlinestatic |
Referenced by interpolate_color_xtrans().
|
inlinestatic |
References FC(), dt_iop_roi_t::height, and dt_iop_roi_t::width.
Referenced by process().
|
inlinestatic |
References FCxtrans(), dt_iop_roi_t::height, interp_pix_xtrans(), and dt_iop_roi_t::width.
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 dt_iop_highlights_params_t::clip, dt_iop_highlights_params_t::combine, dt_iop_highlights_params_t::debugmode, dt_iop_highlights_params_t::iterations, dt_iop_highlights_params_t::noise_level, dt_iop_highlights_params_t::reconstructing, dt_iop_highlights_params_t::scales, and dt_iop_highlights_params_t::solid_color.
const char * name | ( | ) |
Referenced by wavelets_process().
void process | ( | struct dt_iop_module_t * | self, |
dt_dev_pixelpipe_iop_t * | piece, | ||
const void *const | ivoid, | ||
void *const | ovoid, | ||
const dt_iop_roi_t *const | roi_in, | ||
const dt_iop_roi_t *const | roi_out | ||
) |
References dt_iop_highlights_params_t::clip, dt_dev_pixelpipe_iop_t::data, DT_DEV_PIXELPIPE_DISPLAY_MASK, DT_DEV_PIXELPIPE_DISPLAY_PASSTHRU, DT_DEV_PIXELPIPE_FULL, dt_iop_alpha_copy(), DT_IOP_HIGHLIGHTS_CLIP, DT_IOP_HIGHLIGHTS_INPAINT, DT_IOP_HIGHLIGHTS_LAPLACIAN, DT_IOP_HIGHLIGHTS_LCH, FALSE, dt_iop_module_t::gui_data, dt_iop_roi_t::height, interpolate_color(), interpolate_color_xtrans(), m, dt_iop_highlights_params_t::mode, dt_dev_pixelpipe_iop_t::pipe, process_clip(), process_laplacian_bayer(), process_lch_bayer(), process_lch_xtrans(), process_visualize(), and dt_iop_roi_t::width.
|
static |
References dt_dev_pixelpipe_iop_t::colors, dt_iop_roi_t::height, MIN, dt_dev_pixelpipe_iop_t::pipe, and dt_iop_roi_t::width.
Referenced by process().
|
static |
References _interpolate_and_mask(), _remosaic_and_replace(), dt_dev_pixelpipe_iop_t::data, DIFFUSE_RECONSTRUCT_CHROMA, DIFFUSE_RECONSTRUCT_RGB, DS_FACTOR, dt_alloc_align_float(), dt_box_mean(), dt_free_align, error(), height, dt_iop_roi_t::height, interpolate_bilinear(), dt_dev_pixelpipe_iop_t::iscale, dt_iop_highlights_params_t::iterations, MAX_NUM_SCALES, dt_iop_highlights_params_t::noise_level, dt_dev_pixelpipe_iop_t::pipe, dt_iop_roi_t::scale, dt_iop_highlights_params_t::scales, size, dt_iop_highlights_params_t::solid_color, wavelets_process(), width, and dt_iop_roi_t::width.
Referenced by process().
|
static |
References B, FC(), H, dt_iop_roi_t::height, MAX, MIN, dt_dev_pixelpipe_iop_t::pipe, R, SQRT12, SQRT3, dt_iop_roi_t::width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
Referenced by process().
|
static |
References B, FCxtrans(), H, height, dt_iop_roi_t::height, MAX, MIN, dt_dev_pixelpipe_iop_t::pipe, R, SQRT12, SQRT3, and dt_iop_roi_t::width.
Referenced by process().
|
static |
References dt_iop_highlights_params_t::clip, FC(), height, dt_iop_roi_t::height, dt_dev_pixelpipe_iop_t::pipe, width, and dt_iop_roi_t::width.
Referenced by process().
void reload_defaults | ( | dt_iop_module_t * | module | ) |
References dt_iop_module_t::default_enabled, dt_iop_module_t::dev, dt_bauhaus_combobox_add_full(), DT_BAUHAUS_COMBOBOX_ALIGN_RIGHT, dt_bauhaus_combobox_length(), dt_bauhaus_combobox_remove_at(), dt_image_is_monochrome(), DT_IOP_HIGHLIGHTS_LAPLACIAN, dt_iop_module_t::gui_data, dt_image_t::id, dt_develop_t::image_storage, TRUE, and dt_iop_module_t::widget.
|
static |
References ANY_SCALE, FIRST_SCALE, and LAST_SCALE.
Referenced by wavelets_process().
void tiling_callback | ( | struct dt_iop_module_t * | self, |
struct dt_dev_pixelpipe_iop_t * | piece, | ||
const dt_iop_roi_t * | roi_in, | ||
const dt_iop_roi_t * | roi_out, | ||
struct dt_develop_tiling_t * | tiling | ||
) |
References dt_dev_pixelpipe_iop_t::data, DS_FACTOR, DT_IOP_HIGHLIGHTS_LAPLACIAN, DT_IOP_HIGHLIGHTS_LCH, dt_iop_roi_t::height, dt_dev_pixelpipe_iop_t::iscale, MAX_NUM_SCALES, dt_iop_highlights_params_t::mode, dt_dev_pixelpipe_iop_t::pipe, dt_iop_roi_t::scale, and dt_iop_highlights_params_t::scales.
|
inlinestatic |
References B_SPLINE_SIGMA, decompose_2D_Bspline(), DIFFUSE_RECONSTRUCT_RGB, DS_FACTOR, DT_ALIGNED_ARRAY, dt_alloc_perthread_float(), dt_free_align, equivalent_sigma_at_step(), FALSE, guide_laplacians(), heat_PDE_diffusion(), height, name(), scale_type(), sqf(), TRUE, and width.
Referenced by process_laplacian_bayer().