![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "chart/dtcairo.h"
#include "chart/colorchart.h"
#include "chart/common.h"
#include "chart/deltaE.h"
#include "chart/pfm.h"
#include "chart/thinplate.h"
#include "chart/tonecurve.h"
#include "common/exif.h"
#include <gtk/gtk.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Data Structures | |
struct | dt_lut_t |
Macros | |
#define | MAX_PATCHES 49 |
#define | SWAP(a, b) |
Typedefs | |
typedef struct dt_lut_t | dt_lut_t |
Enumerations | |
enum | { COLUMN_NAME , COLUMN_RGB_IN , COLUMN_LAB_IN , COLUMN_LAB_REF , COLUMN_DE_1976 , COLUMN_DE_1976_FLOAT , COLUMN_DE_2000 , COLUMN_DE_2000_FLOAT , NUM_COLUMNS } |
Functions | |
static void | init_image (dt_lut_t *self, image_t *image, GCallback motion_cb) |
static void | image_lab_to_xyz (float *image, const int width, const int height) |
static void | map_boundingbox_to_view (image_t *image, point_t *bb) |
static point_t | map_point_to_view (image_t *image, point_t p) |
static void | get_xyz_sample_from_image (const image_t *const image, float shrink, box_t *box, float *xyz) |
static void | add_column (GtkTreeView *treeview, const char *title, int column_id, int sort_column) |
static void | update_table (dt_lut_t *self) |
static void | init_table (dt_lut_t *self) |
static void | get_Lab_from_box (box_t *box, float *Lab) |
static void | collect_source_patches (dt_lut_t *self) |
static void | collect_source_patches_foreach (gpointer key, gpointer value, gpointer user_data) |
static void | collect_reference_patches (dt_lut_t *self) |
static void | collect_reference_patches_foreach (gpointer key, gpointer value, gpointer user_data) |
static box_t * | find_patch (GHashTable *table, gpointer key) |
static void | get_boundingbox (const image_t *const image, point_t *bb) |
static box_t | get_sample_box (chart_t *chart, box_t *outer_box, float shrink) |
static void | get_corners (const float *homography, box_t *box, point_t *corners) |
static void | get_pixel_region (const image_t *const image, const point_t *const corners, int *x_start, int *y_start, int *x_end, int *y_end) |
static void | reset_bb (image_t *image) |
static void | free_image (image_t *image) |
static gboolean | handle_motion (GtkWidget *widget, GdkEventMotion *event, dt_lut_t *self, image_t *image) |
static int | find_closest_corner (point_t *bb, float x, float y) |
static void | map_mouse_to_0_1 (GtkWidget *widget, GdkEventMotion *event, image_t *image, float *x, float *y) |
static void | update_corner (image_t *image, int which, float *x, float *y) |
static gboolean | open_source_image (dt_lut_t *self, const char *filename) |
static gboolean | open_reference_image (dt_lut_t *self, const char *filename) |
static gboolean | open_image (image_t *image, const char *filename) |
static gboolean | open_cht (dt_lut_t *self, const char *filename) |
static gboolean | open_it8 (dt_lut_t *self, const char *filename) |
static void | size_allocate_callback (GtkWidget *widget, GdkRectangle *allocation, gpointer user_data) |
static gboolean | draw_image_callback (GtkWidget *widget, cairo_t *cr, gpointer user_data) |
static gboolean | motion_notify_callback_source (GtkWidget *widget, GdkEventMotion *event, gpointer user_data) |
static gboolean | motion_notify_callback_reference (GtkWidget *widget, GdkEventMotion *event, gpointer user_data) |
static void | source_image_changed_callback (GtkFileChooserButton *widget, gpointer user_data) |
static void | ref_image_changed_callback (GtkFileChooserButton *widget, gpointer user_data) |
static char * | get_filename_base (const char *filename) |
static void | cht_changed_callback (GtkFileChooserButton *widget, gpointer user_data) |
static void | reference_mode_changed_callback (GtkComboBox *widget, gpointer user_data) |
static void | it8_changed_callback (GtkFileChooserButton *widget, gpointer user_data) |
static char * | get_export_filename (dt_lut_t *self, const char *extension, char **name, char **description, gboolean *basecurve, gboolean *colorchecker, gboolean *colorin, gboolean *tonecurve) |
static void | print_patches (dt_lut_t *self, FILE *fd, GList *patch_names) |
static void | print_xml_plugin (FILE *fd, int num, int op_version, const char *operation, const char *op_params, gboolean enabled) |
static void | export_style (dt_lut_t *self, const char *filename, const char *name, const char *description, gboolean include_basecurve, gboolean include_colorchecker, gboolean include_colorin, gboolean include_tonecurve) |
static void | export_raw (dt_lut_t *self, char *filename, char *name, char *description) |
static void | export_raw_button_clicked_callback (GtkButton *button, gpointer user_data) |
static void | export_button_clicked_callback (GtkButton *button, gpointer user_data) |
static void | add_patches_to_array (dt_lut_t *self, GList *patch_names, int *N, int *i, double *target_L, double *target_a, double *target_b, double *colorchecker_Lab) |
static void | add_hdr_patches (int *N, double **target_L, double **target_a, double **target_b, double **colorchecker_Lab) |
static char * | encode_tonecurve (const tonecurve_t *c) |
static char * | encode_colorchecker (int num, const double *point, const double **target, int *permutation) |
static int | compare_L_source (const void *x_, const void *y_) |
static void | process_data (dt_lut_t *self, double *target_L, double *target_a, double *target_b, double *colorchecker_Lab, int N, int sparsity) |
static void | process_button_clicked_callback (GtkButton *button, gpointer user_data) |
static void | cht_state_callback (GtkWidget *widget, GtkStateFlags flags, gpointer user_data) |
static void | shrink_changed_callback (GtkRange *range, gpointer user_data) |
static GtkWidget * | create_notebook_page_source (dt_lut_t *self) |
static GtkWidget * | create_notebook_page_reference (dt_lut_t *self) |
static GtkWidget * | create_notebook_page_process (dt_lut_t *self) |
static GtkWidget * | create_notebook (dt_lut_t *self) |
static GtkWidget * | create_table (dt_lut_t *self) |
static int | main_gui (dt_lut_t *self, int argc, char *argv[]) |
static int | parse_csv (dt_lut_t *self, const char *filename, double **target_L_ptr, double **target_a_ptr, double **target_b_ptr, double **source_Lab_ptr, int *num_gray, char **name, char **description) |
static int | main_csv (dt_lut_t *self, int argc, char *argv[]) |
static void | show_usage (const char *exe) |
int | main (int argc, char *argv[]) |
Variables | |
const double | thrs = 200.0 |
static const point_t | bb_ref [] = {{.x=.0, .y=.0}, {.x=1., .y=0.}, {.x=1., .y=1.}, {.x=0., .y=1.}} |
#define MAX_PATCHES 49 |
#define SWAP | ( | a, | |
b | |||
) |
anonymous enum |
|
static |
Referenced by create_table().
|
static |
References colorchecker_Lab, FALSE, N, and TRUE.
Referenced by main_csv(), and process_button_clicked_callback().
|
static |
References chart_t::box_table, dt_lut_t::chart, colorchecker_Lab, dt_colorspaces_deltaE_1976(), get_Lab_from_box(), key, dt_lut_t::picked_source_patches, and thrs.
Referenced by process_button_clicked_callback().
|
static |
References open_cht().
Referenced by create_notebook_page_source().
|
static |
References dt_lut_t::export_button, dt_lut_t::export_raw_button, FALSE, flags, dt_lut_t::it8_button, dt_lut_t::process_button, and dt_lut_t::reference_image_button.
Referenced by create_notebook_page_source().
References chart_t::box_table, dt_lut_t::chart, and collect_reference_patches_foreach().
Referenced by motion_notify_callback_reference(), and open_reference_image().
|
static |
References checker_set_color(), DT_COLORSPACE_XYZ, get_xyz_sample_from_image(), dt_lut_t::reference, and image_t::shrink.
Referenced by collect_reference_patches().
References chart_t::box_table, dt_lut_t::chart, and collect_source_patches_foreach().
Referenced by motion_notify_callback_source(), open_cht(), and open_it8().
|
static |
References checker_set_color(), DT_COLORSPACE_XYZ, find_patch(), get_xyz_sample_from_image(), key, dt_lut_t::picked_source_patches, image_t::shrink, and dt_lut_t::source.
Referenced by collect_source_patches().
Referenced by process_data().
|
static |
References create_notebook_page_process(), create_notebook_page_reference(), and create_notebook_page_source().
Referenced by main_gui().
|
static |
References dt_lut_t::export_button, export_button_clicked_callback(), dt_lut_t::export_raw_button, export_raw_button_clicked_callback(), dt_lut_t::number_patches, dt_lut_t::process_button, process_button_clicked_callback(), and dt_lut_t::result_label.
Referenced by create_notebook().
|
static |
References image_t::draw_colored, image_t::drawing_area, FALSE, init_image(), dt_lut_t::it8_button, it8_changed_callback(), motion_notify_callback_reference(), ref_image_changed_callback(), dt_lut_t::reference, dt_lut_t::reference_image_box, dt_lut_t::reference_image_button, dt_lut_t::reference_it8_box, dt_lut_t::reference_mode, reference_mode_changed_callback(), dt_lut_t::reference_shrink, shrink_changed_callback(), and TRUE.
Referenced by create_notebook().
|
static |
References dt_lut_t::cht_button, cht_changed_callback(), cht_state_callback(), image_t::draw_colored, image_t::drawing_area, FALSE, dt_lut_t::image_button, init_image(), motion_notify_callback_source(), shrink_changed_callback(), dt_lut_t::source, source_image_changed_callback(), dt_lut_t::source_shrink, and TRUE.
Referenced by create_notebook().
|
static |
References add_column(), COLUMN_DE_1976, COLUMN_DE_1976_FLOAT, COLUMN_DE_2000, COLUMN_DE_2000_FLOAT, COLUMN_LAB_IN, COLUMN_LAB_REF, COLUMN_NAME, COLUMN_RGB_IN, dt_lut_t::model, NUM_COLUMNS, and dt_lut_t::treeview.
Referenced by main_gui().
|
static |
References bb_ref, center_image(), image_t::chart, clear_background(), draw_boundingbox(), draw_color_boxes_inside(), draw_color_boxes_outline(), image_t::draw_colored, draw_d_boxes(), draw_f_boxes(), draw_image(), draw_no_image(), FALSE, get_homography(), homography(), image_t::image, map_boundingbox_to_view(), image_t::shrink, and stroke_boxes().
Referenced by init_image().
|
static |
References dt_exif_xmp_encode_internal(), FALSE, MAX_PATCHES, MIN, dt_iop_colorchecker_params_t::num_patches, permutation, dt_iop_colorchecker_params_t::source_a, dt_iop_colorchecker_params_t::source_b, dt_iop_colorchecker_params_t::source_L, SWAP, dt_iop_colorchecker_params_t::target_a, dt_iop_colorchecker_params_t::target_b, dt_iop_colorchecker_params_t::target_L, and thinplate_color_pos().
Referenced by process_data().
|
static |
References dt_exif_xmp_encode_internal(), FALSE, dt_iop_tonecurve_params_t::tonecurve, tonecurve_apply(), dt_iop_tonecurve_params_t::tonecurve_autoscale_ab, dt_iop_tonecurve_params_t::tonecurve_nodes, dt_iop_tonecurve_params_t::tonecurve_preset, dt_iop_tonecurve_params_t::tonecurve_type, dt_iop_tonecurve_params_t::tonecurve_unbound_ab, dt_iop_tonecurve_node_t::x, and dt_iop_tonecurve_node_t::y.
Referenced by process_data().
|
static |
References dt_lut_t::colorchecker_encoded, description(), export_style(), get_export_filename(), name, and dt_lut_t::tonecurve_encoded.
Referenced by create_notebook_page_process().
References dt_lut_t::chart, description(), key, name, chart_t::patch_sets, and print_patches().
Referenced by export_raw_button_clicked_callback().
|
static |
References dt_lut_t::chart, description(), export_raw(), get_export_filename(), and name.
Referenced by create_notebook_page_process().
|
static |
References dt_lut_t::colorchecker_encoded, description(), FALSE, name, print_xml_plugin(), dt_lut_t::tonecurve_encoded, and TRUE.
Referenced by export_button_clicked_callback(), and main_csv().
|
static |
References point_t::x, and point_t::y.
Referenced by handle_motion().
|
static |
References key.
Referenced by collect_source_patches_foreach().
References image_t::image, reset_bb(), image_t::surface, and image_t::xyz.
Referenced by main(), and open_image().
References image_t::bb, image_t::height, image_t::width, point_t::x, and point_t::y.
Referenced by get_xyz_sample_from_image().
References apply_homography(), BOTTOM_LEFT, BOTTOM_RIGHT, box_t::h, homography(), box_t::p, TOP_LEFT, TOP_RIGHT, box_t::w, point_t::x, and point_t::y.
Referenced by get_xyz_sample_from_image().
|
static |
References description(), extension(), name, dt_lut_t::reference_filename, TRUE, and dt_lut_t::window.
Referenced by export_button_clicked_callback(), and export_raw_button_clicked_callback().
|
static |
Referenced by open_it8(), and open_reference_image().
References box_t::color, box_t::color_space, DT_COLORSPACE_LAB, DT_COLORSPACE_XYZ, dt_XYZ_to_Lab(), and Lab().
Referenced by add_patches_to_array(), print_patches(), and update_table().
|
static |
References BOTTOM_LEFT, BOTTOM_RIGHT, image_t::height, MAX, MIN, TOP_LEFT, TOP_RIGHT, and image_t::width.
Referenced by get_xyz_sample_from_image().
References chart_t::bb_h, chart_t::bb_w, chart_t::box_shrink, box_t::h, box_t::p, box_t::w, point_t::x, and point_t::y.
Referenced by get_xyz_sample_from_image().
|
static |
References bb_ref, BOTTOM_LEFT, BOTTOM_RIGHT, image_t::chart, get_boundingbox(), get_corners(), get_homography(), get_pixel_region(), get_sample_box(), homography(), TOP_LEFT, TOP_RIGHT, image_t::width, point_t::x, image_t::xyz, and point_t::y.
Referenced by collect_reference_patches_foreach(), and collect_source_patches_foreach().
|
static |
References image_t::bb, FALSE, find_closest_corner(), image_t::image, map_mouse_to_0_1(), TRUE, update_corner(), point_t::x, and point_t::y.
Referenced by motion_notify_callback_reference(), and motion_notify_callback_source().
|
static |
References dt_Lab_to_XYZ(), height, and width.
Referenced by open_image().
References image_t::chart, dt_lut_t::chart, draw_image_callback(), image_t::drawing_area, and size_allocate_callback().
Referenced by create_notebook_page_reference(), and create_notebook_page_source().
References chart_t::box_table, dt_lut_t::chart, COLUMN_NAME, dt_lut_t::model, name, and update_table().
Referenced by open_cht().
|
static |
References open_it8().
Referenced by create_notebook_page_reference().
int main | ( | int | argc, |
char * | argv[] | ||
) |
|
static |
References add_hdr_patches(), colorchecker_Lab, description(), export_style(), N, name, parse_csv(), process_data(), and TRUE.
Referenced by main().
|
static |
References dt_lut_t::cht_button, create_notebook(), create_table(), dt_osx_focus_window(), dt_lut_t::export_button, dt_lut_t::export_raw_button, FALSE, dt_lut_t::image_button, dt_lut_t::it8_button, open_cht(), open_it8(), open_reference_image(), open_source_image(), dt_lut_t::process_button, dt_lut_t::reference_image_button, dt_lut_t::reference_mode, TRUE, and dt_lut_t::window.
Referenced by main().
References image_t::bb, and map_point_to_view().
Referenced by draw_image_callback().
|
static |
References height, image_t::offset_x, image_t::offset_y, and width.
Referenced by handle_motion().
References image_t::height, image_t::scale, image_t::width, point_t::x, and point_t::y.
Referenced by map_boundingbox_to_view().
|
static |
References collect_reference_patches(), handle_motion(), dt_lut_t::reference, and update_table().
Referenced by create_notebook_page_reference().
|
static |
References collect_source_patches(), handle_motion(), dt_lut_t::source, and update_table().
Referenced by create_notebook_page_source().
|
static |
References chart_t::box_shrink, dt_lut_t::chart, dt_lut_t::cht_button, collect_source_patches(), image_t::drawing_area, dt_lut_t::export_button, dt_lut_t::export_raw_button, FALSE, free_chart(), init_table(), dt_lut_t::it8_button, parse_cht(), dt_lut_t::picked_source_patches, dt_lut_t::process_button, dt_lut_t::reference, dt_lut_t::reference_image_button, dt_lut_t::reference_shrink, reset_bb(), image_t::shrink, dt_lut_t::source, and dt_lut_t::source_shrink.
Referenced by cht_changed_callback(), and main_gui().
|
static |
References cairo_surface_create_from_xyz_data(), image_t::drawing_area, FALSE, free_image(), image_t::height, height, image_t::image, image_lab_to_xyz(), read_pfm(), set_offset_and_scale(), image_t::surface, TRUE, image_t::width, width, and image_t::xyz.
Referenced by open_reference_image(), and open_source_image().
|
static |
References dt_lut_t::chart, collect_source_patches(), image_t::drawing_area, dt_lut_t::export_button, dt_lut_t::export_raw_button, FALSE, get_filename_base(), dt_lut_t::it8_button, parse_it8(), dt_lut_t::process_button, dt_lut_t::reference_filename, dt_lut_t::source, TRUE, and update_table().
Referenced by it8_changed_callback(), and main_gui().
|
static |
References image_t::bb, collect_reference_patches(), image_t::drawing_area, dt_lut_t::export_button, dt_lut_t::export_raw_button, FALSE, get_filename_base(), open_image(), dt_lut_t::process_button, dt_lut_t::reference, dt_lut_t::reference_filename, dt_lut_t::reference_image_button, dt_lut_t::source, update_table(), and image_t::xyz.
Referenced by main_gui(), and ref_image_changed_callback().
|
static |
References dt_lut_t::cht_button, image_t::drawing_area, dt_lut_t::image_button, open_image(), and dt_lut_t::source.
Referenced by main_gui(), and source_image_changed_callback().
|
static |
References description(), f(), key, N, name, and thrs.
Referenced by main_csv().
References chart_t::box_table, dt_lut_t::chart, get_Lab_from_box(), key, and dt_lut_t::picked_source_patches.
Referenced by export_raw().
|
static |
Referenced by export_style().
|
static |
References add_hdr_patches(), add_patches_to_array(), chart_t::box_table, dt_lut_t::chart, dt_lut_t::colorchecker_encoded, colorchecker_Lab, dt_lut_t::export_button, dt_lut_t::export_raw_button, FALSE, N, dt_lut_t::number_patches, chart_t::patch_sets, process_data(), dt_lut_t::tonecurve_encoded, and TRUE.
Referenced by create_notebook_page_process().
|
static |
References dt_lut_t::colorchecker_encoded, colorchecker_Lab, compare_L_source(), dt_Lab_to_prophotorgb(), dt_prophotorgb_to_Lab(), encode_colorchecker(), encode_tonecurve(), Lab(), N, perm, dt_lut_t::result_label, thinplate_match(), tonecurve_apply(), tonecurve_create(), tonecurve_delete(), dt_lut_t::tonecurve_encoded, and tonecurve_unapply().
Referenced by main_csv(), and process_button_clicked_callback().
|
static |
References open_reference_image().
Referenced by create_notebook_page_reference().
|
static |
References image_t::bb, BOTTOM_LEFT, BOTTOM_RIGHT, TOP_LEFT, TOP_RIGHT, point_t::x, and point_t::y.
Referenced by free_image(), and open_cht().
|
static |
References image_t::drawing_area, and image_t::shrink.
Referenced by create_notebook_page_reference(), and create_notebook_page_source().
|
static |
References set_offset_and_scale(), and image_t::width.
Referenced by init_image().
|
static |
References open_source_image().
Referenced by create_notebook_page_source().
References image_t::bb, BOTTOM_LEFT, BOTTOM_RIGHT, TOP_LEFT, TOP_RIGHT, point_t::x, and point_t::y.
Referenced by handle_motion().
References chart_t::box_table, dt_lut_t::chart, COLUMN_DE_1976, COLUMN_DE_1976_FLOAT, COLUMN_DE_2000, COLUMN_DE_2000_FLOAT, COLUMN_LAB_IN, COLUMN_LAB_REF, COLUMN_NAME, COLUMN_RGB_IN, dt_colorspaces_deltaE_1976(), dt_colorspaces_deltaE_2000(), get_Lab_from_box(), Lab(), dt_lut_t::model, name, dt_lut_t::picked_source_patches, and box_t::rgb.
Referenced by init_table(), motion_notify_callback_reference(), motion_notify_callback_source(), open_it8(), and open_reference_image().
|
static |
Referenced by draw_image_callback(), and get_xyz_sample_from_image().
const double thrs = 200.0 |