![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "widgets/bauhaus.h"#include "system/macros.h"#include "system/openmp.h"#include "system/target_clones.h"#include "system/mem_alloc.h"#include "common/module_versioning.h"#include "control/control.h"#include "common/colorspaces_inline_conversions.h"#include "math/math.h"#include "pixel/rgb_norms.h"#include "develop/imageop.h"#include "develop/imageop_gui.h"#include "gui/color_picker_proxy.h"#include "develop/tiling.h"#include "widgets/togglebutton.h"#include "control/signal.h"
Include dependency graph for basicadj.c:Go to the source code of this file.
Data Structures | |
| struct | dt_iop_basicadj_params_t |
| struct | dt_iop_basicadj_gui_data_t |
| struct | dt_iop_basicadj_data_t |
Macros | |
| #define | exposure2white(x) exp2f(-(x)) |
Typedefs | |
| typedef struct dt_iop_basicadj_params_t | dt_iop_basicadj_params_t |
| typedef struct dt_iop_basicadj_gui_data_t | dt_iop_basicadj_gui_data_t |
| typedef struct dt_iop_basicadj_data_t | dt_iop_basicadj_data_t |
Functions | |
| int | legacy_params (dt_iop_module_t *self, const void *const old_params, const int old_version, void *new_params, const int new_version) |
| const char * | deprecated_msg () |
| 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, const dt_dev_pixelpipe_iop_t *piece) |
| static void | _turn_select_region_off (struct dt_iop_module_t *self) |
| static void | _turn_selregion_picker_off (struct dt_iop_module_t *self) |
| void | gui_changed (dt_iop_module_t *self, GtkWidget *w, void *previous) |
| static void | _color_picker_callback (GtkWidget *button, dt_iop_module_t *self) |
| static void | _auto_levels_callback (GtkButton *button, dt_iop_module_t *self) |
| static void | _select_region_toggled_callback (GtkToggleButton *togglebutton, dt_iop_module_t *self) |
| static void | _develop_ui_pipe_finished_callback (gpointer instance, gpointer user_data) |
| static void | _signal_profile_user_changed (gpointer instance, uint8_t profile_type, gpointer user_data) |
| int | mouse_moved (struct dt_iop_module_t *self, double x, double y, double pressure, int which) |
| int | button_released (struct dt_iop_module_t *self, double x, double y, int which, uint32_t state) |
| int | button_pressed (struct dt_iop_module_t *self, double x, double y, double pressure, int which, int type, uint32_t state) |
| void | gui_post_expose (struct dt_iop_module_t *self, cairo_t *cr, int32_t width, int32_t height, int32_t pointerx, int32_t pointery) |
| void | color_picker_apply (dt_iop_module_t *self, GtkWidget *picker, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece) |
| static float | get_gamma (const float x, const float gamma) |
| static float | get_lut_gamma (const float x, const float gamma, const float *const lut) |
| static float | get_contrast (const float x, const float contrast, const float middle_grey, const float inv_middle_grey) |
| static float | get_lut_contrast (const float x, const float contrast, const float middle_grey, const float inv_middle_grey, const float *const lut) |
| 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) |
| 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) |
| 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_update (struct dt_iop_module_t *self) |
| void | gui_focus (struct dt_iop_module_t *self, gboolean in) |
| void | change_image (struct dt_iop_module_t *self) |
| void | gui_init (struct dt_iop_module_t *self) |
| void | gui_cleanup (struct dt_iop_module_t *self) |
| static int64_t | doubleToRawLongBits (double d) |
| static double | longBitsToDouble (int64_t i) |
| static int | ilogbp1 (double d) |
| static double | ldexpk (double x, int32_t q) |
| static double | xlog (double d) |
| static double | gamma2 (double x) |
| static double | igamma2 (double x) |
| static __DT_CLONE_TARGETS__ int | _get_auto_exp_histogram (const float *const img, const int width, const int height, int *box_area, uint32_t **_histogram, unsigned int *_hist_size, int *_histcompr) |
| static __DT_CLONE_TARGETS__ void | _get_sum_and_average (const uint32_t *const histogram, const int hist_size, float *_sum, float *_avg) |
| static float | hlcurve (const float level, const float hlcomp, const float hlrange) |
| static __DT_CLONE_TARGETS__ void | _get_auto_exp (const uint32_t *const histogram, const unsigned int hist_size, const int histcompr, const float defgain, const float clip, const float midgray, float *_expcomp, float *_bright, float *_contr, float *_black, float *_hlcompr, float *_hlcomprthresh) |
| static | __attribute__ ((always_inline)) |
| static __DT_CLONE_TARGETS__ void | _get_selected_area (struct dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, dt_iop_basicadj_gui_data_t *g, const dt_iop_roi_t *const roi_in, int *box_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) |
Definition at line 72 of file basicadj.c.
| typedef struct dt_iop_basicadj_data_t dt_iop_basicadj_data_t |
| typedef struct dt_iop_basicadj_gui_data_t dt_iop_basicadj_gui_data_t |
| typedef struct dt_iop_basicadj_params_t dt_iop_basicadj_params_t |
|
inlinestatic |
Definition at line 1203 of file basicadj.c.
References _get_auto_exp(), _get_auto_exp_histogram(), dt_pixelpipe_cache_free_align, height, and width.
|
static |
Definition at line 222 of file basicadj.c.
References _turn_selregion_picker_off(), dt_iop_module_t::dev, dt_dev_add_history_item, dt_dev_pixelpipe_update_history_all, dt_gui_widgets_suppressed(), dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_iop_request_focus(), g, dt_iop_module_t::gui, dt_iop_module_gui_t::off, and TRUE.
Referenced by gui_init().
|
static |
Definition at line 217 of file basicadj.c.
References _turn_select_region_off().
Referenced by gui_init().
|
static |
Definition at line 275 of file basicadj.c.
References dt_iop_module_t::dev, dt_dev_add_history_item, dt_gui_freeze_begin, dt_gui_freeze_end, dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), g, gui_update(), IS_NULL_PTR, p, dt_iop_module_t::params, and TRUE.
Referenced by gui_cleanup(), and gui_init().
|
static |
Definition at line 885 of file basicadj.c.
References _get_sum_and_average(), cleanup(), double(), DT_M_LN2f, gamma2(), i, igamma2(), log, MAX, median, MIN, and xlog().
Referenced by __attribute__().
|
static |
Definition at line 754 of file basicadj.c.
References ch, cleanup(), dt_pixelpipe_cache_alloc_align_cache, height, i, IS_NULL_PTR, R, width, and x.
Referenced by __attribute__().
|
static |
Definition at line 1226 of file basicadj.c.
References dt_dev_distort_transform_plus(), DT_DEV_TRANSFORM_DIR_BACK_INCL, g, height, dt_iop_roi_t::height, dt_dev_pixelpipe_t::iheight, dt_iop_module_t::iop_order, IS_NULL_PTR, dt_dev_pixelpipe_t::iwidth, k, MAX, MIN, dt_iop_roi_t::scale, width, dt_iop_roi_t::width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
Referenced by process().
|
static |
|
static |
Definition at line 248 of file basicadj.c.
References dt_iop_module_t::dev, dt_dev_add_history_item, dt_gui_widgets_suppressed(), dt_iop_color_picker_reset(), dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_iop_request_focus(), g, dt_iop_module_t::gui, dt_iop_module_gui_t::off, and TRUE.
Referenced by gui_init().
|
static |
Definition at line 311 of file basicadj.c.
References dt_iop_module_t::default_params, dt_iop_module_t::dev, dt_bauhaus_slider_set_default(), DT_COLORSPACES_PROFILE_TYPE_WORK, dt_gui_freeze_begin, dt_gui_freeze_end, dt_iop_gui_data(), dt_ioppr_get_iop_work_profile_info(), dt_iop_module_t::enabled, g, dt_develop_t::iop, IS_NULL_PTR, and dt_iop_basicadj_params_t::middle_grey.
Referenced by gui_cleanup(), and gui_init().
|
static |
Definition at line 196 of file basicadj.c.
References dt_iop_gui_data(), g, and IS_NULL_PTR.
Referenced by _color_picker_callback(), _turn_selregion_picker_off(), gui_changed(), and gui_focus().
|
static |
Definition at line 206 of file basicadj.c.
References _turn_select_region_off(), dt_iop_color_picker_reset(), and TRUE.
Referenced by _auto_levels_callback(), and button_pressed().
| int button_pressed | ( | struct dt_iop_module_t * | self, |
| double | x, | ||
| double | y, | ||
| double | pressure, | ||
| int | which, | ||
| int | type, | ||
| uint32_t | state | ||
| ) |
Definition at line 391 of file basicadj.c.
References _turn_selregion_picker_off(), dt_iop_module_t::dev, dt_dev_coordinates_image_norm_to_preview_abs(), dt_dev_coordinates_widget_to_image_norm(), dt_iop_gui_data(), dt_iop_module_t::enabled, g, IS_NULL_PTR, type, and x.
| int button_released | ( | struct dt_iop_module_t * | self, |
| double | x, | ||
| double | y, | ||
| int | which, | ||
| uint32_t | state | ||
| ) |
Definition at line 363 of file basicadj.c.
References dt_iop_module_t::dev, dt_dev_coordinates_image_abs_to_raw_norm(), dt_dev_pixelpipe_update_history_all, dt_iop_gui_data(), dt_iop_module_t::enabled, g, and IS_NULL_PTR.
| void change_image | ( | struct dt_iop_module_t * | self | ) |
Definition at line 576 of file basicadj.c.
References dt_iop_gui_data(), and g.
Referenced by gui_init().
| void cleanup_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 558 of file basicadj.c.
References dt_dev_pixelpipe_iop_t::data, and dt_free_align.
| void color_picker_apply | ( | dt_iop_module_t * | self, |
| GtkWidget * | picker, | ||
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 462 of file basicadj.c.
References dt_iop_module_t::dev, dt_bauhaus_slider_set(), dt_camera_rgb_luminance(), dt_dev_add_history_item, dt_gui_freeze_begin, dt_gui_freeze_end, dt_gui_widgets_suppressed(), dt_iop_gui_data(), dt_ioppr_get_pipe_current_profile_info(), g, dt_iop_order_iccprofile_info_t::lut_in, dt_iop_order_iccprofile_info_t::lutsize, dt_iop_order_iccprofile_info_t::matrix_in, dt_iop_order_iccprofile_info_t::nonlinearlut, p, dt_iop_module_t::params, dt_iop_module_t::picked_color, TRUE, and void().
| 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 523 of file basicadj.c.
References d, dt_dev_pixelpipe_iop_t::data, get_contrast(), get_gamma(), i, and p.
| int default_colorspace | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 191 of file basicadj.c.
References IOP_CS_RGB.
| int default_group | ( | ) |
Definition at line 181 of file basicadj.c.
References IOP_GROUP_EFFECTS.
| const char * deprecated_msg | ( | ) |
Definition at line 162 of file basicadj.c.
| const char ** description | ( | struct dt_iop_module_t * | self | ) |
Definition at line 172 of file basicadj.c.
References dt_iop_set_description().
|
inlinestatic |
| int flags | ( | ) |
Definition at line 186 of file basicadj.c.
References IOP_FLAGS_ALLOW_TILING, IOP_FLAGS_DEPRECATED, and IOP_FLAGS_SUPPORTS_BLENDING.
|
inlinestatic |
Definition at line 496 of file basicadj.c.
References x.
Referenced by commit_params(), and get_lut_contrast().
|
inlinestatic |
Definition at line 486 of file basicadj.c.
References x.
Referenced by commit_params(), and get_lut_gamma().
|
inlinestatic |
Definition at line 502 of file basicadj.c.
References get_contrast(), lut, and x.
Referenced by process().
|
inlinestatic |
Definition at line 491 of file basicadj.c.
References get_gamma(), lut, and x.
Referenced by process().
| void gui_changed | ( | dt_iop_module_t * | self, |
| GtkWidget * | w, | ||
| void * | previous | ||
| ) |
Definition at line 212 of file basicadj.c.
References _turn_select_region_off().
| void gui_cleanup | ( | struct dt_iop_module_t * | self | ) |
Definition at line 664 of file basicadj.c.
References _develop_ui_pipe_finished_callback(), _signal_profile_user_changed(), dt_control_signal_get_global(), DT_DEBUG_CONTROL_SIGNAL_DISCONNECT, and IOP_GUI_FREE.
| void gui_focus | ( | struct dt_iop_module_t * | self, |
| gboolean | in | ||
| ) |
Definition at line 571 of file basicadj.c.
References _turn_select_region_off().
| void gui_init | ( | struct dt_iop_module_t * | self | ) |
Definition at line 587 of file basicadj.c.
References _auto_levels_callback(), _color_picker_callback(), _develop_ui_pipe_finished_callback(), _select_region_toggled_callback(), _signal_profile_user_changed(), change_image(), dt_action_button_new(), 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_max(), dt_bauhaus_slider_set_soft_range(), DT_COLOR_PICKER_AREA, dt_color_picker_new(), dt_control_signal_get_global(), DT_DEBUG_CONTROL_SIGNAL_CONNECT, DT_GUI_BOX_SPACING, DT_PIXEL_APPLY_DPI, DT_SIGNAL_CONTROL_PROFILE_USER_CHANGED, DT_SIGNAL_DEVELOP_PREVIEW_PIPE_FINISHED, dtgtk_cairo_paint_colorpicker(), dtgtk_togglebutton_new(), g, dt_iop_module_t::gui, IOP_GUI_ALLOC, TRUE, and dt_iop_module_gui_t::widget.
| void gui_post_expose | ( | struct dt_iop_module_t * | self, |
| cairo_t * | cr, | ||
| int32_t | width, | ||
| int32_t | height, | ||
| int32_t | pointerx, | ||
| int32_t | pointery | ||
| ) |
Definition at line 422 of file basicadj.c.
References dt_iop_module_t::dev, dt_dev_get_overlay_scale(), dt_dev_rescale_roi(), dt_iop_gui_data(), dt_iop_module_t::enabled, g, height, IS_NULL_PTR, and width.
| void gui_update | ( | struct dt_iop_module_t * | self | ) |
Definition at line 564 of file basicadj.c.
References dt_iop_gui_data(), and g.
Referenced by _develop_ui_pipe_finished_callback().
|
inlinestatic |
|
inlinestatic |
Definition at line 692 of file basicadj.c.
References d, doubleToRawLongBits(), and m.
Referenced by xlog().
| void init_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 552 of file basicadj.c.
References dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_iop_t::data_size, and dt_calloc_align().
Definition at line 702 of file basicadj.c.
References longBitsToDouble(), m, u2, and x.
Referenced by xlog().
| int legacy_params | ( | dt_iop_module_t * | self, |
| const void *const | old_params, | ||
| const int | old_version, | ||
| void * | new_params, | ||
| const int | new_version | ||
| ) |
Definition at line 124 of file basicadj.c.
References dt_iop_basicadj_params_t::black_point.
|
inlinestatic |
| int mouse_moved | ( | struct dt_iop_module_t * | self, |
| double | x, | ||
| double | y, | ||
| double | pressure, | ||
| int | which | ||
| ) |
Definition at line 342 of file basicadj.c.
References dt_iop_module_t::dev, dt_control_queue_redraw_center(), dt_dev_coordinates_image_norm_to_preview_abs(), dt_dev_coordinates_widget_to_image_norm(), dt_iop_gui_data(), dt_iop_module_t::enabled, g, IS_NULL_PTR, and x.
| const char * name | ( | ) |
Definition at line 167 of file basicadj.c.
| __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 | ||
| ) |
Definition at line 1284 of file basicadj.c.
References __OMP_PARALLEL_FOR__, _get_selected_area(), ch, dt_iop_buffer_dsc_t::channels, d, dt_dev_pixelpipe_iop_t::data, delta, dt_iop_module_t::dev, dt_dev_pixelpipe_iop_t::dsc_in, dt_camera_rgb_luminance(), dt_dev_pixelpipe_has_preview_output(), dt_gui_widgets_suppressed(), dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_ioppr_get_iop_work_profile_info(), dt_rgb_norm(), DT_RGB_NORM_NONE, exposure2white, g, get_lut_contrast(), get_lut_gamma(), dt_iop_roi_t::height, hlcurve(), dt_develop_t::iop, IS_NULL_PTR, k, dt_iop_order_iccprofile_info_t::lut_in, dt_iop_order_iccprofile_info_t::lutsize, dt_iop_order_iccprofile_info_t::matrix_in, dt_iop_order_iccprofile_info_t::nonlinearlut, out, ovoid, p, P, dt_dev_pixelpipe_iop_t::roi_in, dt_dev_pixelpipe_iop_t::roi_out, 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 | ||
| ) |
Definition at line 509 of file basicadj.c.
References void().