![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "common/colorspaces.h"#include "common/imagebuf.h"#include "common/points.h"#include "control/control.h"#include "develop/develop.h"#include "develop/imageop.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>
Include dependency graph for colortransfer.c:Data Structures | |
| struct | dt_iop_colortransfer_params_t |
| struct | dt_iop_colortransfer_gui_data_t |
| struct | dt_iop_colortransfer_data_t |
Macros | |
| #define | HISTN (1 << 11) |
| #define | MAXN 5 |
Typedefs | |
| typedef float | float2[2] |
| typedef enum dt_iop_colortransfer_flag_t | dt_iop_colortransfer_flag_t |
| typedef struct dt_iop_colortransfer_params_t | dt_iop_colortransfer_params_t |
| typedef struct dt_iop_colortransfer_gui_data_t | dt_iop_colortransfer_gui_data_t |
| typedef struct dt_iop_colortransfer_data_t | dt_iop_colortransfer_data_t |
Enumerations | |
| enum | dt_iop_colortransfer_flag_t { ACQUIRE = 0 , ACQUIRE2 = 1 , ACQUIRE3 = 2 , ACQUIRED = 3 , APPLY = 4 , NEUTRAL = 5 } |
Functions | |
| const char * | name () |
| int | default_group () |
| int | flags () |
| const char * | deprecated_msg () |
| int | default_colorspace (dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece) |
| static void | capture_histogram (const float *col, const dt_iop_roi_t *roi, int *hist) |
| static void | invert_histogram (const int *hist, float *inv_hist) |
| static void | get_cluster_mapping (const int n, float2 *mi, float2 *mo, 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 int | kmeans (const float *col, const dt_iop_roi_t *const roi, const int n, float2 *mean_out, float2 *var_out) |
| int | process (struct 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) |
| 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 | gui_update (struct dt_iop_module_t *self) |
| void | gui_init (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_colortransfer_data_t dt_iop_colortransfer_data_t |
| typedef enum dt_iop_colortransfer_flag_t dt_iop_colortransfer_flag_t |
| typedef struct dt_iop_colortransfer_gui_data_t dt_iop_colortransfer_gui_data_t |
| typedef struct dt_iop_colortransfer_params_t dt_iop_colortransfer_params_t |
| typedef float float2[2] |
|
static |
References dt_iop_roi_t::height, HISTN, i, and dt_iop_roi_t::width.
Referenced by process().
| 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, and dt_free_align.
| int default_colorspace | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
References IOP_CS_LAB.
| int default_group | ( | ) |
References IOP_GROUP_COLOR.
| const char * deprecated_msg | ( | ) |
| int flags | ( | ) |
References IOP_FLAGS_DEPRECATED, IOP_FLAGS_ONE_INSTANCE, and IOP_FLAGS_PREVIEW_NON_OPENCL.
|
static |
| void gui_init | ( | struct dt_iop_module_t * | self | ) |
References cluster_preview_draw(), draw(), DT_COLORSPACE_LAB, DT_COLORSPACE_SRGB, dt_colorspaces_get_profile(), DT_GUI_IOP_MODULE_CONTROL_SPACING, DT_PROFILE_DIRECTION_ANY, DT_PROFILE_DIRECTION_IN, dt_ui_label_new(), f, FALSE, g, IOP_GUI_ALLOC, MAXN, dt_iop_module_t::params_size, dt_colorspaces_color_profile_t::profile, TRUE, and dt_iop_module_t::widget.
| void gui_update | ( | struct dt_iop_module_t * | self | ) |
References dt_control_queue_redraw_widget(), g, dt_iop_module_t::gui_data, p, dt_iop_module_t::params, and dt_iop_module_t::widget.
| void init_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
References d, dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_iop_t::data_size, dt_calloc_align(), and NEUTRAL.
|
static |
|
static |
References c, dt_free, dt_points_get(), get_cluster(), dt_iop_roi_t::height, i, L, Lab, n, and dt_iop_roi_t::width.
Referenced by process().
| const char * name | ( | ) |
| int process | ( | struct 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 | ||
| ) |
References ACQUIRE, ACQUIRE2, ACQUIRED, APPLY, c, capture_histogram(), dt_iop_buffer_dsc_t::channels, dt_dev_pixelpipe_iop_t::data, dt_iop_module_t::dev, dt_dev_pixelpipe_iop_t::dsc_in, dt_dev_pixelpipe_has_preview_output(), dt_free, dt_iop_image_copy_by_size(), dt_iop_colortransfer_data_t::flag, get_cluster(), get_cluster_mapping(), get_clusters(), dt_iop_roi_t::height, dt_iop_colortransfer_data_t::hist, HISTN, i, invert_histogram(), kmeans(), L, Lab, MAXN, dt_iop_colortransfer_data_t::mean, dt_iop_colortransfer_data_t::n, out, p, dt_iop_module_t::params, dt_dev_pixelpipe_iop_t::roi_in, dt_dev_pixelpipe_iop_t::roi_out, dt_iop_colortransfer_data_t::var, weight(), and dt_iop_roi_t::width.