![]() |
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 "bauhaus/bauhaus.h"
#include "common/colorspaces.h"
#include "common/opencl.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/openmp_maths.h"
#include "dtgtk/drawingarea.h"
#include "gui/draw.h"
#include "gui/gtk.h"
#include "gui/presets.h"
#include "iop/iop_api.h"
#include "libs/colorpicker.h"
Data Structures | |
struct | dt_iop_levels_params_t |
struct | dt_iop_levels_gui_data_t |
struct | dt_iop_levels_data_t |
struct | dt_iop_levels_global_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 |
typedef struct dt_iop_levels_global_data_t | dt_iop_levels_global_data_t |
Enumerations | |
enum | dt_iop_levels_mode_t { LEVELS_MODE_MANUAL , LEVELS_MODE_AUTOMATIC } |
Functions | |
static gboolean | dt_iop_levels_area_draw (GtkWidget *widget, cairo_t *crf, gpointer user_data) |
static gboolean | dt_iop_levels_motion_notify (GtkWidget *widget, GdkEventMotion *event, gpointer user_data) |
static gboolean | dt_iop_levels_button_press (GtkWidget *widget, GdkEventButton *event, gpointer user_data) |
static gboolean | dt_iop_levels_button_release (GtkWidget *widget, GdkEventButton *event, gpointer user_data) |
static gboolean | dt_iop_levels_leave_notify (GtkWidget *widget, GdkEventCrossing *event, gpointer user_data) |
static gboolean | dt_iop_levels_scroll (GtkWidget *widget, GdkEventScroll *event, gpointer user_data) |
static void | dt_iop_levels_autoadjust_callback (GtkRange *range, dt_iop_module_t *self) |
const char * | name () |
int | default_group () |
int | flags () |
int | default_colorspace (dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece) |
const char ** | description (struct dt_iop_module_t *self) |
int | legacy_params (dt_iop_module_t *self, const void *const old_params, const int old_version, void *new_params, const int new_version) |
static void | dt_iop_levels_compute_levels_manual (const uint32_t *histogram, float *levels) |
static void | dt_iop_levels_compute_levels_automatic (dt_dev_pixelpipe_iop_t *piece) |
static void | compute_lut (dt_dev_pixelpipe_iop_t *piece) |
void | color_picker_apply (dt_iop_module_t *self, GtkWidget *picker, dt_dev_pixelpipe_iop_t *piece) |
static void | commit_params_late (dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece) |
void | process (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 (dt_iop_module_t *self, dt_iop_params_t *p1, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece) |
void | init_pipe (dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece) |
void | cleanup_pipe (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 (dt_iop_module_t *self) |
void | init (dt_iop_module_t *module) |
void | init_global (dt_iop_module_so_t *self) |
void | cleanup_global (dt_iop_module_so_t *self) |
void | gui_init (dt_iop_module_t *self) |
void | gui_cleanup (dt_iop_module_t *self) |
static void | dt_iop_levels_move_handle (dt_iop_module_t *self, int handle_move, float new_pos, float *levels, float drag_start_percentage) |
#define DT_GUI_CURVE_EDITOR_INSET DT_PIXEL_APPLY_DPI(5) |
#define DT_GUI_CURVE_INFL .3f |
typedef struct dt_iop_levels_data_t dt_iop_levels_data_t |
typedef struct dt_iop_levels_global_data_t dt_iop_levels_global_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 |
void cleanup_global | ( | dt_iop_module_so_t * | self | ) |
void cleanup_pipe | ( | dt_iop_module_t * | self, |
dt_dev_pixelpipe_t * | pipe, | ||
dt_dev_pixelpipe_iop_t * | piece | ||
) |
References dt_dev_pixelpipe_iop_t::data.
void color_picker_apply | ( | dt_iop_module_t * | self, |
GtkWidget * | picker, | ||
dt_dev_pixelpipe_iop_t * | piece | ||
) |
void commit_params | ( | dt_iop_module_t * | self, |
dt_iop_params_t * | p1, | ||
dt_dev_pixelpipe_t * | pipe, | ||
dt_dev_pixelpipe_iop_t * | piece | ||
) |
References dt_dev_histogram_collection_params_t::bins_count, compute_lut(), dt_dev_pixelpipe_iop_t::data, dt_iop_module_t::dev, DT_DEV_PIXELPIPE_PREVIEW, DT_REQUEST_ON, DT_REQUEST_ONLY_IN_GUI, dt_develop_t::gui_attached, dt_dev_pixelpipe_iop_t::histogram_params, dt_iop_levels_data_t::levels, LEVELS_MODE_AUTOMATIC, LEVELS_MODE_MANUAL, dt_iop_levels_data_t::mode, dt_iop_levels_data_t::percentiles, dt_iop_module_t::request_histogram, dt_dev_pixelpipe_iop_t::request_histogram, and dt_dev_pixelpipe_t::type.
|
static |
References compute_lut(), dt_dev_pixelpipe_iop_t::data, dt_iop_module_t::dev, dt_control_log(), dt_dev_hash(), DT_DEV_PIXELPIPE_FULL, DT_DEV_PIXELPIPE_PREVIEW, dt_dev_sync_pixelpipe_hash(), DT_DEV_TRANSFORM_DIR_BACK_INCL, dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_iop_levels_compute_levels_automatic(), dt_iop_module_t::gui_data, dt_iop_module_t::gui_lock, dt_iop_module_t::iop_order, dt_iop_levels_data_t::levels, LEVELS_MODE_AUTOMATIC, dt_iop_levels_data_t::mode, and dt_dev_pixelpipe_iop_t::pipe.
Referenced by process().
|
static |
References dt_dev_pixelpipe_iop_t::data, dt_iop_levels_data_t::in_inv_gamma, dt_iop_levels_data_t::levels, and dt_iop_levels_data_t::lut.
Referenced by commit_params(), and commit_params_late().
int default_colorspace | ( | dt_iop_module_t * | self, |
dt_dev_pixelpipe_t * | pipe, | ||
dt_dev_pixelpipe_iop_t * | piece | ||
) |
References IOP_CS_LAB.
int default_group | ( | ) |
References IOP_GROUP_TONES.
const char ** description | ( | struct dt_iop_module_t * | self | ) |
References dt_iop_set_description().
|
static |
References dt_cairo_image_surface_create(), dt_draw_histogram_8(), dt_draw_vertical_lines(), DT_GUI_CURVE_EDITOR_INSET, DT_PIXEL_APPLY_DPI, dt_iop_module_t::enabled, FALSE, dt_iop_module_t::gui_data, height, dt_iop_module_t::histogram, dt_iop_module_t::histogram_max, dt_iop_module_t::params, TRUE, and width.
Referenced by gui_init().
|
static |
|
static |
References darktable, dt_iop_module_t::default_params, darktable_t::develop, dt_dev_add_history_item, dt_iop_request_focus(), FALSE, dt_iop_module_t::gui_data, dt_develop_t::gui_module, dt_iop_module_t::params, dt_iop_module_t::params_size, TRUE, and dt_iop_module_t::widget.
Referenced by gui_init().
|
static |
References FALSE, dt_iop_module_t::gui_data, and TRUE.
Referenced by gui_init().
|
static |
|
static |
References levels().
Referenced by dt_iop_levels_autoadjust_callback().
|
static |
References dt_iop_module_t::gui_data, and TRUE.
Referenced by gui_init().
|
static |
References darktable, darktable_t::develop, dist(), dt_dev_add_history_item, DT_GUI_CURVE_EDITOR_INSET, dt_iop_levels_move_handle(), dt_iop_module_t::gui_data, height, 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. |
References FALSE, dt_iop_module_t::gui_data, and levels().
Referenced by dt_iop_levels_motion_notify(), and dt_iop_levels_scroll().
|
static |
References darktable, darktable_t::develop, dt_conf_get_int(), dt_conf_set_int(), dt_dev_add_history_item, dt_gui_get_scroll_unit_deltas(), dt_iop_color_picker_reset(), dt_iop_levels_move_handle(), dt_iop_request_focus(), dt_modifier_is(), dtgtk_drawing_area_set_aspect_ratio(), FALSE, dt_iop_module_t::gui_data, dt_develop_t::gui_module, dt_iop_module_t::params, and TRUE.
Referenced by gui_init().
int flags | ( | ) |
References IOP_FLAGS_DEPRECATED, and IOP_FLAGS_SUPPORTS_BLENDING.
void gui_changed | ( | dt_iop_module_t * | self, |
GtkWidget * | w, | ||
void * | previous | ||
) |
References dt_iop_module_t::gui_data, LEVELS_MODE_AUTOMATIC, and dt_iop_module_t::params.
Referenced by gui_update().
void gui_cleanup | ( | dt_iop_module_t * | self | ) |
References dt_iop_module_t::gui_data, and IOP_GUI_FREE.
void gui_init | ( | dt_iop_module_t * | self | ) |
References darktable, dt_bauhaus_combobox_from_params(), dt_bauhaus_slider_from_params(), dt_bauhaus_slider_set_format(), dt_color_picker_new(), DT_COLOR_PICKER_POINT, dt_conf_get_int(), 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(), dtgtk_drawing_area_new_with_aspect_ratio(), FALSE, darktable_t::gui, IOP_GUI_ALLOC, levels(), dt_gui_gtk_t::scroll_mask, TRUE, and dt_iop_module_t::widget.
void gui_update | ( | dt_iop_module_t * | self | ) |
void init | ( | dt_iop_module_t * | module | ) |
References dt_iop_default_init(), and dt_iop_levels_params_t::levels.
void init_global | ( | dt_iop_module_so_t * | self | ) |
void init_pipe | ( | 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.
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_module_t::default_params, levels(), and dt_iop_levels_params_t::levels.
const char * name | ( | ) |
void process | ( | 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_dev_pixelpipe_iop_t::colors, commit_params_late(), dt_dev_pixelpipe_iop_t::data, DT_DEV_PIXELPIPE_DISPLAY_MASK, dt_iop_alpha_copy(), dt_iop_roi_t::height, dt_iop_levels_data_t::in_inv_gamma, levels(), dt_iop_levels_data_t::levels, LEVELS_MODE_AUTOMATIC, dt_iop_levels_data_t::lut, dt_iop_levels_data_t::mode, dt_dev_pixelpipe_iop_t::pipe, and dt_iop_roi_t::width.