![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "bauhaus/bauhaus.h"
#include "common/bilateral.h"
#include "common/bilateralcl.h"
#include "common/colorspaces.h"
#include "common/imagebuf.h"
#include "common/opencl.h"
#include "common/points.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/tiling.h"
#include "dtgtk/drawingarea.h"
#include "dtgtk/resetlabel.h"
#include "gui/gtk.h"
#include "iop/iop_api.h"
#include <gtk/gtk.h>
#include <inttypes.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
Data Structures | |
struct | dt_iop_colormapping_flowback_t |
struct | dt_iop_colormapping_params_t |
struct | dt_iop_colormapping_gui_data_t |
struct | dt_iop_colormapping_global_data_t |
Macros | |
#define | HISTN (1 << 11) |
#define | MAXN 5 |
Typedefs | |
typedef float | float2[2] |
typedef enum dt_iop_colormapping_flags_t | dt_iop_colormapping_flags_t |
typedef struct dt_iop_colormapping_flowback_t | dt_iop_colormapping_flowback_t |
typedef struct dt_iop_colormapping_params_t | dt_iop_colormapping_params_t |
typedef struct dt_iop_colormapping_params_t | dt_iop_colormapping_data_t |
typedef struct dt_iop_colormapping_gui_data_t | dt_iop_colormapping_gui_data_t |
typedef struct dt_iop_colormapping_global_data_t | dt_iop_colormapping_global_data_t |
Enumerations | |
enum | dt_iop_colormapping_flags_t { NEUTRAL = 0 , HAS_SOURCE = 1 << 0 , HAS_TARGET = 1 << 1 , HAS_SOURCE_TARGET = HAS_SOURCE | HAS_TARGET , ACQUIRE = 1 << 2 , GET_SOURCE = 1 << 3 , GET_TARGET = 1 << 4 } |
Functions | |
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, dt_dev_pixelpipe_iop_t *piece) |
static void | capture_histogram (const float *col, const int width, const int height, int *hist) |
static void | invert_histogram (const int *hist, float *inv_hist) |
static void | get_cluster_mapping (const int n, float2 *mi, const float *wi, float2 *mo, const float *wo, const float dominance, int *mapio) |
static void | get_clusters (const float *col, const int n, float2 *mean, float *weight) |
static int | get_cluster (const float *col, const int n, float2 *mean) |
static void | kmeans (const float *col, const int width, const int height, const int n, float2 *mean_out, float2 *var_out, float *weight_out) |
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) |
void | tiling_callback (struct dt_iop_module_t *self, struct dt_dev_pixelpipe_iop_t *piece, const dt_iop_roi_t *roi_in, const dt_iop_roi_t *roi_out, struct dt_develop_tiling_t *tiling) |
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) |
void | gui_changed (dt_iop_module_t *self, GtkWidget *w, void *previous) |
static void | acquire_source_button_pressed (GtkButton *button, dt_iop_module_t *self) |
static void | acquire_target_button_pressed (GtkButton *button, dt_iop_module_t *self) |
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 | init_global (dt_iop_module_so_t *module) |
void | cleanup_global (dt_iop_module_so_t *module) |
void | reload_defaults (dt_iop_module_t *module) |
static gboolean | cluster_preview_draw (GtkWidget *widget, cairo_t *crf, dt_iop_module_t *self) |
static void | process_clusters (gpointer instance, gpointer user_data) |
void | gui_init (struct dt_iop_module_t *self) |
void | gui_cleanup (struct dt_iop_module_t *self) |
#define HISTN (1 << 11) |
color transfer somewhat based on the glorious paper ‘color transfer between images’ by erik reinhard, michael ashikhmin, bruce gooch, and peter shirley, 2001. chosen because it officially cites the playboy.
workflow:
#define MAXN 5 |
typedef struct dt_iop_colormapping_params_t dt_iop_colormapping_data_t |
and pixelpipe data is just the same
typedef enum dt_iop_colormapping_flags_t dt_iop_colormapping_flags_t |
typedef struct dt_iop_colormapping_flowback_t dt_iop_colormapping_flowback_t |
typedef struct dt_iop_colormapping_gui_data_t dt_iop_colormapping_gui_data_t |
typedef struct dt_iop_colormapping_params_t dt_iop_colormapping_params_t |
typedef float float2[2] |
|
static |
References ACQUIRE, darktable, darktable_t::develop, dt_dev_add_history_item, dt_iop_request_focus(), GET_SOURCE, darktable_t::gui, dt_iop_module_t::params, dt_gui_gtk_t::reset, and TRUE.
Referenced by gui_init().
|
static |
References ACQUIRE, darktable, darktable_t::develop, dt_dev_add_history_item, dt_iop_request_focus(), GET_TARGET, darktable_t::gui, dt_iop_module_t::params, dt_gui_gtk_t::reset, and TRUE.
Referenced by gui_init().
|
static |
References height, HISTN, and width.
Referenced by process_clusters().
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.
|
static |
References dt_cairo_image_surface_create(), DT_PIXEL_APPLY_DPI, dt_iop_module_t::gui_data, height, Lab(), dt_iop_module_t::params, TRUE, and width.
Referenced by gui_init().
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 | ||
) |
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_COLOR.
const char ** description | ( | struct dt_iop_module_t * | self | ) |
References dt_iop_set_description().
int flags | ( | ) |
References IOP_FLAGS_DEPRECATED, IOP_FLAGS_ONE_INSTANCE, and IOP_FLAGS_SUPPORTS_BLENDING.
|
static |
void gui_changed | ( | dt_iop_module_t * | self, |
GtkWidget * | w, | ||
void * | previous | ||
) |
References dt_control_queue_redraw_widget(), dt_iop_module_t::gui_data, HISTN, MAXN, NEUTRAL, and dt_iop_module_t::params.
void gui_cleanup | ( | struct dt_iop_module_t * | self | ) |
void gui_init | ( | struct dt_iop_module_t * | self | ) |
References acquire_source_button_pressed(), acquire_target_button_pressed(), cluster_preview_draw(), darktable, dt_bauhaus_slider_from_params(), dt_bauhaus_slider_set_format(), DT_BAUHAUS_SPACE, DT_COLORSPACE_LAB, DT_COLORSPACE_SRGB, dt_colorspaces_get_profile(), DT_DEBUG_CONTROL_SIGNAL_CONNECT, dt_iop_button_new(), DT_PROFILE_DIRECTION_ANY, DT_PROFILE_DIRECTION_IN, DT_SIGNAL_DEVELOP_PREVIEW_PIPE_FINISHED, dt_ui_label_new(), dtgtk_drawing_area_new_with_aspect_ratio(), f(), FALSE, IOP_GUI_ALLOC, NEUTRAL, process_clusters(), dt_colorspaces_color_profile_t::profile, darktable_t::signals, TRUE, and dt_iop_module_t::widget.
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.
|
static |
References HISTN.
Referenced by process_clusters().
|
static |
References dt_points_get(), get_cluster(), height, Lab(), and width.
Referenced by process_clusters().
const char * name | ( | ) |
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 ACQUIRE, dt_dev_pixelpipe_iop_t::colors, dt_dev_pixelpipe_iop_t::data, dt_iop_module_t::dev, dt_alloc_perthread(), dt_bilateral_blur(), dt_bilateral_free(), dt_bilateral_init(), dt_bilateral_slice(), dt_bilateral_splat(), DT_DEV_PIXELPIPE_PREVIEW, dt_free_align, dt_get_perthread, dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_iop_have_required_input_format(), dt_iop_image_alloc(), dt_iop_image_copy_by_size(), get_cluster_mapping(), get_clusters(), dt_develop_t::gui_attached, dt_iop_module_t::gui_data, HAS_SOURCE, HAS_TARGET, height, dt_iop_roi_t::height, HISTN, dt_dev_pixelpipe_iop_t::iscale, Lab(), dt_dev_pixelpipe_iop_t::pipe, dt_iop_roi_t::scale, sigma_r, sigma_s, weight(), width, and dt_iop_roi_t::width.
|
static |
References ACQUIRE, capture_histogram(), darktable, darktable_t::develop, dt_control_queue_redraw(), dt_control_queue_redraw_widget(), dt_dev_add_history_item, dt_free_align, dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_iop_image_alloc(), dt_iop_image_copy_by_size(), f(), GET_SOURCE, GET_TARGET, darktable_t::gui, dt_iop_module_t::gui_data, HAS_SOURCE, HAS_TARGET, height, HISTN, invert_histogram(), kmeans(), MAXN, dt_iop_module_t::params, dt_gui_gtk_t::reset, TRUE, and width.
Referenced by gui_cleanup(), and gui_init().
void reload_defaults | ( | dt_iop_module_t * | module | ) |
References dt_iop_module_t::dev, dt_iop_colormapping_params_t::flag, dt_develop_t::gui_attached, dt_iop_module_t::gui_data, HAS_SOURCE, HISTN, MAXN, dt_iop_colormapping_params_t::n, dt_iop_colormapping_params_t::source_ihist, dt_iop_colormapping_params_t::source_mean, dt_iop_colormapping_params_t::source_var, and dt_iop_colormapping_params_t::source_weight.
void tiling_callback | ( | struct dt_iop_module_t * | self, |
struct dt_dev_pixelpipe_iop_t * | piece, | ||
const dt_iop_roi_t * | roi_in, | ||
const dt_iop_roi_t * | roi_out, | ||
struct dt_develop_tiling_t * | tiling | ||
) |
References dt_dev_pixelpipe_iop_t::colors, dt_bilateral_memory_use(), dt_bilateral_singlebuffer_size(), height, dt_iop_roi_t::height, dt_dev_pixelpipe_iop_t::iscale, dt_iop_roi_t::scale, sigma_r, sigma_s, width, and dt_iop_roi_t::width.