![]() |
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>
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, 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 void | kmeans (const float *col, const dt_iop_roi_t *const roi, const int n, float2 *mean_out, float2 *var_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 | 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, 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.
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 * 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, 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 | ) |
void init_pipe | ( | struct dt_iop_module_t * | self, |
dt_dev_pixelpipe_t * | pipe, | ||
dt_dev_pixelpipe_iop_t * | piece | ||
) |
|
static |
|
static |
References dt_points_get(), get_cluster(), dt_iop_roi_t::height, Lab(), and dt_iop_roi_t::width.
Referenced by process().
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, ACQUIRE2, ACQUIRED, APPLY, capture_histogram(), dt_dev_pixelpipe_iop_t::colors, dt_dev_pixelpipe_iop_t::data, DT_DEV_PIXELPIPE_PREVIEW, 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, invert_histogram(), kmeans(), Lab(), MAXN, dt_iop_colortransfer_data_t::mean, dt_iop_colortransfer_data_t::n, dt_iop_module_t::params, dt_dev_pixelpipe_iop_t::pipe, dt_iop_colortransfer_data_t::var, weight(), and dt_iop_roi_t::width.