![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#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"
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 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 |
typedef struct dt_iop_watermark_params_t dt_iop_watermark_params_t |
typedef enum dt_iop_watermark_type_t dt_iop_watermark_type_t |
|
static |
References _text_color_font_set_sensitive(), and dt_bauhaus_combobox_set().
Referenced by gui_update(), and refresh_watermarks().
|
static |
References dt_util_str_replace().
Referenced by _string_substitute().
|
static |
References _string_escape(), and dt_util_str_replace().
Referenced by _watermark_get_svgdoc().
|
static |
References extension().
Referenced by _combo_box_set_active_text(), and watermark_callback().
|
static |
References _string_substitute(), dt_iop_watermark_data_t::color, dt_image_full_path(), dt_lib_export_metadata_get_conf_flags(), dt_variables_expand(), dt_variables_params_destroy(), dt_variables_params_init(), dt_variables_set_tags_flags(), FALSE, flags(), dt_iop_watermark_data_t::font, dt_image_t::id, PATH_MAX, and dt_iop_watermark_data_t::text.
Referenced by process().
|
static |
References alignment_callback(), darktable, darktable_t::develop, dt_dev_add_history_item, FALSE, darktable_t::gui, dt_iop_module_t::gui_data, dt_iop_module_t::params, dt_gui_gtk_t::reset, and TRUE.
Referenced by alignment_callback(), and gui_init().
void cleanup_pipe | ( | struct dt_iop_module_t * | self, |
dt_dev_pixelpipe_t * | pipe, | ||
dt_dev_pixelpipe_iop_t * | piece | ||
) |
References dt_dev_pixelpipe_iop_t::data.
void color_picker_apply | ( | dt_iop_module_t * | self, |
GtkWidget * | picker, | ||
dt_dev_pixelpipe_iop_t * | piece | ||
) |
|
static |
References darktable, darktable_t::develop, dt_conf_set_float(), dt_dev_add_history_item, darktable_t::gui, dt_iop_module_t::params, dt_gui_gtk_t::reset, and TRUE.
Referenced by gui_init().
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 dt_iop_watermark_data_t::alignment, dt_iop_watermark_data_t::color, dt_dev_pixelpipe_iop_t::data, dt_iop_watermark_data_t::filename, dt_iop_watermark_data_t::font, dt_iop_watermark_data_t::opacity, dt_iop_watermark_data_t::rotate, dt_iop_watermark_data_t::scale, dt_iop_watermark_data_t::sizeto, dt_iop_watermark_data_t::text, dt_iop_watermark_data_t::xoffset, and dt_iop_watermark_data_t::yoffset.
int default_colorspace | ( | dt_iop_module_t * | self, |
dt_dev_pixelpipe_t * | pipe, | ||
dt_dev_pixelpipe_iop_t * | piece | ||
) |
References IOP_CS_RGB.
int default_group | ( | ) |
References IOP_GROUP_EFFECTS.
const char ** description | ( | struct dt_iop_module_t * | self | ) |
References dt_iop_set_description().
int flags | ( | ) |
References IOP_FLAGS_INCLUDE_IN_STYLES, and IOP_FLAGS_SUPPORTS_BLENDING.
Referenced by _watermark_get_svgdoc().
|
static |
References darktable, darktable_t::develop, dt_conf_set_string(), dt_dev_add_history_item, darktable_t::gui, dt_iop_module_t::params, dt_gui_gtk_t::reset, and TRUE.
Referenced by gui_init().
void gui_cleanup | ( | struct dt_iop_module_t * | self | ) |
References dt_iop_module_t::gui_data, and IOP_GUI_FREE.
void gui_init | ( | struct dt_iop_module_t * | self | ) |
References alignment_callback(), darktable_t::bauhaus, colorpick_color_set(), CPF_SPECIAL_FLAG, darktable, dt_accels_disconnect_on_text_input(), dt_bauhaus_combobox_from_params(), dt_bauhaus_combobox_new(), dt_bauhaus_slider_from_params(), dt_bauhaus_slider_set_digits(), dt_bauhaus_slider_set_format(), dt_bauhaus_slider_set_soft_max(), DT_BAUHAUS_SPACE, dt_color_picker_new(), DT_COLOR_PICKER_POINT, dt_conf_get_float(), dt_conf_get_string_const(), dt_gui_container_first_child(), DT_GUI_MODULE, dt_loc_get_datadir(), dt_loc_get_user_config_dir(), DT_PIXEL_APPLY_DPI, dt_ui_label_new(), dt_ui_section_label_new(), dtgtk_button_new(), dtgtk_cairo_paint_alignment(), dtgtk_cairo_paint_refresh(), dtgtk_reset_label_new(), dtgtk_togglebutton_new(), FALSE, fontsel_callback(), IOP_GUI_ALLOC, dt_iop_module_t::params, PATH_MAX, refresh_callback(), refresh_watermarks(), text_callback(), tooltip, TRUE, watermark_callback(), and dt_iop_module_t::widget.
void gui_update | ( | struct dt_iop_module_t * | self | ) |
References _combo_box_set_active_text(), FALSE, dt_iop_module_t::gui_data, dt_iop_module_t::params, and TRUE.
void init | ( | dt_iop_module_t * | module | ) |
References dt_iop_default_init().
void init_pipe | ( | struct dt_iop_module_t * | self, |
dt_dev_pixelpipe_t * | pipe, | ||
dt_dev_pixelpipe_iop_t * | piece | ||
) |
References dt_dev_pixelpipe_iop_t::data, and dt_dev_pixelpipe_iop_t::data_size.
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.
|
static |
References dt_bauhaus_combobox_add(), and extension().
Referenced by refresh_watermarks().
const char * name | ( | ) |
int operation_tags | ( | ) |
References IOP_TAG_DECORATION.
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 | ||
) |
References _watermark_get_svgdoc(), dt_iop_watermark_data_t::alignment, dt_dev_pixelpipe_iop_t::buf_in, dt_dev_pixelpipe_iop_t::colors, darktable, dt_dev_pixelpipe_iop_t::data, dimension(), dt_get_svg_dimension(), dt_iop_image_copy_by_size(), dt_loc_get_datadir(), dt_loc_get_user_config_dir(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_render_svg(), DT_SCALE_IMAGE, DT_SCALE_LARGER_BORDER, DT_SCALE_SMALLER_BORDER, DT_WTM_PNG, DT_WTM_SVG, error(), extension(), dt_iop_watermark_data_t::filename, dt_iop_roi_t::height, M_PI, dt_iop_watermark_data_t::opacity, PATH_MAX, dt_dev_pixelpipe_iop_t::pipe, darktable_t::plugin_threadsafe, dt_iop_watermark_data_t::rotate, dt_iop_roi_t::scale, dt_iop_watermark_data_t::scale, dt_iop_watermark_data_t::sizeto, type, dt_iop_roi_t::width, dt_iop_roi_t::x, dt_iop_watermark_data_t::xoffset, dt_iop_roi_t::y, and dt_iop_watermark_data_t::yoffset.
|
static |
References refresh_watermarks().
Referenced by gui_init().
|
static |
void reload_defaults | ( | dt_iop_module_t * | module | ) |
References dt_iop_watermark_params_t::filename, and dt_iop_watermark_params_t::font.
|
static |
References darktable, darktable_t::develop, dt_conf_set_string(), dt_dev_add_history_item, darktable_t::gui, dt_iop_module_t::params, dt_gui_gtk_t::reset, and TRUE.
Referenced by gui_init().
|
static |