Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
watermark.c File Reference
#include "common/darktable.h"
#include "bauhaus/bauhaus.h"
#include "common/imagebuf.h"
#include "common/tags.h"
#include "common/variables.h"
#include "common/datetime.h"
#include "control/control.h"
#include "develop/develop.h"
#include "develop/imageop.h"
#include "develop/imageop_gui.h"
#include "dtgtk/button.h"
#include "dtgtk/resetlabel.h"
#include "dtgtk/togglebutton.h"
#include "gui/color_picker_proxy.h"
#include "gui/gtk.h"
#include "iop/iop_api.h"
#include <assert.h>
#include <gtk/gtk.h>
#include <inttypes.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <librsvg/rsvg.h>
#include <librsvg/rsvg-cairo.h>
#include "common/file_location.h"
#include "common/metadata.h"
#include "common/utility.h"
+ Include dependency graph for watermark.c:

Data Structures

struct  dt_iop_watermark_params_t
 
struct  dt_iop_watermark_data_t
 
struct  dt_iop_watermark_gui_data_t
 

Typedefs

typedef enum dt_iop_watermark_base_scale_t dt_iop_watermark_base_scale_t
 
typedef enum dt_iop_watermark_type_t dt_iop_watermark_type_t
 
typedef struct dt_iop_watermark_params_t dt_iop_watermark_params_t
 
typedef struct dt_iop_watermark_data_t dt_iop_watermark_data_t
 
typedef struct dt_iop_watermark_gui_data_t dt_iop_watermark_gui_data_t
 

Enumerations

enum  dt_iop_watermark_base_scale_t {
  DT_SCALE_IMAGE = 0 ,
  DT_SCALE_LARGER_BORDER = 1 ,
  DT_SCALE_SMALLER_BORDER = 2
}
 
enum  dt_iop_watermark_type_t {
  DT_WTM_SVG = 0 ,
  DT_WTM_PNG = 1
}
 

Functions

int legacy_params (dt_iop_module_t *self, const void *const old_params, const int old_version, void *new_params, const int new_version)
 
const char * name ()
 
const char ** description (struct dt_iop_module_t *self)
 
int flags ()
 
int default_group ()
 
int operation_tags ()
 
int default_colorspace (dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece)
 
void input_format (dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece, dt_iop_buffer_dsc_t *dsc)
 
static void _text_color_font_set_sensitive (dt_iop_watermark_gui_data_t *g, gchar *filename)
 
static void _combo_box_set_active_text (dt_iop_watermark_gui_data_t *g, gchar *text)
 
static gchar * _string_escape (const gchar *string)
 
static gchar * _string_substitute (gchar *string, const gchar *search, const gchar *replace)
 
static gchar * _watermark_get_svgdoc (dt_iop_module_t *self, dt_iop_watermark_data_t *data, const dt_image_t *image, const gchar *filename)
 
__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)
 
static void watermark_callback (GtkWidget *tb, gpointer user_data)
 
void color_picker_apply (dt_iop_module_t *self, GtkWidget *picker, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
 
static void load_watermarks (const char *basedir, dt_iop_watermark_gui_data_t *g)
 
static void refresh_watermarks (dt_iop_module_t *self)
 
static void refresh_callback (GtkWidget *tb, gpointer user_data)
 
static void alignment_callback (GtkWidget *tb, gpointer user_data)
 
static void text_callback (GtkWidget *entry, gpointer user_data)
 
static void colorpick_color_set (GtkColorButton *widget, gpointer user_data)
 
static void fontsel_callback (GtkWidget *button, gpointer user_data)
 
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 init (dt_iop_module_t *module)
 
void reload_defaults (dt_iop_module_t *module)
 
void gui_init (struct dt_iop_module_t *self)
 
void gui_cleanup (struct dt_iop_module_t *self)
 

Typedef Documentation

◆ dt_iop_watermark_base_scale_t

◆ dt_iop_watermark_data_t

◆ dt_iop_watermark_gui_data_t

◆ dt_iop_watermark_params_t

◆ dt_iop_watermark_type_t

Enumeration Type Documentation

◆ dt_iop_watermark_base_scale_t

Enumerator
DT_SCALE_IMAGE 
DT_SCALE_LARGER_BORDER 
DT_SCALE_SMALLER_BORDER 

◆ dt_iop_watermark_type_t

Enumerator
DT_WTM_SVG 
DT_WTM_PNG 

Function Documentation

◆ _combo_box_set_active_text()

static void _combo_box_set_active_text ( dt_iop_watermark_gui_data_t g,
gchar *  text 
)
static

◆ _string_escape()

static gchar * _string_escape ( const gchar *  string)
static

References dt_free, and dt_util_str_replace().

Referenced by _string_substitute().

◆ _string_substitute()

static gchar * _string_substitute ( gchar *  string,
const gchar *  search,
const gchar *  replace 
)
static

◆ _text_color_font_set_sensitive()

static void _text_color_font_set_sensitive ( dt_iop_watermark_gui_data_t g,
gchar *  filename 
)
static

References extension(), and g.

Referenced by _combo_box_set_active_text(), and watermark_callback().

◆ _watermark_get_svgdoc()

◆ alignment_callback()

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

◆ colorpick_color_set()

static void colorpick_color_set ( GtkColorButton *  widget,
gpointer  user_data 
)
static

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

References d, dt_dev_pixelpipe_iop_t::data, k, and p.

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

◆ description()

const char ** description ( struct dt_iop_module_t self)

◆ flags()

◆ fontsel_callback()

static void fontsel_callback ( GtkWidget button,
gpointer  user_data 
)
static

◆ gui_cleanup()

void gui_cleanup ( struct dt_iop_module_t self)

◆ gui_init()

◆ 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

History navigation and fast module toggles can reload a newer parameter state into the module while an older throttled graph edit is still queued. Once GUI update sees that the history-backed module params no longer match the live graph cache, that delayed local commit is stale and must be dropped or it may replay obsolete parameters after the history stack already moved on.

References _combo_box_set_active_text(), FALSE, g, dt_iop_module_t::gui_data, i, p, dt_iop_module_t::params, and TRUE.

◆ init()

void init ( dt_iop_module_t module)

References dt_iop_default_init().

◆ init_pipe()

◆ input_format()

◆ legacy_params()

int legacy_params ( dt_iop_module_t self,
const void *const  old_params,
const int  old_version,
void new_params,
const int  new_version 
)

opacity value of rendering watermark

scale value of rendering watermark

Pixel independent xoffset, 0 to 1

Pixel independent yoffset, 0 to 1

Alignment value 0-8 3x3

opacity value of rendering watermark

scale value of rendering watermark

Pixel independent xoffset, 0 to 1

Pixel independent yoffset, 0 to 1

Alignment value 0-8 3x3

opacity value of rendering watermark

scale value of rendering watermark

Pixel independent xoffset, 0 to 1

Pixel independent yoffset, 0 to 1

Alignment value 0-8 3x3

Rotation

opacity value of rendering watermark

scale value of rendering watermark

Pixel independent xoffset, 0 to 1

Pixel independent yoffset, 0 to 1

Alignment value 0-8 3x3

Rotation

References d, dt_iop_module_t::default_params, DT_SCALE_IMAGE, and n.

◆ load_watermarks()

static void load_watermarks ( const char *  basedir,
dt_iop_watermark_gui_data_t g 
)
static

◆ name()

const char * name ( )

◆ operation_tags()

int operation_tags ( )

References IOP_TAG_DECORATION.

◆ process()

◆ refresh_callback()

static void refresh_callback ( GtkWidget tb,
gpointer  user_data 
)
static

References refresh_watermarks().

Referenced by gui_init().

◆ refresh_watermarks()

◆ reload_defaults()

void reload_defaults ( dt_iop_module_t module)

References d.

◆ text_callback()

static void text_callback ( GtkWidget entry,
gpointer  user_data 
)
static

◆ watermark_callback()