Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
vignette.c File Reference
#include <assert.h>
#include "system/macros.h"
#include "system/openmp.h"
#include "system/target_clones.h"
#include "system/mem_alloc.h"
#include "common/logging.h"
#include "common/module_versioning.h"
#include "database/database.h"
#include <stdlib.h>
#include <string.h>
#include "widgets/bauhaus.h"
#include "widgets/accelerators.h"
#include "math/math.h"
#include "common/opencl.h"
#include "pixel/tea.h"
#include "control/input.h"
#include "control/control.h"
#include "develop/develop.h"
#include "develop/imageop.h"
#include "develop/imageop_gui.h"
#include "gui/presets.h"
#include "widgets/draw.h"
#include "iop/iop_api.h"
#include <gtk/gtk.h>
#include <inttypes.h>
#include "widgets/label.h"
+ Include dependency graph for vignette.c:

Go to the source code of this file.

Data Structures

struct  dt_iop_dvector_2d_t
 
struct  dt_iop_fvector_2d_t
 
struct  dt_iop_vignette_params1_t
 
struct  dt_iop_vignette_params2_t
 
struct  dt_iop_vignette_params3_t
 
struct  dt_iop_vignette_params_t
 
struct  dt_iop_vignette_gui_data_t
 
struct  dt_iop_vignette_data_t
 
struct  dt_iop_vignette_global_data_t
 
struct  dt_iop_vignette_geometry_t
 

Macros

#define VIGNETTE_OUTLINE_SAMPLES   128
 

Typedefs

typedef enum dt_iop_dither_t dt_iop_dither_t
 
typedef struct dt_iop_dvector_2d_t dt_iop_dvector_2d_t
 
typedef struct dt_iop_fvector_2d_t dt_iop_vector_2d_t
 
typedef struct dt_iop_vignette_params1_t dt_iop_vignette_params1_t
 
typedef struct dt_iop_vignette_params2_t dt_iop_vignette_params2_t
 
typedef struct dt_iop_vignette_params3_t dt_iop_vignette_params3_t
 
typedef struct dt_iop_vignette_params_t dt_iop_vignette_params_t
 
typedef struct dt_iop_vignette_gui_data_t dt_iop_vignette_gui_data_t
 
typedef struct dt_iop_vignette_data_t dt_iop_vignette_data_t
 
typedef struct dt_iop_vignette_global_data_t dt_iop_vignette_global_data_t
 
typedef struct dt_iop_vignette_geometry_t dt_iop_vignette_geometry_t
 

Enumerations

enum  dt_iop_dither_t {
  DITHER_OFF = 0 ,
  DITHER_8BIT = 1 ,
  DITHER_16BIT = 2
}
 

Functions

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)
 
int legacy_params (dt_iop_module_t *self, const void *const old_params, const int old_version, void *new_params, const int new_version)
 
static gboolean _vignette_geometry (dt_iop_module_t *self, const dt_iop_vignette_params_t *p, dt_iop_vignette_geometry_t *geo)
 
static gboolean _module_to_image_abs (dt_iop_module_t *self, float *pts, const size_t count)
 
static gboolean _widget_to_module (dt_iop_module_t *self, const double x, const double y, float pt[2])
 
static void _vignette_handles (const dt_iop_vignette_geometry_t *geo, float pts[10])
 
static int _get_grab (dt_iop_module_t *self, const dt_iop_vignette_geometry_t *geo, const double x, const double y)
 
static void _outline_sample (const dt_iop_vignette_geometry_t *geo, const float rx, const float ry, float *pts)
 
static void _draw_closed_path (cairo_t *cr, const float *pts, const int count)
 
static void _draw_overlay (cairo_t *cr, const float *inner, const float *outer, const float *handles, const int grab, const float zoom_scale)
 
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)
 
__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_presets (dt_iop_module_so_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 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)
 

Macro Definition Documentation

◆ VIGNETTE_OUTLINE_SAMPLES

#define VIGNETTE_OUTLINE_SAMPLES   128

Definition at line 298 of file vignette.c.

Typedef Documentation

◆ dt_iop_dither_t

◆ dt_iop_dvector_2d_t

◆ dt_iop_vector_2d_t

◆ dt_iop_vignette_data_t

◆ dt_iop_vignette_geometry_t

◆ dt_iop_vignette_global_data_t

◆ dt_iop_vignette_gui_data_t

◆ dt_iop_vignette_params1_t

◆ dt_iop_vignette_params2_t

◆ dt_iop_vignette_params3_t

◆ dt_iop_vignette_params_t

Enumeration Type Documentation

◆ dt_iop_dither_t

Enumerator
DITHER_OFF 
DITHER_8BIT 
DITHER_16BIT 

Definition at line 84 of file vignette.c.

Function Documentation

◆ _draw_closed_path()

static void _draw_closed_path ( cairo_t *  cr,
const float *  pts,
const int  count 
)
static

Definition at line 411 of file vignette.c.

References i.

Referenced by _draw_overlay().

◆ _draw_overlay()

static void _draw_overlay ( cairo_t *  cr,
const float *  inner,
const float *  outer,
const float *  handles,
const int  grab,
const float  zoom_scale 
)
static

Definition at line 419 of file vignette.c.

References _draw_closed_path(), DT_PIXEL_APPLY_DPI, i, M_PI, and VIGNETTE_OUTLINE_SAMPLES.

Referenced by gui_post_expose().

◆ _get_grab()

◆ _module_to_image_abs()

static gboolean _module_to_image_abs ( dt_iop_module_t *  self,
float *  pts,
const size_t  count 
)
static

◆ _outline_sample()

static void _outline_sample ( const dt_iop_vignette_geometry_t *  geo,
const float  rx,
const float  ry,
float *  pts 
)
static

◆ _vignette_geometry()

◆ _vignette_handles()

◆ _widget_to_module()

static gboolean _widget_to_module ( dt_iop_module_t *  self,
const double  x,
const double  y,
float  pt[2] 
)
static

◆ button_pressed()

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

Definition at line 596 of file vignette.c.

◆ button_released()

int button_released ( struct dt_iop_module_t *  self,
double  x,
double  y,
int  which,
uint32_t  state 
)

Definition at line 603 of file vignette.c.

◆ cleanup_global()

◆ cleanup_pipe()

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

Definition at line 936 of file vignette.c.

References dt_free_align, and piece.

◆ 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 
)

Definition at line 893 of file vignette.c.

References d, p, and piece.

◆ default_colorspace()

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

Definition at line 215 of file vignette.c.

References IOP_CS_RGB.

◆ default_group()

int default_group ( )

Definition at line 210 of file vignette.c.

References IOP_GROUP_EFFECTS.

◆ description()

const char ** description ( struct dt_iop_module_t *  self)

Definition at line 195 of file vignette.c.

References dt_iop_set_description().

◆ flags()

◆ gui_changed()

void gui_changed ( dt_iop_module_t *  self,
GtkWidget *  w,
void *  previous 
)

Definition at line 884 of file vignette.c.

References dt_iop_gui_data(), g, IS_NULL_PTR, p, and dt_iop_module_t::params.

◆ gui_init()

◆ gui_post_expose()

◆ gui_update()

void gui_update ( struct dt_iop_module_t *  self)

Refresh GUI controls from current params and configuration.

gui callbacks, these are needed.

gui setup and update, these are needed.

Todo:
check why needed
Todo:
by hand

Definition at line 942 of file vignette.c.

References dt_iop_gui_data(), g, IS_NULL_PTR, p, and dt_iop_module_t::params.

◆ init_global()

void init_global ( dt_iop_module_so_t *  module)

◆ init_pipe()

void init_pipe ( struct dt_iop_module_t *  self,
dt_dev_pixelpipe_t *  pipe,
dt_dev_pixelpipe_iop_t *  piece 
)

Definition at line 930 of file vignette.c.

References dt_calloc_align(), and piece.

◆ init_presets()

◆ legacy_params()

◆ mouse_moved()

int mouse_moved ( struct dt_iop_module_t *  self,
double  x,
double  y,
double  pressure,
int  which 
)

◆ name()

const char * name ( )

Definition at line 190 of file vignette.c.

◆ process()

◆ process_cl()