Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
guides.c File Reference
#include <glib.h>
#include "bauhaus/bauhaus.h"
#include "common/darktable.h"
#include "develop/imageop_gui.h"
#include "dtgtk/button.h"
#include "gui/guides.h"
#include "gui/draw.h"
#include "control/control.h"
+ Include dependency graph for gui/guides.c:

Data Structures

struct  dt_QRect_t
 
struct  _guides_settings_t
 

Macros

#define DEFAULT_GUIDE_NAME   "rules of thirds"
 
#define PERSPECTIVE_LINES   16
 
#define X_LINES   49
 
#define Y_LINES   33
 
#define CROSSES   6
 
#define RADIANS(degrees)   ((degrees) * (M_PI / 180.))
 

Typedefs

typedef enum dt_golden_type_t dt_golden_type_t
 
typedef struct dt_QRect_t dt_QRect_t
 
typedef struct _guides_settings_t _guides_settings_t
 

Enumerations

enum  dt_golden_type_t {
  GOLDEN_SECTION = 0 ,
  GOLDEN_SPIRAL ,
  GOLDEN_SPIRAL_SECTION ,
  GOLDEN_ALL
}
 

Functions

static void dt_guides_q_rect (dt_QRect_t *R1, float left, float top, float width, float height)
 
static int _guides_get_value (gchar *name)
 
static gchar * _conf_get_path (gchar *module_name, gchar *property_1, gchar *property_2)
 
static dt_guides_t_conf_get_guide (gchar *module_name)
 
static gchar * _conf_get_guide_name (gchar *module_name)
 
static void dt_guides_draw_grid (cairo_t *cr, const float x, const float y, const float w, const float h, float zoom_scale, void *data)
 
static void _grid_horizontal_changed (GtkWidget *w, void *data)
 
static void _grid_vertical_changed (GtkWidget *w, void *data)
 
static void _grid_subdiv_changed (GtkWidget *w, void *data)
 
static GtkWidget * _guides_gui_grid (dt_iop_module_t *self, void *user_data)
 
static void dt_guides_draw_diagonal_method (cairo_t *cr, const float x, const float y, const float w, const float h)
 
static void dt_guides_draw_rules_of_thirds (cairo_t *cr, const float left, const float top, const float width, const float height)
 
static void dt_guides_draw_harmonious_triangles (cairo_t *cr, const float left, const float top, const float width, const float height)
 
static void dt_guides_draw_perspective (cairo_t *cr, const float x, const float y, const float w, const float h)
 
static void dt_guides_draw_metering (cairo_t *cr, const float x, const float y, const float w, const float h)
 
static void dt_guides_draw_golden_mean (cairo_t *cr, dt_QRect_t *R1, dt_QRect_t *R2, dt_QRect_t *R3, dt_QRect_t *R4, dt_QRect_t *R5, dt_QRect_t *R6, dt_QRect_t *R7, gboolean goldenSection, gboolean goldenTriangle, gboolean goldenSpiralSection, gboolean goldenSpiral)
 
static void _guides_draw_grid (cairo_t *cr, const float x, const float y, const float w, const float h, const float zoom_scale, void *user_data)
 
static void _guides_draw_rules_of_thirds (cairo_t *cr, const float x, const float y, const float w, const float h, const float zoom_scale, void *user_data)
 
static void _guides_draw_metering (cairo_t *cr, const float x, const float y, const float w, const float h, const float zoom_scale, void *user_data)
 
static void _guides_draw_perspective (cairo_t *cr, const float x, const float y, const float w, const float h, const float zoom_scale, void *user_data)
 
static void _guides_draw_diagonal_method (cairo_t *cr, const float x, const float y, const float w, const float h, const float zoom_scale, void *user_data)
 
static void _guides_draw_harmonious_triangles (cairo_t *cr, const float x, const float y, const float w, const float h, const float zoom_scale, void *user_data)
 
static void _guides_draw_golden_mean (cairo_t *cr, const float x, const float y, const float w, const float h, const float zoom_scale, void *user_data)
 
static void _guides_add_guide (GList **list, const char *name, dt_guides_draw_callback draw, dt_guides_widget_callback widget, void *user_data, GDestroyNotify free, gboolean support_flip)
 
void dt_guides_add_guide (const char *name, dt_guides_draw_callback draw, dt_guides_widget_callback widget, void *user_data, GDestroyNotify free)
 
GList * dt_guides_init ()
 
static void _settings_update_visibility (_guides_settings_t *gw)
 
static void _settings_flip_update (_guides_settings_t *gw)
 
static void _settings_guides_changed (GtkWidget *w, _guides_settings_t *gw)
 
static void _settings_flip_changed (GtkWidget *w, _guides_settings_t *gw)
 
void dt_guides_set_overlay_colors ()
 
static void _settings_colors_changed (GtkWidget *combo, _guides_settings_t *gw)
 
static void _settings_contrast_changed (GtkWidget *slider, _guides_settings_t *gw)
 
GtkWidget * dt_guides_popover (dt_view_t *self, GtkWidget *button)
 
void dt_guides_update_button_state ()
 
void dt_guides_button_toggled (gboolean active)
 
void dt_guides_draw (cairo_t *cr, const float left, const float top, const float width, const float height, const float zoom_scale)
 
static void free_guide (void *data)
 
void dt_guides_cleanup (GList *guides)
 
void dt_guides_update_popover_values ()
 

Variables

static const char * _guide_names []
 

Macro Definition Documentation

◆ CROSSES

#define CROSSES   6

◆ DEFAULT_GUIDE_NAME

#define DEFAULT_GUIDE_NAME   "rules of thirds"

◆ PERSPECTIVE_LINES

#define PERSPECTIVE_LINES   16

◆ RADIANS

#define RADIANS (   degrees)    ((degrees) * (M_PI / 180.))

◆ X_LINES

#define X_LINES   49

◆ Y_LINES

#define Y_LINES   33

Typedef Documentation

◆ _guides_settings_t

◆ dt_golden_type_t

◆ dt_QRect_t

typedef struct dt_QRect_t dt_QRect_t

Enumeration Type Documentation

◆ dt_golden_type_t

Enumerator
GOLDEN_SECTION 
GOLDEN_SPIRAL 
GOLDEN_SPIRAL_SECTION 
GOLDEN_ALL 

Function Documentation

◆ _conf_get_guide()

◆ _conf_get_guide_name()

static gchar * _conf_get_guide_name ( gchar *  module_name)
static

◆ _conf_get_path()

◆ _grid_horizontal_changed()

static void _grid_horizontal_changed ( GtkWidget *  w,
void data 
)
static

◆ _grid_subdiv_changed()

static void _grid_subdiv_changed ( GtkWidget *  w,
void data 
)
static

◆ _grid_vertical_changed()

static void _grid_vertical_changed ( GtkWidget *  w,
void data 
)
static

◆ _guides_add_guide()

◆ _guides_draw_diagonal_method()

static void _guides_draw_diagonal_method ( cairo_t *  cr,
const float  x,
const float  y,
const float  w,
const float  h,
const float  zoom_scale,
void user_data 
)
static

◆ _guides_draw_golden_mean()

static void _guides_draw_golden_mean ( cairo_t *  cr,
const float  x,
const float  y,
const float  w,
const float  h,
const float  zoom_scale,
void user_data 
)
static

◆ _guides_draw_grid()

static void _guides_draw_grid ( cairo_t *  cr,
const float  x,
const float  y,
const float  w,
const float  h,
const float  zoom_scale,
void user_data 
)
static

References dt_guides_draw_grid().

Referenced by dt_guides_init().

◆ _guides_draw_harmonious_triangles()

static void _guides_draw_harmonious_triangles ( cairo_t *  cr,
const float  x,
const float  y,
const float  w,
const float  h,
const float  zoom_scale,
void user_data 
)
static

◆ _guides_draw_metering()

static void _guides_draw_metering ( cairo_t *  cr,
const float  x,
const float  y,
const float  w,
const float  h,
const float  zoom_scale,
void user_data 
)
static

References dt_guides_draw_metering().

Referenced by dt_guides_init().

◆ _guides_draw_perspective()

static void _guides_draw_perspective ( cairo_t *  cr,
const float  x,
const float  y,
const float  w,
const float  h,
const float  zoom_scale,
void user_data 
)
static

References dt_guides_draw_perspective().

Referenced by dt_guides_init().

◆ _guides_draw_rules_of_thirds()

static void _guides_draw_rules_of_thirds ( cairo_t *  cr,
const float  x,
const float  y,
const float  w,
const float  h,
const float  zoom_scale,
void user_data 
)
static

◆ _guides_get_value()

static int _guides_get_value ( gchar *  name)
static

◆ _guides_gui_grid()

◆ _settings_colors_changed()

static void _settings_colors_changed ( GtkWidget *  combo,
_guides_settings_t gw 
)
static

◆ _settings_contrast_changed()

static void _settings_contrast_changed ( GtkWidget *  slider,
_guides_settings_t gw 
)
static

◆ _settings_flip_changed()

◆ _settings_flip_update()

◆ _settings_guides_changed()

◆ _settings_update_visibility()

◆ dt_guides_add_guide()

void dt_guides_add_guide ( const char *  name,
dt_guides_draw_callback  draw,
dt_guides_widget_callback  widget,
void user_data,
GDestroyNotify  free 
)

◆ dt_guides_button_toggled()

void dt_guides_button_toggled ( gboolean  active)

◆ dt_guides_cleanup()

void dt_guides_cleanup ( GList *  guides)

References free_guide().

Referenced by dt_cleanup().

◆ dt_guides_draw()

void dt_guides_draw ( cairo_t *  cr,
const float  left,
const float  top,
const float  width,
const float  height,
const float  zoom_scale 
)

◆ dt_guides_draw_diagonal_method()

static void dt_guides_draw_diagonal_method ( cairo_t *  cr,
const float  x,
const float  y,
const float  w,
const float  h 
)
static

References dt_draw_line().

Referenced by _guides_draw_diagonal_method().

◆ dt_guides_draw_golden_mean()

static void dt_guides_draw_golden_mean ( cairo_t *  cr,
dt_QRect_t R1,
dt_QRect_t R2,
dt_QRect_t R3,
dt_QRect_t R4,
dt_QRect_t R5,
dt_QRect_t R6,
dt_QRect_t R7,
gboolean  goldenSection,
gboolean  goldenTriangle,
gboolean  goldenSpiralSection,
gboolean  goldenSpiral 
)
static

◆ dt_guides_draw_grid()

static void dt_guides_draw_grid ( cairo_t *  cr,
const float  x,
const float  y,
const float  w,
const float  h,
float  zoom_scale,
void data 
)
static

◆ dt_guides_draw_harmonious_triangles()

static void dt_guides_draw_harmonious_triangles ( cairo_t *  cr,
const float  left,
const float  top,
const float  width,
const float  height 
)
static

◆ dt_guides_draw_metering()

static void dt_guides_draw_metering ( cairo_t *  cr,
const float  x,
const float  y,
const float  w,
const float  h 
)
static

References CROSSES, dt_draw_line(), MIN, X_LINES, and Y_LINES.

Referenced by _guides_draw_metering().

◆ dt_guides_draw_perspective()

static void dt_guides_draw_perspective ( cairo_t *  cr,
const float  x,
const float  y,
const float  w,
const float  h 
)
static

◆ dt_guides_draw_rules_of_thirds()

static void dt_guides_draw_rules_of_thirds ( cairo_t *  cr,
const float  left,
const float  top,
const float  width,
const float  height 
)
static

References dt_draw_line(), height, and width.

Referenced by _guides_draw_rules_of_thirds().

◆ dt_guides_init()

◆ dt_guides_popover()

◆ dt_guides_q_rect()

static void dt_guides_q_rect ( dt_QRect_t R1,
float  left,
float  top,
float  width,
float  height 
)
static

◆ dt_guides_set_overlay_colors()

◆ dt_guides_update_button_state()

◆ dt_guides_update_popover_values()

◆ free_guide()

static void free_guide ( void data)
static

Variable Documentation

◆ _guide_names

const char* _guide_names[]
static
Initial value:
= { N_("grid"),
N_("rules of thirds"),
N_("metering"),
N_("perspective"),
N_("diagonal method"),
N_("harmonious triangles"),
N_("golden sections"),
N_("golden spiral"),
N_("golden spiral sections"),
N_("golden mean (all guides)"),
NULL }

Referenced by dt_guides_init(), and dt_guides_popover().