![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include <assert.h>
#include <lcms2.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "bauhaus/bauhaus.h"
#include "common/colorspaces_inline_conversions.h"
#include "common/darktable.h"
#include "common/opencl.h"
#include "control/control.h"
#include "control/conf.h"
#include "develop/develop.h"
#include "develop/imageop_gui.h"
#include "develop/imageop_math.h"
#include "develop/tiling.h"
#include "dtgtk/expander.h"
#include "external/wb_presets.c"
#include "gui/gtk.h"
#include "gui/color_picker_proxy.h"
#include "iop/iop_api.h"
#include "common/colorspaces.h"
#include "external/cie_colorimetric_tables.c"
Data Structures | |
struct | dt_iop_temperature_params_t |
struct | dt_iop_temperature_gui_data_t |
struct | dt_iop_temperature_data_t |
struct | dt_iop_temperature_global_data_t |
struct | dt_iop_temperature_preset_data_t |
Macros | |
#define | INITIALBLACKBODYTEMPERATURE 4000 |
#define | DT_IOP_LOWEST_TEMPERATURE 1901 |
#define | DT_IOP_HIGHEST_TEMPERATURE 25000 |
#define | DT_IOP_LOWEST_TINT 0.135 |
#define | DT_IOP_HIGHEST_TINT 2.326 |
#define | DT_IOP_NUM_OF_STD_TEMP_PRESETS 4 |
#define | DT_IOP_TEMP_AS_SHOT 0 |
#define | DT_IOP_TEMP_SPOT 1 |
#define | DT_IOP_TEMP_USER 2 |
#define | DT_IOP_TEMP_D65 3 |
#define | c1 3.7417715246641281639549488324352159753e-16L |
#define | c2 0.014387769599838156481252937624049081933L |
Typedefs | |
typedef struct dt_iop_temperature_params_t | dt_iop_temperature_params_t |
typedef struct dt_iop_temperature_gui_data_t | dt_iop_temperature_gui_data_t |
typedef struct dt_iop_temperature_data_t | dt_iop_temperature_data_t |
typedef struct dt_iop_temperature_global_data_t | dt_iop_temperature_global_data_t |
typedef struct dt_iop_temperature_preset_data_t | dt_iop_temperature_preset_data_t |
#define c1 3.7417715246641281639549488324352159753e-16L |
#define c2 0.014387769599838156481252937624049081933L |
#define DT_IOP_HIGHEST_TEMPERATURE 25000 |
#define DT_IOP_HIGHEST_TINT 2.326 |
#define DT_IOP_LOWEST_TEMPERATURE 1901 |
#define DT_IOP_LOWEST_TINT 0.135 |
#define DT_IOP_NUM_OF_STD_TEMP_PRESETS 4 |
#define DT_IOP_TEMP_AS_SHOT 0 |
#define DT_IOP_TEMP_D65 3 |
#define DT_IOP_TEMP_SPOT 1 |
#define DT_IOP_TEMP_USER 2 |
#define INITIALBLACKBODYTEMPERATURE 4000 |
typedef struct dt_iop_temperature_data_t dt_iop_temperature_data_t |
typedef struct dt_iop_temperature_global_data_t dt_iop_temperature_global_data_t |
typedef struct dt_iop_temperature_gui_data_t dt_iop_temperature_gui_data_t |
typedef struct dt_iop_temperature_params_t dt_iop_temperature_params_t |
typedef struct dt_iop_temperature_preset_data_t dt_iop_temperature_preset_data_t |
|
inlinestatic |
Referenced by gui_changed(), gui_update(), mul2xyz(), and reload_defaults().
|
inlinestatic |
Referenced by preset_tune_callback(), and temp_tint_callback().
|
static |
References darktable, dt_bauhaus_combobox_get(), dt_bauhaus_combobox_set(), DT_IOP_TEMP_AS_SHOT, DT_IOP_TEMP_D65, DT_IOP_TEMP_USER, darktable_t::gui, dt_iop_module_t::gui_data, preset, dt_gui_gtk_t::reset, and TRUE.
Referenced by gui_init().
|
static |
void cleanup_global | ( | dt_iop_module_so_t * | module | ) |
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 color_finetuning_slider | ( | struct dt_iop_module_t * | self | ) |
References dt_bauhaus_combobox_get_data(), dt_bauhaus_slider_clear_stops(), dt_bauhaus_slider_set_feedback(), dt_bauhaus_slider_set_stop(), dt_iop_module_t::gui_data, neutral, and preset.
Referenced by gui_reset(), gui_update(), and preset_tune_callback().
void color_picker_apply | ( | dt_iop_module_t * | self, |
GtkWidget * | picker, | ||
dt_dev_pixelpipe_iop_t * | piece | ||
) |
References darktable, dt_iop_module_t::dev, dt_bauhaus_combobox_set(), dt_bauhaus_slider_set(), dt_dev_add_history_item, DT_IOP_TEMP_SPOT, darktable_t::gui, dt_iop_module_t::gui_data, mul2temp(), dt_iop_module_t::params, dt_iop_module_t::picked_color, dt_iop_module_t::picked_color_max, dt_iop_module_t::picked_color_min, dt_gui_gtk_t::reset, and TRUE.
void color_rgb_sliders | ( | struct dt_iop_module_t * | self | ) |
References dt_iop_module_t::dev, dt_bauhaus_slider_clear_stops(), dt_bauhaus_slider_get(), dt_bauhaus_slider_get_hard_max(), dt_bauhaus_slider_set_feedback(), dt_bauhaus_slider_set_stop(), DT_IMAGE_4BAYER, FALSE, dt_image_t::flags, dt_iop_module_t::gui_data, and dt_develop_t::image_storage.
Referenced by gui_reset(), gui_update(), and preset_tune_callback().
void color_temptint_sliders | ( | struct dt_iop_module_t * | self | ) |
References double(), dt_bauhaus_slider_clear_stops(), dt_bauhaus_slider_get(), DT_BAUHAUS_SLIDER_MAX_STOPS, dt_bauhaus_slider_set_feedback(), dt_bauhaus_slider_set_stop(), DT_IOP_HIGHEST_TEMPERATURE, DT_IOP_HIGHEST_TINT, DT_IOP_LOWEST_TEMPERATURE, DT_IOP_LOWEST_TINT, dt_XYZ_to_Rec709_D65(), dt_iop_module_t::gui_data, temp2mul(), and temperature_tint_to_XYZ().
Referenced by gui_reset(), gui_update(), and preset_tune_callback().
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 | ||
) |
References dt_iop_temperature_data_t::coeffs, dt_dev_pixelpipe_iop_t::data, dt_iop_module_t::dev, DT_IMAGE_4BAYER, dt_dev_pixelpipe_iop_t::enabled, FALSE, dt_image_t::flags, dt_iop_module_t::gui_data, dt_iop_module_t::hide_enable_button, dt_develop_t::image_storage, dt_dev_pixelpipe_iop_t::process_cl_ready, dt_develop_t::proxy, TRUE, and dt_develop_t::wb_is_D65.
int default_colorspace | ( | dt_iop_module_t * | self, |
dt_dev_pixelpipe_t * | pipe, | ||
dt_dev_pixelpipe_iop_t * | piece | ||
) |
References dt_iop_buffer_dsc_t::cst, dt_dev_pixelpipe_iop_t::dsc_in, IOP_CS_RAW, and IOP_CS_RGB.
int default_group | ( | ) |
References IOP_GROUP_TECHNICAL.
const char ** description | ( | struct dt_iop_module_t * | self | ) |
References dt_iop_set_description().
typedef double | ( | (*)(unsigned long int wavelength, double TempK) | spd | ) |
References double().
Referenced by _aspect_apply(), _compute_prequantized_primaries(), _get_auto_exp(), _get_export_size(), _get_image_buffer(), _magic_schwalm_offset(), _metadata_view_update_values(), _nm_fit_output_to_input_roi(), _nm_fitness(), _paint_parade(), _paint_waveform(), _path_border_get_XY(), _popup_coordinates(), _refresh_progress_counter(), _track_add_point(), apply_box_aspect(), cairo_draw_hatches(), color_temptint_sliders(), distort_backtransform(), distort_transform(), double(), draw_slider_line(), dt_get_papers(), dt_gpx_get_location(), dt_histogram_worker(), dt_set_xmp_exif_geotag(), dt_thumbtable_scroll_to_rowid(), dtgtk_cairo_paint_shortcut(), enlarge_ntuple_list(), gaussian_kernel(), gaussian_sampler(), get_params(), get_theta(), gui_post_expose(), mouse_in_imagearea(), nfa(), process(), reduce_region_radius(), refine(), region2rect(), set_params(), show_pango_text(), spd_blackbody(), and thinplate_match().
|
static |
Referenced by gui_update(), and preset_tune_callback().
|
static |
References calculate_bogus_daylight_wb(), dt_image_t::camera_maker, dt_image_t::camera_missing_sample, dt_image_t::camera_model, dt_iop_module_t::dev, dt_control_log(), DT_IMAGE_4BAYER, dt_image_t::filename, dt_image_t::flags, ignore_missing_wb(), dt_develop_t::image_storage, model, and dt_image_t::wb_coeffs.
Referenced by reload_defaults().
int flags | ( | ) |
References IOP_FLAGS_ALLOW_TILING, and IOP_FLAGS_ONE_INSTANCE.
int generate_preset_combo | ( | struct dt_iop_module_t * | self | ) |
void gui_changed | ( | dt_iop_module_t * | self, |
GtkWidget * | w, | ||
void * | previous | ||
) |
void gui_cleanup | ( | struct dt_iop_module_t * | self | ) |
References DT_REQUEST_COLORPICK_OFF, IOP_GUI_FREE, and dt_iop_module_t::request_color_pick.
void gui_init | ( | struct dt_iop_module_t * | self | ) |
References darktable_t::bauhaus, btn_toggled(), darktable, dt_bauhaus_combobox_new(), dt_bauhaus_slider_from_params(), dt_bauhaus_slider_new_with_range_and_feedback(), dt_bauhaus_slider_set_digits(), dt_bauhaus_slider_set_format(), DT_BAUHAUS_SPACE, dt_bauhaus_widget_set_label(), DT_COLOR_PICKER_AREA, dt_color_picker_new_with_cst(), dt_gui_add_class(), DT_GUI_MODULE, dt_gui_new_collapsible_section(), DT_IOP_HIGHEST_TEMPERATURE, DT_IOP_HIGHEST_TINT, DT_IOP_LOWEST_TEMPERATURE, DT_IOP_LOWEST_TINT, dt_iop_togglebutton_new(), dt_ui_section_label_new(), dtgtk_cairo_paint_bulb(), dtgtk_cairo_paint_camera(), dtgtk_cairo_paint_colorpicker(), dtgtk_cairo_paint_masks_drawn(), DTGTK_TOGGLEBUTTON, dtgtk_togglebutton_set_paint(), FALSE, IOP_CS_NONE, IOP_GUI_ALLOC, preset_tune_callback(), temp_tint_callback(), TRUE, and dt_iop_module_t::widget.
void gui_reset | ( | struct dt_iop_module_t * | self | ) |
|
static |
void gui_update | ( | struct dt_iop_module_t * | self | ) |
References _temp_array_from_params(), dt_image_t::camera_maker, dt_image_t::camera_model, color_finetuning_slider(), color_rgb_sliders(), color_temptint_sliders(), dt_iop_module_t::default_enabled, dt_iop_module_t::dev, dt_bauhaus_combobox_get(), dt_bauhaus_combobox_get_data(), dt_bauhaus_combobox_set(), dt_bauhaus_slider_set(), dt_bauhaus_slider_set_default(), dt_bauhaus_slider_set_hard_max(), dt_bauhaus_slider_set_hard_min(), dt_gui_update_collapsible_section(), dt_image_is_matrix_correction_supported(), dt_image_is_monochrome(), dt_iop_color_picker_reset(), DT_IOP_NUM_OF_STD_TEMP_PRESETS, DT_IOP_TEMP_AS_SHOT, DT_IOP_TEMP_D65, DT_IOP_TEMP_USER, dt_wb_preset_interpolate(), FALSE, dt_iop_module_t::gui_data, dt_iop_module_t::hide_enable_button, dt_develop_t::image_storage, model, mul2temp(), name(), dt_iop_module_t::params, preset, TRUE, and dt_iop_module_t::widget.
|
static |
References dt_image_t::camera_makermodel, FALSE, dt_image_t::filename, and TRUE.
Referenced by find_coeffs().
void init_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 | ||
) |
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 | ||
) |
|
static |
References mul2xyz(), and XYZ_to_temperature().
Referenced by color_picker_apply(), gui_changed(), gui_update(), preset_tune_callback(), and reload_defaults().
|
static |
References _temp_array_from_params(), and dt_iop_module_t::gui_data.
Referenced by mul2temp().
const char * name | ( | ) |
Referenced by generate_preset_combo(), gui_update(), preset_tune_callback(), and reload_defaults().
|
static |
|
static |
References _temp_params_from_array(), dt_image_t::camera_maker, dt_image_t::camera_model, color_finetuning_slider(), color_rgb_sliders(), color_temptint_sliders(), darktable, dt_iop_module_t::dev, darktable_t::develop, dt_bauhaus_combobox_get(), dt_bauhaus_combobox_get_data(), dt_bauhaus_slider_get(), dt_bauhaus_slider_set(), dt_bauhaus_slider_set_default(), dt_bauhaus_slider_set_hard_max(), dt_bauhaus_slider_set_hard_min(), dt_dev_add_history_item, dt_iop_color_picker_reset(), DT_IOP_TEMP_AS_SHOT, DT_IOP_TEMP_D65, DT_IOP_TEMP_SPOT, DT_IOP_TEMP_USER, dt_wb_preset_interpolate(), FALSE, darktable_t::gui, dt_iop_module_t::gui_data, dt_develop_t::image_storage, model, mul2temp(), name(), dt_iop_module_t::off, dt_iop_module_t::params, preset, dt_gui_gtk_t::reset, and TRUE.
Referenced by gui_init().
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_temperature_data_t::coeffs, dt_dev_pixelpipe_iop_t::colors, dt_dev_pixelpipe_iop_t::data, dt_iop_module_t::dev, DT_ALIGNED_PIXEL, DT_DEV_PIXELPIPE_DISPLAY_MASK, dt_iop_alpha_copy(), dt_iop_module_t::enabled, FC(), FCxtrans(), for_four_channels, dt_iop_roi_t::height, dt_dev_pixelpipe_iop_t::pipe, dt_develop_t::proxy, scaled_copy_4wide(), dt_develop_t::wb_coeffs, width, dt_iop_roi_t::width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
void reload_defaults | ( | dt_iop_module_t * | module | ) |
References _temp_array_from_params(), dt_iop_temperature_params_t::blue, calculate_bogus_daylight_wb(), dt_image_t::camera_maker, dt_image_t::camera_model, dt_iop_module_t::dev, dt_bauhaus_combobox_add(), dt_bauhaus_combobox_clear(), dt_bauhaus_slider_set_default(), dt_conf_is_equal(), dt_image_is_matrix_correction_supported(), dt_image_is_monochrome(), DT_IOP_NUM_OF_STD_TEMP_PRESETS, find_coeffs(), dt_iop_temperature_params_t::g2, generate_preset_combo(), dt_iop_temperature_params_t::green, dt_iop_module_t::gui_data, gui_sliders_update(), dt_iop_module_t::hide_enable_button, dt_image_t::id, dt_develop_t::image_storage, model, mul2temp(), name(), prepare_matrices(), dt_iop_temperature_params_t::red, and dt_iop_module_t::widget.
|
inlinestatic |
References for_four_channels.
Referenced by process().
References c1, c2, and double().
Referenced by temperature_to_XYZ().
References S.
Referenced by temperature_to_XYZ().
|
static |
Referenced by temperature_to_XYZ().
|
static |
TODO: problem here is that tint as it is is just a nasty hack modyfying Y component and therefore changing RGB coefficients in wrong way, because modifying only Y in that way doesn’t move XYZ point orthogonally to planckian locus. That means it actually changes temperature and thus it lies!
References temperature_to_XYZ(), and xyz2mul().
Referenced by color_temptint_sliders(), and temp_tint_callback().
|
static |
References _temp_params_from_array(), darktable, darktable_t::develop, dt_bauhaus_combobox_set(), dt_bauhaus_slider_get(), dt_bauhaus_slider_set(), dt_dev_add_history_item, dt_iop_color_picker_reset(), DT_IOP_TEMP_USER, darktable_t::gui, dt_iop_module_t::gui_data, dt_iop_module_t::params, dt_gui_gtk_t::reset, temp2mul(), and TRUE.
Referenced by gui_init().
|
static |
References DT_IOP_HIGHEST_TEMPERATURE, DT_IOP_LOWEST_TEMPERATURE, INITIALBLACKBODYTEMPERATURE, spd_blackbody(), spd_daylight(), and spectrum_to_XYZ().
Referenced by temp2mul(), temperature_tint_to_XYZ(), and XYZ_to_temperature().
|
static |
References dt_iop_module_t::gui_data.
Referenced by temp2mul().
|
static |
References DT_IOP_HIGHEST_TEMPERATURE, DT_IOP_HIGHEST_TINT, DT_IOP_LOWEST_TEMPERATURE, DT_IOP_LOWEST_TINT, and temperature_to_XYZ().
Referenced by mul2temp().