Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
watermark.c File Reference
#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, dt_dev_pixelpipe_iop_t *piece)
 
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)
 
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)
 
static void watermark_callback (GtkWidget *tb, gpointer user_data)
 
void color_picker_apply (dt_iop_module_t *self, GtkWidget *picker, 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)
 
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_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

◆ _watermark_get_svgdoc()

◆ alignment_callback()

static void alignment_callback ( GtkWidget *  tb,
gpointer  user_data 
)
static

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

◆ default_colorspace()

int default_colorspace ( dt_iop_module_t self,
dt_dev_pixelpipe_t pipe,
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()

◆ init()

void init ( dt_iop_module_t module)

References dt_iop_default_init().

◆ init_pipe()

◆ 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 dt_iop_watermark_params_t::alignment, dt_iop_watermark_params_t::color, dt_iop_module_t::default_params, DT_SCALE_IMAGE, dt_iop_watermark_params_t::filename, dt_iop_watermark_params_t::font, dt_iop_watermark_params_t::opacity, dt_iop_watermark_params_t::rotate, dt_iop_watermark_params_t::scale, dt_iop_watermark_params_t::sizeto, dt_iop_watermark_params_t::text, dt_iop_watermark_params_t::xoffset, and dt_iop_watermark_params_t::yoffset.

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

◆ text_callback()

static void text_callback ( GtkWidget *  entry,
gpointer  user_data 
)
static

◆ watermark_callback()