75 return _(
"scan restore");
95#define SET_PIXEL(array, x, y, z, w) \
111 d->diffusion =
p->diffusion;
112 d->iterations =
p->iterations;
149 const float *
const restrict in = (
const float *
const restrict)ivoid;
150 float *
const restrict
out = (
float *
const restrict)
ovoid;
154 const float sharpen =
d->diffusion / (scale * scale) /
d->iterations;
157 for(
int j = 0; j < roi_out->
width; j++)
159 const size_t index = ((
i * roi_out->
width) + j) * 4;
163 float *restrict temp_in = cmy;
164 float *restrict temp_out =
out;
166 for(
int iter = 0; iter <
d->iterations; iter++)
173 else if(iter % 2 != 0)
185 for(
int j = 0; j < roi_out->
width; j++)
187 const size_t index = ((
i * roi_out->
width) + j) * 4;
189 for_four_channels(c, aligned(temp1, temp_in)) temp1[c] = temp_in[index + c] -
d->offsets[c];
190 dot_product(temp1,
d->CMY, temp2);
191 for_four_channels(c, aligned(temp2, temp_in)) temp_in[index + c] = CLAMP(((
d->iterations - 1) * temp_in[index + c] + temp2[c]) / (
d->iterations), 0.f, 1.f);
195 for(
int j = 0; j < roi_out->
width; j++)
197 const size_t index = ((
i * roi_out->
width) + j) * 4;
201 const float kernel[3][3] = { { 0.25f, 0.5f, 0.25f }, { 0.5f, -3.f, 0.5f }, { 0.25f, 0.5f, 0.25f } };
205 for(
int ii = 0; ii < 3; ii++)
206 for(
int jj = 0; jj < 3; jj++)
208 const int row = CLAMP(
i + ii - 1, 0, roi_in->
height - 1);
209 const int column = CLAMP(j + jj - 1, 0, roi_in->
width - 1);
210 const size_t idx = ((
row * roi_in->
width) + column) * 4;
214 for_each_channel(c) temp_out[index + c] = CLAMP(temp_in[index + c] - laplacian[c] * sharpen, 0.f, 1.f);
219 for(
int j = 0; j < roi_out->
width; j++)
221 const size_t index = ((
i * roi_out->
width) + j) * 4;
239 if(picker ==
g->factor)
241 p->factor = self->picked_color[1];
void color_picker_apply(dt_iop_module_t *self, GtkWidget *picker, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
static const dt_aligned_pixel_simd_t const dt_adaptation_t const float p
const dt_colormatrix_t dt_aligned_pixel_t out
void dt_control_queue_redraw_widget(GtkWidget *widget)
threadsafe request of redraw of specific widget. Use this function if you need to redraw a specific w...
#define dt_free_align(ptr)
static void * dt_calloc_align(size_t size)
#define for_each_channel(_var,...)
#define dt_pixelpipe_cache_alloc_align_float_cache(pixels, id)
#define DT_MODULE_INTROSPECTION(MODVER, PARAMSTYPE)
#define dt_pixelpipe_cache_free_align(mem)
#define __DT_CLONE_TARGETS__
#define for_four_channels(_var,...)
#define __OMP_PARALLEL_FOR__(...)
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
#define dt_dev_add_history_item(dev, module, enable, redraw)
#define DT_GUI_BOX_SPACING
float dt_dev_get_module_scale(const dt_dev_pixelpipe_t *const pipe, const dt_iop_roi_t *const roi_in)
@ IOP_FLAGS_INCLUDE_IN_STYLES
@ IOP_FLAGS_SUPPORTS_BLENDING
#define IOP_GUI_ALLOC(module)
GtkWidget * dt_bauhaus_slider_from_params(dt_iop_module_t *self, const char *param)
static float kernel(const float *x, const float *y)
float DT_ALIGNED_ARRAY dt_colormatrix_t[4][4]
float dt_aligned_pixel_t[4]
__DT_CLONE_TARGETS__ 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_init(dt_iop_module_t *self)
#define SET_PIXEL(array, x, y, z, w)
void tiling_callback(struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe, const struct dt_dev_pixelpipe_iop_t *piece, struct dt_develop_tiling_t *tiling)
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 cleanup_pipe(dt_iop_module_t *self, 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)
void init_pipe(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
struct _GtkWidget GtkWidget
struct dt_develop_t * develop
struct dt_iop_module_t *void * data
dt_aligned_pixel_t offsets
GtkWidget * regularization
Region of interest passed through the pixelpipe.