![]() |
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>
Data Structures | |
struct | dt_iop_dither_params_t |
struct | dt_iop_dither_gui_data_t |
struct | dt_iop_dither_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 |
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, 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 int | get_dither_parameters (const dt_iop_dither_data_t *const data, const dt_dev_pixelpipe_iop_t *const piece, const float scale, unsigned int *const restrict levels) |
static void | process_floyd_steinberg (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 | process_random (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 | 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 | 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 | 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_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 factor.
Referenced by process_floyd_steinberg().
|
inlinestatic |
References f().
Referenced by nearest_color().
|
inlinestatic |
Referenced by nearest_color().
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.
|
inlinestatic |
Referenced by clipnan_pixel().
|
inlinestatic |
References clipnan().
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, | ||
dt_dev_pixelpipe_iop_t * | piece | ||
) |
References IOP_CS_RGB.
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.
|
static |
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, DT_DEV_PIXELPIPE_PREVIEW, DT_DEV_PIXELPIPE_THUMBNAIL, dt_log2f(), IMAGEIO_BW, IMAGEIO_CHANNEL_MASK, IMAGEIO_FLOAT, IMAGEIO_GRAY, IMAGEIO_INT12, IMAGEIO_INT16, IMAGEIO_INT32, IMAGEIO_INT8, IMAGEIO_PREC_MASK, IMAGEIO_RGB, levels(), MAX, MIN, and dt_dev_pixelpipe_iop_t::pipe.
Referenced by process_floyd_steinberg().
void gui_changed | ( | dt_iop_module_t * | self, |
GtkWidget * | w, | ||
void * | previous | ||
) |
References DITHER_RANDOM, dt_iop_module_t::gui_data, 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, GRADIENT_SLIDER_MARKER_LOWER_OPEN_BIG, GRADIENT_SLIDER_MARKER_UPPER_FILLED_BIG, IOP_GUI_ALLOC, radius_callback(), TRUE, and dt_iop_module_t::widget.
void gui_update | ( | struct dt_iop_module_t * | self | ) |
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.
void init_presets | ( | dt_iop_module_so_t * | self | ) |
const char * name | ( | ) |
|
inlinestatic |
References _quantize(), _rgb_to_gray(), and f().
Referenced by process_floyd_steinberg().
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 |
References _diffuse_error(), clipnan_pixel(), dt_dev_pixelpipe_iop_t::data, DT_DEV_PIXELPIPE_DISPLAY_MASK, dt_iop_alpha_copy(), f(), get_dither_parameters(), height, dt_iop_roi_t::height, levels(), nearest_color(), dt_dev_pixelpipe_iop_t::pipe, 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 alloc_tea_states(), CLIP, dt_dev_pixelpipe_iop_t::colors, dt_iop_dither_data_t::damping, darktable, dt_dev_pixelpipe_iop_t::data, DT_DEV_PIXELPIPE_DISPLAY_MASK, dt_get_thread_num(), dt_iop_alpha_copy(), encrypt_tea(), free_tea_states(), get_tea_state(), height, dt_iop_roi_t::height, darktable_t::num_openmp_threads, dt_dev_pixelpipe_iop_t::pipe, 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 | ) |