![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "bauhaus/bauhaus.h"#include "common/imagebuf.h"#include "common/imageio.h"#include "common/math.h"#include "common/opencl.h"#include "common/tea.h"#include "control/control.h"#include "develop/develop.h"#include "develop/imageop.h"#include "develop/imageop_math.h"#include "develop/imageop_gui.h"#include "develop/tiling.h"#include "dtgtk/gradientslider.h"#include "gui/gtk.h"#include "gui/presets.h"#include "iop/iop_api.h"#include <assert.h>#include <stdlib.h>#include <string.h>#include <gtk/gtk.h>#include <inttypes.h>
Include dependency graph for dither.c:Data Structures | |
| struct | dt_iop_dither_params_t |
| struct | dt_iop_dither_gui_data_t |
| struct | dt_iop_dither_data_t |
| struct | dt_iop_dither_global_data_t |
Macros | |
| #define | clipnan_pixel_sse clipnan_pixel |
| #define | RIGHT_WT (7.0f/16.0f) |
| #define | DOWNRIGHT_WT (1.0f/16.0f) |
| #define | DOWN_WT (5.0f/16.0f) |
| #define | DOWNLEFT_WT (3.0f/16.0f) |
| #define | PROCESS_PIXEL_FULL(_pixel, inpix) |
| #define | PROCESS_PIXEL_LEFT(_pixel, inpix) |
| #define | PROCESS_PIXEL_RIGHT(pixel) |
Typedefs | |
| typedef enum dt_iop_dither_type_t | dt_iop_dither_type_t |
| typedef struct dt_iop_dither_params_t | dt_iop_dither_params_t |
| typedef struct dt_iop_dither_gui_data_t | dt_iop_dither_gui_data_t |
| typedef struct dt_iop_dither_data_t | dt_iop_dither_data_t |
| typedef struct dt_iop_dither_global_data_t | dt_iop_dither_global_data_t |
Enumerations | |
| enum | dt_iop_dither_type_t { DITHER_RANDOM , DITHER_FS1BIT , DITHER_FS4BIT_GRAY , DITHER_FS8BIT , DITHER_FS16BIT , DITHER_FSAUTO } |
Functions | |
| const char * | name () |
| const char ** | description (struct dt_iop_module_t *self) |
| int | default_group () |
| int | flags () |
| int | default_colorspace (dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece) |
| void | init_presets (dt_iop_module_so_t *self) |
| void | reload_defaults (dt_iop_module_t *module) |
| static float | _quantize (const float val, const float f, const float rf) |
| static float | _rgb_to_gray (const float *const restrict val) |
| static void | nearest_color (float *const restrict val, float *const restrict err, int graymode, const float f, const float rf) |
| static void | _diffuse_error (float *const restrict val, const float *const restrict err, const float factor) |
| static float | clipnan (const float x) |
| static void | clipnan_pixel (float *const restrict out, const float *const restrict in) |
| static | __attribute__ ((always_inline)) |
| static __DT_CLONE_TARGETS__ void | process_floyd_steinberg (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, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out) |
| static __DT_CLONE_TARGETS__ void | process_random (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, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out) |
| 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) |
| void | gui_changed (dt_iop_module_t *self, GtkWidget *w, void *previous) |
| 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 | init_global (dt_iop_module_so_t *module) |
| void | cleanup_global (dt_iop_module_so_t *module) |
| void | gui_update (struct dt_iop_module_t *self) |
| void | gui_init (struct dt_iop_module_t *self) |
| #define clipnan_pixel_sse clipnan_pixel |
| #define DOWN_WT (5.0f/16.0f) |
| #define DOWNLEFT_WT (3.0f/16.0f) |
| #define DOWNRIGHT_WT (1.0f/16.0f) |
| #define PROCESS_PIXEL_FULL | ( | _pixel, | |
| inpix | |||
| ) |
| #define PROCESS_PIXEL_LEFT | ( | _pixel, | |
| inpix | |||
| ) |
| #define PROCESS_PIXEL_RIGHT | ( | pixel | ) |
| #define RIGHT_WT (7.0f/16.0f) |
| typedef struct dt_iop_dither_data_t dt_iop_dither_data_t |
| typedef struct dt_iop_dither_global_data_t dt_iop_dither_global_data_t |
| typedef struct dt_iop_dither_gui_data_t dt_iop_dither_gui_data_t |
| typedef struct dt_iop_dither_params_t dt_iop_dither_params_t |
| typedef enum dt_iop_dither_type_t dt_iop_dither_type_t |
| enum dt_iop_dither_type_t |
|
inlinestatic |
References DITHER_FS16BIT, DITHER_FS1BIT, DITHER_FS4BIT_GRAY, DITHER_FS8BIT, DITHER_FSAUTO, DITHER_RANDOM, dt_iop_dither_data_t::dither_type, DT_DEV_PIXELPIPE_EXPORT, IMAGEIO_BW, IMAGEIO_CHANNEL_MASK, IMAGEIO_FLOAT, IMAGEIO_GRAY, IMAGEIO_INT12, IMAGEIO_INT16, IMAGEIO_INT32, IMAGEIO_INT8, IMAGEIO_PREC_MASK, IMAGEIO_RGB, l1, dt_dev_pixelpipe_t::levels, levels(), MAX, MIN, and dt_dev_pixelpipe_t::type.
|
inlinestatic |
References __OMP_SIMD__, and factor.
Referenced by process_floyd_steinberg().
|
inlinestatic |
References f.
Referenced by nearest_color().
|
inlinestatic |
Referenced by nearest_color().
| void cleanup_global | ( | dt_iop_module_so_t * | module | ) |
| 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, and dt_free_align.
|
inlinestatic |
References x.
Referenced by clipnan_pixel().
|
inlinestatic |
References __OMP_SIMD__, clipnan(), and out.
Referenced by process_floyd_steinberg().
| 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 | ||
| ) |
| int default_colorspace | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
References IOP_CS_RGB_DISPLAY.
| int default_group | ( | ) |
References IOP_GROUP_TECHNICAL.
| const char ** description | ( | struct dt_iop_module_t * | self | ) |
References dt_iop_set_description().
| int flags | ( | ) |
References IOP_FLAGS_ONE_INSTANCE.
| void gui_changed | ( | dt_iop_module_t * | self, |
| GtkWidget * | w, | ||
| void * | previous | ||
| ) |
References DITHER_RANDOM, g, dt_iop_module_t::gui_data, p, and dt_iop_module_t::params.
| void gui_init | ( | struct dt_iop_module_t * | self | ) |
References darktable_t::bauhaus, darktable, dt_bauhaus_combobox_from_params(), dt_bauhaus_slider_from_params(), dt_bauhaus_slider_new_with_range(), dt_bauhaus_slider_set_digits(), dt_bauhaus_slider_set_format(), DT_BAUHAUS_SPACE, dt_bauhaus_widget_set_label(), DT_GUI_MODULE, DTGTK_GRADIENT_SLIDER, dtgtk_gradient_slider_multivalue_new(), dtgtk_gradient_slider_multivalue_set_marker(), dtgtk_gradient_slider_multivalue_set_value(), FALSE, g, GRADIENT_SLIDER_MARKER_LOWER_OPEN_BIG, GRADIENT_SLIDER_MARKER_UPPER_FILLED_BIG, IOP_GUI_ALLOC, p, radius_callback(), TRUE, and dt_iop_module_t::widget.
| void gui_update | ( | struct dt_iop_module_t * | self | ) |
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 DITHER_RANDOM, dt_bauhaus_slider_set(), DTGTK_GRADIENT_SLIDER, dtgtk_gradient_slider_multivalue_set_value(), g, dt_iop_module_t::gui_data, p, and dt_iop_module_t::params.
| void init_global | ( | dt_iop_module_so_t * | module | ) |
| 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, dt_dev_pixelpipe_iop_t::data_size, and dt_calloc_align().
| void init_presets | ( | dt_iop_module_so_t * | self | ) |
| const char * name | ( | ) |
|
inlinestatic |
References __OMP_SIMD__, _quantize(), _rgb_to_gray(), and f.
Referenced by process_floyd_steinberg().
| 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 |
References __OMP_SIMD__, _diffuse_error(), clipnan_pixel(), dt_dev_pixelpipe_iop_t::data, DT_DEV_PIXELPIPE_DISPLAY_MASK, f, height, dt_iop_roi_t::height, i, levels(), dt_dev_pixelpipe_t::mask_display, nearest_color(), out, ovoid, PROCESS_PIXEL_FULL, PROCESS_PIXEL_LEFT, PROCESS_PIXEL_RIGHT, RIGHT_WT, dt_iop_roi_t::scale, width, and dt_iop_roi_t::width.
Referenced by process().
|
static |
References __OMP_FOR__, __OMP_PARALLEL__, __OMP_SIMD__, alloc_tea_states(), CLIP, dt_iop_dither_data_t::damping, darktable, dt_dev_pixelpipe_iop_t::data, DT_DEV_PIXELPIPE_DISPLAY_MASK, dt_get_thread_num(), encrypt_tea(), free_tea_states(), get_tea_state(), height, dt_iop_roi_t::height, i, k, dt_dev_pixelpipe_t::mask_display, darktable_t::num_openmp_threads, out, ovoid, dt_iop_dither_data_t::random, tpdf(), width, and dt_iop_roi_t::width.
Referenced by process().
| void reload_defaults | ( | dt_iop_module_t * | module | ) |