Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
graduatednd.c File Reference
#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "bauhaus/bauhaus.h"
#include "common/colorspaces.h"
#include "common/debug.h"
#include "common/opencl.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/gradientslider.h"
#include "gui/color_picker_proxy.h"
#include "gui/draw.h"
#include "gui/gtk.h"
#include "gui/presets.h"
#include "iop/iop_api.h"
+ Include dependency graph for graduatednd.c:

Data Structures

struct  dt_iop_graduatednd_params_t
 
struct  dt_iop_graduatednd_global_data_t
 
struct  grad_point_t
 
struct  dt_iop_graduatednd_gui_data_t
 
struct  dt_iop_graduatednd_data_t
 
struct  dt_iop_vector_2d_t
 

Typedefs

typedef struct dt_iop_graduatednd_params_t dt_iop_graduatednd_params_t
 
typedef struct dt_iop_graduatednd_global_data_t dt_iop_graduatednd_global_data_t
 
typedef struct grad_point_t grad_point_t
 
typedef struct dt_iop_graduatednd_gui_data_t dt_iop_graduatednd_gui_data_t
 
typedef struct dt_iop_graduatednd_data_t dt_iop_graduatednd_data_t
 
typedef struct dt_iop_vector_2d_t dt_iop_vector_2d_t
 

Functions

void init_presets (dt_iop_module_so_t *self)
 
const char * name ()
 
const char ** description (struct dt_iop_module_t *self)
 
int flags ()
 
int default_group ()
 
int default_colorspace (dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece)
 
static float f (const float t, const float c, const float x)
 
static float _dist_seg (grad_point_t a, grad_point_t b, grad_point_t c)
 
static void _draw_end_marker (cairo_t *cr, const grad_point_t endpoint, const grad_point_t opposite, const float zoom_scale, const float normal_sign, const gboolean active)
 Draw one triangular endpoint marker on the graduated line.
 
static int set_grad_from_points (struct dt_iop_module_t *self, const grad_point_t *a, const grad_point_t *b, float *rotation, float *offset)
 
static int set_points_from_grad (struct dt_iop_module_t *self, grad_point_t *a, grad_point_t *b, const float rotation, const float offset)
 
static void update_saturation_slider_end_color (GtkWidget *slider, float hue)
 
void color_picker_apply (dt_iop_module_t *self, GtkWidget *picker, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
 
void gui_reset (struct dt_iop_module_t *self)
 
void gui_post_expose (struct dt_iop_module_t *self, cairo_t *cr, int32_t width, int32_t height, int32_t pointerx, int32_t pointery)
 
int mouse_moved (struct dt_iop_module_t *self, double x, double y, double pressure, int which)
 
int button_pressed (struct dt_iop_module_t *self, double x, double y, double pressure, int which, int type, uint32_t state)
 
int button_released (struct dt_iop_module_t *self, double x, double y, int which, uint32_t state)
 
int scrolled (dt_iop_module_t *self, double x, double y, int up, uint32_t state)
 
static float density_times_length (const float dens, const float length)
 
static float compute_density (const float dens, const float length)
 
__DT_CLONE_TARGETS__ 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)
 
int process_cl (struct dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, cl_mem dev_in, cl_mem dev_out)
 
void init_global (dt_iop_module_so_t *module)
 
void cleanup_global (dt_iop_module_so_t *module)
 
void gui_changed (dt_iop_module_t *self, GtkWidget *w, void *previous)
 
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 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)
 Refresh GUI controls from current params and configuration.
 
void gui_init (struct dt_iop_module_t *self)
 

Typedef Documentation

◆ dt_iop_graduatednd_data_t

◆ dt_iop_graduatednd_global_data_t

◆ dt_iop_graduatednd_gui_data_t

◆ dt_iop_graduatednd_params_t

◆ dt_iop_vector_2d_t

◆ grad_point_t

typedef struct grad_point_t grad_point_t

Function Documentation

◆ _dist_seg()

static float _dist_seg ( grad_point_t  a,
grad_point_t  b,
grad_point_t  c 
)
static

References t, grad_point_t::x, and grad_point_t::y.

Referenced by mouse_moved().

◆ _draw_end_marker()

static void _draw_end_marker ( cairo_t *  cr,
const grad_point_t  endpoint,
const grad_point_t  opposite,
const float  zoom_scale,
const float  normal_sign,
const gboolean  active 
)
static

Draw one triangular endpoint marker on the graduated line.

The marker geometry is built from the active endpoint and the opposite endpoint, then mirrored with normal_sign so the two markers keep opposite winding while sharing the same drawing path.

References dt_draw_node(), dt_draw_set_color_overlay(), DT_PIXEL_APPLY_DPI, DT_PIXEL_APPLY_DPI_DPP, FALSE, TRUE, x, grad_point_t::x, and grad_point_t::y.

Referenced by gui_post_expose().

◆ button_pressed()

int button_pressed ( struct dt_iop_module_t self,
double  x,
double  y,
double  pressure,
int  which,
int  type,
uint32_t  state 
)

◆ button_released()

◆ cleanup_global()

◆ cleanup_pipe()

void cleanup_pipe ( struct dt_iop_module_t self,
dt_dev_pixelpipe_t pipe,
dt_dev_pixelpipe_iop_t piece 
)

◆ color_picker_apply()

◆ commit_params()

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 
)

◆ compute_density()

static float compute_density ( const float  dens,
const float  length 
)
inlinestatic

References CLIP, d, density_times_length(), DT_M_LN2f, and t.

Referenced by process().

◆ default_colorspace()

int default_colorspace ( dt_iop_module_t self,
dt_dev_pixelpipe_t pipe,
const dt_dev_pixelpipe_iop_t piece 
)

References IOP_CS_RGB.

◆ default_group()

int default_group ( )

References IOP_GROUP_EFFECTS.

◆ density_times_length()

static float density_times_length ( const float  dens,
const float  length 
)
inlinestatic

Referenced by compute_density().

◆ description()

const char ** description ( struct dt_iop_module_t self)

◆ f()

static float f ( const float  t,
const float  c,
const float  x 
)
inlinestatic

References t, and x.

◆ flags()

◆ gui_changed()

◆ gui_init()

◆ gui_post_expose()

◆ gui_reset()

void gui_reset ( struct dt_iop_module_t self)

◆ gui_update()

void gui_update ( struct dt_iop_module_t self)

Refresh GUI controls from current params and configuration.

Todo:
check why needed
Todo:
by hand

References dt_iop_color_picker_reset(), g, dt_iop_module_t::gui_data, p, dt_iop_module_t::params, TRUE, and update_saturation_slider_end_color().

◆ init_global()

◆ init_pipe()

◆ init_presets()

◆ mouse_moved()

◆ name()

const char * name ( )

◆ process()

◆ process_cl()

◆ scrolled()

int scrolled ( dt_iop_module_t self,
double  x,
double  y,
int  up,
uint32_t  state 
)

◆ set_grad_from_points()

◆ set_points_from_grad()

◆ update_saturation_slider_end_color()

static void update_saturation_slider_end_color ( GtkWidget slider,
float  hue 
)
inlinestatic