![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include <assert.h>#include <math.h>#include <stdint.h>#include <stdlib.h>#include <string.h>#include "widgets/bauhaus.h"#include "control/user_message.h"#include "develop/develop.h"#include "system/macros.h"#include "system/openmp.h"#include "system/target_clones.h"#include "system/mem_alloc.h"#include "system/simd.h"#include "common/module_versioning.h"#include "develop/imageop.h"#include "gui/color_picker_proxy.h"#include "widgets/collapsible_section.h"#include "develop/imageop_math.h"#include "develop/imageop_gui.h"#include "math/openmp_maths.h"#include "widgets/draw.h"#include "gui/presets.h"#include "iop/iop_api.h"#include "widgets/scroll_wrap.h"#include "gui/screen_metrics.h"
Include dependency graph for levels.c:Go to the source code of this file.
Data Structures | |
| struct | dt_iop_levels_params_t |
| struct | dt_iop_levels_gui_data_t |
| struct | dt_iop_levels_data_t |
Macros | |
| #define | DT_GUI_CURVE_EDITOR_INSET DT_PIXEL_APPLY_DPI(5) |
| #define | DT_GUI_CURVE_INFL .3f |
Typedefs | |
| typedef enum dt_iop_levels_mode_t | dt_iop_levels_mode_t |
| typedef struct dt_iop_levels_params_t | dt_iop_levels_params_t |
| typedef struct dt_iop_levels_gui_data_t | dt_iop_levels_gui_data_t |
| typedef struct dt_iop_levels_data_t | dt_iop_levels_data_t |
Enumerations | |
| enum | dt_iop_levels_mode_t { LEVELS_MODE_MANUAL , LEVELS_MODE_AUTOMATIC } |
| #define DT_GUI_CURVE_EDITOR_INSET DT_PIXEL_APPLY_DPI(5) |
| typedef struct dt_iop_levels_data_t dt_iop_levels_data_t |
| typedef struct dt_iop_levels_gui_data_t dt_iop_levels_gui_data_t |
| typedef enum dt_iop_levels_mode_t dt_iop_levels_mode_t |
| typedef struct dt_iop_levels_params_t dt_iop_levels_params_t |
| enum dt_iop_levels_mode_t |
|
inlinestatic |
Definition at line 373 of file levels.c.
References compute_lut(), d, dt_dev_pixelpipe_iop_t::data, dt_iop_module_t::dev, dt_control_log(), dt_dev_pixelpipe_has_preview_output(), dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_iop_levels_compute_levels_automatic(), g, dt_dev_pixelpipe_iop_t::global_hash, IS_NULL_PTR, LEVELS_MODE_AUTOMATIC, and dt_dev_pixelpipe_iop_t::roi_out.
| void cleanup_pipe | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 545 of file levels.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 304 of file levels.c.
References dt_iop_module_t::dev, dt_dev_add_history_item, dt_iop_gui_data(), levels(), p, dt_iop_module_t::params, dt_iop_module_t::picked_color, TRUE, and void().
| void commit_params | ( | dt_iop_module_t * | self, |
| dt_iop_params_t * | p1, | ||
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 482 of file levels.c.
References dt_dev_histogram_collection_params_t::bins_count, compute_lut(), d, dt_dev_pixelpipe_iop_t::data, dt_iop_module_t::dev, dt_dev_pixelpipe_has_preview_output(), DT_REQUEST_ON, DT_REQUEST_ONLY_IN_GUI, dt_develop_t::gui_attached, dt_dev_pixelpipe_iop_t::histogram_params, LEVELS_MODE_AUTOMATIC, LEVELS_MODE_MANUAL, p, dt_iop_module_t::request_histogram, and dt_dev_pixelpipe_iop_t::request_histogram.
|
static |
Definition at line 287 of file levels.c.
References d, dt_dev_pixelpipe_iop_t::data, delta, and i.
Referenced by __attribute__(), and commit_params().
| int default_colorspace | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 158 of file levels.c.
References IOP_CS_LAB.
| int default_group | ( | ) |
Definition at line 148 of file levels.c.
References IOP_GROUP_TONES.
| const char ** description | ( | struct dt_iop_module_t * | self | ) |
Definition at line 171 of file levels.c.
References dt_iop_set_description().
|
static |
Definition at line 713 of file levels.c.
References dt_cairo_image_surface_create(), dt_draw_histogram_8(), dt_draw_vertical_lines(), DT_GUI_CURVE_EDITOR_INSET, dt_iop_gui_data(), DT_PIXEL_APPLY_DPI, dt_iop_module_t::enabled, FALSE, height, dt_iop_module_t::histogram, dt_iop_module_t::histogram_max, IS_NULL_PTR, k, p, dt_iop_module_t::params, TRUE, and width.
Referenced by gui_init().
|
static |
Definition at line 990 of file levels.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_levels_compute_levels_manual(), FALSE, dt_iop_module_t::histogram, IS_NULL_PTR, p, dt_iop_module_t::params, and TRUE.
Referenced by gui_init().
|
static |
Definition at line 918 of file levels.c.
References dt_iop_module_t::default_params, dt_iop_module_t::dev, dt_dev_add_history_item, dt_iop_gui_data(), dt_iop_request_focus(), FALSE, dt_iop_module_t::gui, dt_develop_t::gui_module, dt_iop_module_t::params, dt_iop_module_t::params_size, TRUE, and dt_iop_module_gui_t::widget.
Referenced by gui_init().
|
static |
Definition at line 949 of file levels.c.
References dt_iop_gui_data(), FALSE, and TRUE.
Referenced by gui_init().
|
static |
Definition at line 231 of file levels.c.
References dt_dev_histogram_stats_t::bins_count, d, dt_dev_pixelpipe_iop_t::data, dt_alloc_align(), dt_free_align, dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_iop_module_t::histogram, dt_iop_module_t::histogram_stats, i, IS_NULL_PTR, k, n, and dt_dev_histogram_stats_t::pixels.
Referenced by __attribute__().
|
static |
Definition at line 205 of file levels.c.
References IS_NULL_PTR, k, and levels().
Referenced by dt_iop_levels_autoadjust_callback().
|
static |
Definition at line 704 of file levels.c.
References dt_iop_gui_data(), and TRUE.
Referenced by gui_init().
|
static |
Definition at line 872 of file levels.c.
References dt_iop_module_t::dev, dist(), dt_dev_add_history_item, DT_GUI_CURVE_EDITOR_INSET, dt_iop_gui_data(), dt_iop_levels_move_handle(), height, k, p, dt_iop_module_t::params, TRUE, and width.
Referenced by gui_init().
|
static |
Move handler_move to new_pos, storing the value in handles, while keeping new_pos within a valid range and preserving the ratio between the three handles.
| self | Pointer to this module to be able to access gui_data |
| handle_move | Handle to move |
| new_pow | New position (0..1) |
| levels | Pointer to dt_iop_levels_params->levels. |
| drag_start_percentage | Ratio between handle 1, 2 and 3. |
Definition at line 834 of file levels.c.
References dt_iop_gui_data(), FALSE, IS_NULL_PTR, and levels().
Referenced by dt_iop_levels_motion_notify(), and dt_iop_levels_scroll().
|
static |
Definition at line 961 of file levels.c.
References dt_iop_module_t::dev, dt_dev_add_history_item, dt_gui_get_scroll_unit_deltas(), dt_iop_color_picker_reset(), dt_iop_gui_data(), dt_iop_levels_move_handle(), dt_iop_request_focus(), FALSE, dt_develop_t::gui_module, p, dt_iop_module_t::params, and TRUE.
Referenced by gui_init().
| int flags | ( | ) |
Definition at line 153 of file levels.c.
References IOP_FLAGS_DEPRECATED, and IOP_FLAGS_SUPPORTS_BLENDING.
| void gui_changed | ( | dt_iop_module_t * | self, |
| GtkWidget * | w, | ||
| void * | previous | ||
| ) |
Definition at line 552 of file levels.c.
References dt_iop_color_picker_reset(), dt_iop_gui_data(), FALSE, g, LEVELS_MODE_AUTOMATIC, p, and dt_iop_module_t::params.
Referenced by gui_update().
| void gui_cleanup | ( | dt_iop_module_t * | self | ) |
Definition at line 695 of file levels.c.
References dt_iop_gui_data(), g, and IOP_GUI_FREE.
| void gui_init | ( | dt_iop_module_t * | self | ) |
Definition at line 603 of file levels.c.
References dt_bauhaus_combobox_from_params(), dt_bauhaus_slider_from_params(), dt_bauhaus_slider_set_format(), dt_color_picker_new(), DT_COLOR_PICKER_POINT, DT_GUI_BOX_SPACING, dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_iop_levels_area_draw(), dt_iop_levels_autoadjust_callback(), dt_iop_levels_button_press(), dt_iop_levels_button_release(), dt_iop_levels_leave_notify(), dt_iop_levels_motion_notify(), dt_iop_levels_scroll(), dt_ui_resizable_drawing_area(), dt_widget_scroll_mask(), FALSE, dt_iop_module_t::gui, IOP_GUI_ALLOC, levels(), TRUE, and dt_iop_module_gui_t::widget.
| void gui_update | ( | dt_iop_module_t * | self | ) |
Refresh GUI controls from current params and configuration.
Definition at line 571 of file levels.c.
References dt_bauhaus_combobox_set(), dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), g, dt_iop_module_t::gui, gui_changed(), p, dt_iop_module_t::params, and dt_iop_module_gui_t::widget.
| void init | ( | dt_iop_module_t * | module | ) |
Definition at line 590 of file levels.c.
References d, dt_iop_default_init(), and dt_iop_levels_params_t::levels.
| void init_pipe | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 539 of file levels.c.
References dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_iop_t::data_size, and dt_calloc_align().
| void input_format | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece, | ||
| dt_iop_buffer_dsc_t * | dsc | ||
| ) |
Definition at line 163 of file levels.c.
References dt_iop_buffer_dsc_t::channels, dt_iop_buffer_dsc_t::datatype, default_input_format(), and TYPE_FLOAT.
| int legacy_params | ( | dt_iop_module_t * | self, |
| const void *const | old_params, | ||
| const int | old_version, | ||
| void * | new_params, | ||
| const int | new_version | ||
| ) |
| __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 | ivoid, | ||
| void *const | ovoid | ||
| ) |
Definition at line 426 of file levels.c.
References __OMP_PARALLEL_FOR__, ch, d, dt_dev_pixelpipe_iop_t::data, DT_DEV_PIXELPIPE_DISPLAY_MASK, dt_iop_roi_t::height, i, levels(), LEVELS_MODE_AUTOMATIC, dt_dev_pixelpipe_t::mask_display, out, ovoid, dt_dev_pixelpipe_iop_t::roi_out, void(), and dt_iop_roi_t::width.