Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
useless.c File Reference
#include "bauhaus/bauhaus.h"
#include "develop/imageop.h"
#include "develop/imageop_gui.h"
#include "gui/color_picker_proxy.h"
#include "gui/gtk.h"
#include "iop/iop_api.h"
#include <gtk/gtk.h>
#include <stdlib.h>
+ Include dependency graph for useless.c:

Data Structures

struct  dt_iop_useless_params_t
 
struct  dt_iop_useless_gui_data_t
 
struct  dt_iop_useless_global_data_t
 

Typedefs

typedef enum dt_iop_useless_type_t dt_iop_useless_type_t
 
typedef struct dt_iop_useless_params_t dt_iop_useless_params_t
 
typedef struct dt_iop_useless_gui_data_t dt_iop_useless_gui_data_t
 
typedef struct dt_iop_useless_global_data_t dt_iop_useless_global_data_t
 

Enumerations

enum  dt_iop_useless_type_t {
  DT_USELESS_NONE = 0 ,
  DT_USELESS_FIRST = 1 ,
  DT_USELESS_SECOND = 2
}
 

Functions

const char * name ()
 
int flags ()
 
int default_group ()
 
int default_colorspace (dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, 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)
 
void commit_params (dt_iop_module_t *self, dt_iop_params_t *p1, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
 
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)
 
void init (dt_iop_module_t *module)
 
void init_global (dt_iop_module_so_t *module)
 
void cleanup (dt_iop_module_t *module)
 
void cleanup_global (dt_iop_module_so_t *module)
 
static void extra_callback (GtkWidget *w, dt_iop_module_t *self)
 
void gui_changed (dt_iop_module_t *self, GtkWidget *w, void *previous)
 
void color_picker_apply (dt_iop_module_t *self, GtkWidget *picker, dt_dev_pixelpipe_iop_t *piece)
 
void gui_update (dt_iop_module_t *self)
 
void reload_defaults (dt_iop_module_t *module)
 
gboolean force_enable (struct dt_iop_module_t *self, const gboolean current_state)
 
void gui_init (dt_iop_module_t *self)
 
void gui_cleanup (dt_iop_module_t *self)
 

Variables

static const int mask_id = 1
 
static const char * mask_name = "useless checkerboard"
 

Typedef Documentation

◆ dt_iop_useless_global_data_t

◆ dt_iop_useless_gui_data_t

◆ dt_iop_useless_params_t

◆ dt_iop_useless_type_t

Todo:
: some build system to support dt-less compilation and translation!

Enumeration Type Documentation

◆ dt_iop_useless_type_t

Todo:
: some build system to support dt-less compilation and translation!
Enumerator
DT_USELESS_NONE 
DT_USELESS_FIRST 
DT_USELESS_SECOND 

Function Documentation

◆ cleanup()

◆ cleanup_global()

void cleanup_global ( dt_iop_module_so_t module)

◆ color_picker_apply()

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

◆ extra_callback()

static void extra_callback ( GtkWidget *  w,
dt_iop_module_t self 
)
static

Put your local callbacks here, be sure to make them static so they won't be visible outside this file!

References darktable, darktable_t::develop, dt_bauhaus_slider_get(), dt_bauhaus_slider_set(), dt_dev_add_history_item, darktable_t::gui, dt_iop_module_t::gui_data, dt_iop_module_t::params, dt_gui_gtk_t::reset, and TRUE.

Referenced by gui_init().

◆ flags()

◆ force_enable()

gboolean force_enable ( struct dt_iop_module_t self,
const gboolean  current_state 
)

Optional: if this module is required to handle some type of image or incompatible with some other, here is the opportunity to forcefully enable/disable it to protect users from themselves when applying styles or copy-pasting histories. Return corrected enabled state, which might be the unaffected current_state if valid.

References dt_iop_module_t::dev, dt_image_is_raw(), dt_iop_module_t::enabled, FALSE, dt_develop_t::image_storage, and TRUE.

◆ gui_changed()

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

optional gui callbacks.

References DT_USELESS_SECOND, dt_iop_module_t::gui_data, and dt_iop_module_t::params.

Referenced by gui_update().

◆ gui_cleanup()

void gui_cleanup ( dt_iop_module_t self)

References IOP_GUI_FREE.

◆ gui_init()

◆ gui_update()

◆ init()

void init ( dt_iop_module_t module)

Optional init and cleanup

References dt_iop_default_init().

◆ init_global()

void init_global ( dt_iop_module_so_t module)

◆ 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 
)
Todo:
: the calling logic needs to be improved to call upgrades from consecutive version in sequence.

References DT_USELESS_SECOND, factor, and FALSE.

◆ name()

const char * name ( )

◆ process()

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 
)

modify regions of interest (optional, per pixel ops don't need this) modify a mask according to the pixel shifts the module applies (optional, per-pixel ops don't need this) process, all real work is done here. NOTE: process() must never use the Gtk+ API. All GUI modifications must be done in the Gtk+ thread. This is to be conducted in gui_update or gui_changed. If process detect a state and something it to be change on the UI a signal should be used (raise a signal here) and a corresponding callback must be connected to this signal.

References dt_iop_useless_params_t::checker_scale, dt_dev_pixelpipe_iop_t::colors, copy_pixel(), dt_dev_pixelpipe_iop_t::data, DT_IMGSZ_CLEARBUF, DT_IMGSZ_FULL, DT_IMGSZ_OUTPUT, dt_iop_alloc_image_buffers(), dt_iop_copy_image_roi(), dt_iop_have_required_input_format(), dt_iop_is_raster_mask_used(), dt_iop_useless_params_t::factor, for_each_channel, dt_iop_module_t::gui_data, dt_iop_roi_t::height, dt_dev_pixelpipe_iop_t::iscale, mask_id, dt_dev_pixelpipe_iop_t::pipe, dt_dev_pixelpipe_iop_t::raster_masks, dt_iop_roi_t::scale, TRUE, dt_iop_roi_t::width, dt_iop_roi_t::x, and dt_iop_roi_t::y.

◆ reload_defaults()

void reload_defaults ( dt_iop_module_t module)

optional: if this exists, it will be called to init new defaults if a new image is loaded from film strip mode.

References dt_iop_useless_params_t::checker_scale, dt_iop_module_t::default_params, dt_iop_module_t::dev, dt_bauhaus_slider_set_default(), dt_image_is_raw(), dt_iop_module_t::gui_data, and dt_develop_t::image_storage.

Variable Documentation

◆ mask_id

◆ mask_name

const char* mask_name = "useless checkerboard"
static