Skip to content

Commit 143c41a

Browse files
jenshannoschwalmTurboGit
authored andcommitted
Further unification: dt_iop_module_so_t *module
In case of internal module functions it should also always be `dt_iop_module_so_t *self`. Not consistent between modules. While being here some redundant struct removed from function parameters.
1 parent 9cc90ba commit 143c41a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+345
-347
lines changed

src/develop/blends/blendif_lab.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ static void _blendif_combine_channels(const float *const restrict pixels,
188188
}
189189
}
190190

191-
void dt_develop_blendif_lab_make_mask(struct dt_dev_pixelpipe_iop_t *piece,
191+
void dt_develop_blendif_lab_make_mask(dt_dev_pixelpipe_iop_t *piece,
192192
const float *const restrict a,
193193
const float *const restrict b,
194194
const struct dt_iop_roi_t *const roi_in,

src/develop/masks/brush.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,7 @@ static float _brush_get_position_in_segment(const float x,
13121312
return tmin;
13131313
}
13141314

1315-
static int _brush_events_mouse_scrolled(struct dt_iop_module_t *module,
1315+
static int _brush_events_mouse_scrolled(dt_iop_module_t *module,
13161316
const float pzx,
13171317
const float pzy,
13181318
const int up,
@@ -1465,7 +1465,7 @@ static int _brush_events_mouse_scrolled(struct dt_iop_module_t *module,
14651465
return 0;
14661466
}
14671467

1468-
static int _brush_events_button_pressed(struct dt_iop_module_t *module,
1468+
static int _brush_events_button_pressed(dt_iop_module_t *module,
14691469
const float pzx,
14701470
const float pzy,
14711471
const double pressure,
@@ -1798,7 +1798,7 @@ static int _brush_events_button_pressed(struct dt_iop_module_t *module,
17981798
return 0;
17991799
}
18001800

1801-
static int _brush_events_button_released(struct dt_iop_module_t *module,
1801+
static int _brush_events_button_released(dt_iop_module_t *module,
18021802
const float pzx,
18031803
const float pzy,
18041804
const int which,

src/develop/masks/circle.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ static void _circle_get_distance(const float x,
107107
*inside = TRUE;
108108
}
109109

110-
static int _circle_events_mouse_scrolled(struct dt_iop_module_t *module,
110+
static int _circle_events_mouse_scrolled(dt_iop_module_t *module,
111111
const float pzx,
112112
const float pzy,
113113
const int up,
@@ -201,7 +201,7 @@ static int _circle_events_mouse_scrolled(struct dt_iop_module_t *module,
201201
return 0;
202202
}
203203

204-
static int _circle_events_button_pressed(struct dt_iop_module_t *module,
204+
static int _circle_events_button_pressed(dt_iop_module_t *module,
205205
float pzx, float pzy,
206206
const double pressure,
207207
const int which,
@@ -385,7 +385,7 @@ static int _circle_events_button_pressed(struct dt_iop_module_t *module,
385385
return 0;
386386
}
387387

388-
static int _circle_events_button_released(struct dt_iop_module_t *module,
388+
static int _circle_events_button_released(dt_iop_module_t *module,
389389
const float pzx,
390390
const float pzy,
391391
const int which,
@@ -507,7 +507,7 @@ static int _circle_events_button_released(struct dt_iop_module_t *module,
507507
return 0;
508508
}
509509

510-
static int _circle_events_mouse_moved(struct dt_iop_module_t *module,
510+
static int _circle_events_mouse_moved(dt_iop_module_t *module,
511511
const float pzx,
512512
const float pzy,
513513
const double pressure,
@@ -1405,7 +1405,7 @@ static void _circle_sanitize_config(dt_masks_type_t type)
14051405
dt_conf_get_and_sanitize_float(DT_MASKS_CONF(type, circle, border), MIN_CIRCLE_BORDER, 0.5f);
14061406
}
14071407

1408-
static void _circle_set_form_name(struct dt_masks_form_t *const form,
1408+
static void _circle_set_form_name(dt_masks_form_t *const form,
14091409
const size_t nb)
14101410
{
14111411
snprintf(form->name, sizeof(form->name), _("circle #%d"), (int)nb);

src/develop/masks/ellipse.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ static int _ellipse_get_points_border(dt_develop_t *dev,
419419
return 0;
420420
}
421421

422-
static int _ellipse_events_mouse_scrolled(struct dt_iop_module_t *module,
422+
static int _ellipse_events_mouse_scrolled(dt_iop_module_t *module,
423423
const float pzx,
424424
const float pzy,
425425
const int up,
@@ -1969,7 +1969,7 @@ static GSList *_ellipse_setup_mouse_actions(const struct dt_masks_form_t *const
19691969
return lm;
19701970
}
19711971

1972-
static void _ellipse_set_form_name(struct dt_masks_form_t *const form,
1972+
static void _ellipse_set_form_name(dt_masks_form_t *const form,
19731973
const size_t nb)
19741974
{
19751975
snprintf(form->name, sizeof(form->name), _("ellipse #%d"), (int)nb);

src/develop/masks/gradient.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1430,7 +1430,7 @@ static void _gradient_sanitize_config(dt_masks_type_t type)
14301430
dt_conf_set_float(DT_MASKS_CONF(type, gradient, curvature), 0.0f);
14311431
}
14321432

1433-
static void _gradient_set_form_name(struct dt_masks_form_t *const form,
1433+
static void _gradient_set_form_name(dt_masks_form_t *const form,
14341434
const size_t nb)
14351435
{
14361436
snprintf(form->name, sizeof(form->name), _("gradient #%d"), (int)nb);

src/develop/tiling.c

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -488,8 +488,8 @@ static int _simplex(double (*objfunc)(double[], void *[]), double start[], int n
488488
}
489489

490490

491-
static int _nm_fit_output_to_input_roi(struct dt_iop_module_t *self,
492-
struct dt_dev_pixelpipe_iop_t *piece,
491+
static int _nm_fit_output_to_input_roi(dt_iop_module_t *self,
492+
dt_dev_pixelpipe_iop_t *piece,
493493
const dt_iop_roi_t *iroi,
494494
dt_iop_roi_t *oroi,
495495
int delta)
@@ -519,8 +519,8 @@ static int _nm_fit_output_to_input_roi(struct dt_iop_module_t *self,
519519
/* find a matching oroi_full by probing start value of oroi and get corresponding input roi into iroi_probe.
520520
We search in two steps. first by a simplicistic iterative search which will succeed in most cases.
521521
If this does not converge, we do a downhill simplex (nelder-mead) fitting */
522-
static int _fit_output_to_input_roi(struct dt_iop_module_t *self,
523-
struct dt_dev_pixelpipe_iop_t *piece,
522+
static int _fit_output_to_input_roi(dt_iop_module_t *self,
523+
dt_dev_pixelpipe_iop_t *piece,
524524
const dt_iop_roi_t *iroi,
525525
dt_iop_roi_t *oroi,
526526
int delta,
@@ -564,8 +564,8 @@ static int _fit_output_to_input_roi(struct dt_iop_module_t *self,
564564

565565

566566
/* simple tiling algorithm for roi_in == roi_out, i.e. for pixel to pixel modules/operations */
567-
static void _default_process_tiling_ptp(struct dt_iop_module_t *self,
568-
struct dt_dev_pixelpipe_iop_t *piece,
567+
static void _default_process_tiling_ptp(dt_iop_module_t *self,
568+
dt_dev_pixelpipe_iop_t *piece,
569569
const void *const ivoid,
570570
void *const ovoid,
571571
const dt_iop_roi_t *const roi_in,
@@ -824,8 +824,8 @@ static void _default_process_tiling_ptp(struct dt_iop_module_t *self,
824824

825825
/* more elaborate tiling algorithm for roi_in != roi_out: slower than the ptp variant,
826826
more tiles and larger overlap */
827-
static void _default_process_tiling_roi(struct dt_iop_module_t *self,
828-
struct dt_dev_pixelpipe_iop_t *piece,
827+
static void _default_process_tiling_roi(dt_iop_module_t *self,
828+
dt_dev_pixelpipe_iop_t *piece,
829829
const void *const ivoid,
830830
void *const ovoid,
831831
const dt_iop_roi_t *const roi_in,
@@ -1176,8 +1176,8 @@ static void _default_process_tiling_roi(struct dt_iop_module_t *self,
11761176
_default_process_tiling_roi() takes care of all other cases where image gets distorted and for module
11771177
"clipping",
11781178
"flip" as this may flip or mirror the image. */
1179-
void default_process_tiling(struct dt_iop_module_t *self,
1180-
struct dt_dev_pixelpipe_iop_t *piece,
1179+
void default_process_tiling(dt_iop_module_t *self,
1180+
dt_dev_pixelpipe_iop_t *piece,
11811181
const void *const ivoid,
11821182
void *const ovoid,
11831183
const dt_iop_roi_t *const roi_in,
@@ -1191,8 +1191,8 @@ void default_process_tiling(struct dt_iop_module_t *self,
11911191
return;
11921192
}
11931193

1194-
float dt_tiling_estimate_cpumem(struct dt_develop_tiling_t *tiling,
1195-
struct dt_dev_pixelpipe_iop_t *piece,
1194+
float dt_tiling_estimate_cpumem(dt_develop_tiling_t *tiling,
1195+
dt_dev_pixelpipe_iop_t *piece,
11961196
const dt_iop_roi_t *const roi_in,
11971197
const dt_iop_roi_t *const roi_out,
11981198
const int max_bpp)
@@ -1252,8 +1252,8 @@ float dt_tiling_estimate_cpumem(struct dt_develop_tiling_t *tiling,
12521252
}
12531253

12541254
#ifdef HAVE_OPENCL
1255-
float dt_tiling_estimate_clmem(struct dt_develop_tiling_t *tiling,
1256-
struct dt_dev_pixelpipe_iop_t *piece,
1255+
float dt_tiling_estimate_clmem(dt_develop_tiling_t *tiling,
1256+
dt_dev_pixelpipe_iop_t *piece,
12571257
const dt_iop_roi_t *const roi_in,
12581258
const dt_iop_roi_t *const roi_out,
12591259
const int max_bpp)
@@ -1313,8 +1313,8 @@ float dt_tiling_estimate_clmem(struct dt_develop_tiling_t *tiling,
13131313
}
13141314

13151315
/* simple tiling algorithm for roi_in == roi_out, i.e. for pixel to pixel modules/operations */
1316-
static int _default_process_tiling_cl_ptp(struct dt_iop_module_t *self,
1317-
struct dt_dev_pixelpipe_iop_t *piece,
1316+
static int _default_process_tiling_cl_ptp(dt_iop_module_t *self,
1317+
dt_dev_pixelpipe_iop_t *piece,
13181318
const void *const ivoid,
13191319
void *const ovoid,
13201320
const dt_iop_roi_t *const roi_in,
@@ -1691,8 +1691,8 @@ static int _default_process_tiling_cl_ptp(struct dt_iop_module_t *self,
16911691

16921692
/* more elaborate tiling algorithm for roi_in != roi_out: slower than the ptp variant,
16931693
more tiles and larger overlap */
1694-
static int _default_process_tiling_cl_roi(struct dt_iop_module_t *self,
1695-
struct dt_dev_pixelpipe_iop_t *piece,
1694+
static int _default_process_tiling_cl_roi(dt_iop_module_t *self,
1695+
dt_dev_pixelpipe_iop_t *piece,
16961696
const void *const ivoid,
16971697
void *const ovoid,
16981698
const dt_iop_roi_t *const roi_in,
@@ -2157,8 +2157,8 @@ static int _default_process_tiling_cl_roi(struct dt_iop_module_t *self,
21572157
/* if a module does not implement process_tiling_cl() by itself, this function is called instead.
21582158
_default_process_tiling_cl_ptp() is able to handle standard cases where pixels do not change their places.
21592159
_default_process_tiling_cl_roi() takes care of all other cases where image gets distorted. */
2160-
int default_process_tiling_cl(struct dt_iop_module_t *self,
2161-
struct dt_dev_pixelpipe_iop_t *piece,
2160+
int default_process_tiling_cl(dt_iop_module_t *self,
2161+
dt_dev_pixelpipe_iop_t *piece,
21622162
const void *const ivoid,
21632163
void *const ovoid,
21642164
const dt_iop_roi_t *const roi_in,
@@ -2172,8 +2172,8 @@ int default_process_tiling_cl(struct dt_iop_module_t *self,
21722172
}
21732173

21742174
#else
2175-
int default_process_tiling_cl(struct dt_iop_module_t *self,
2176-
struct dt_dev_pixelpipe_iop_t *piece,
2175+
int default_process_tiling_cl(dt_iop_module_t *self,
2176+
dt_dev_pixelpipe_iop_t *piece,
21772177
const void *const ivoid,
21782178
void *const ovoid,
21792179
const dt_iop_roi_t *const roi_in,
@@ -2191,8 +2191,8 @@ int default_process_tiling_cl(struct dt_iop_module_t *self,
21912191
alignment required. Simple pixel to pixel modules (take tonecurve as an example) can happily
21922192
live with that.
21932193
(1) Small overhead like look-up-tables in tonecurve can be ignored safely. */
2194-
void default_tiling_callback(struct dt_iop_module_t *self,
2195-
struct dt_dev_pixelpipe_iop_t *piece,
2194+
void default_tiling_callback(dt_iop_module_t *self,
2195+
dt_dev_pixelpipe_iop_t *piece,
21962196
const dt_iop_roi_t *roi_in,
21972197
const dt_iop_roi_t *roi_out,
21982198
struct dt_develop_tiling_t *tiling)

src/iop/basicadj.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -466,21 +466,21 @@ void gui_post_expose(dt_iop_module_t *self,
466466
cairo_stroke(cr);
467467
}
468468

469-
void init_global(dt_iop_module_so_t *module)
469+
void init_global(dt_iop_module_so_t *self)
470470
{
471471
const int program = 24; // basicadj.cl, from programs.conf
472472
dt_iop_basicadj_global_data_t *gd = malloc(sizeof(dt_iop_basicadj_global_data_t));
473-
module->data = gd;
473+
self->data = gd;
474474

475475
gd->kernel_basicadj = dt_opencl_create_kernel(program, "basicadj");
476476
}
477477

478-
void cleanup_global(dt_iop_module_so_t *module)
478+
void cleanup_global(dt_iop_module_so_t *self)
479479
{
480-
dt_iop_basicadj_global_data_t *gd = module->data;
480+
dt_iop_basicadj_global_data_t *gd = self->data;
481481
dt_opencl_free_kernel(gd->kernel_basicadj);
482-
free(module->data);
483-
module->data = NULL;
482+
free(self->data);
483+
self->data = NULL;
484484
}
485485

486486
void color_picker_apply(dt_iop_module_t *self, GtkWidget *picker,

src/iop/bloom.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -359,27 +359,27 @@ void tiling_callback(dt_iop_module_t *self,
359359
return;
360360
}
361361

362-
void init_global(dt_iop_module_so_t *module)
362+
void init_global(dt_iop_module_so_t *self)
363363
{
364364
const int program = 12; // bloom.cl, from programs.conf
365365
dt_iop_bloom_global_data_t *gd = malloc(sizeof(dt_iop_bloom_global_data_t));
366-
module->data = gd;
366+
self->data = gd;
367367

368368
gd->kernel_bloom_threshold = dt_opencl_create_kernel(program, "bloom_threshold");
369369
gd->kernel_bloom_hblur = dt_opencl_create_kernel(program, "bloom_hblur");
370370
gd->kernel_bloom_vblur = dt_opencl_create_kernel(program, "bloom_vblur");
371371
gd->kernel_bloom_mix = dt_opencl_create_kernel(program, "bloom_mix");
372372
}
373373

374-
void cleanup_global(dt_iop_module_so_t *module)
374+
void cleanup_global(dt_iop_module_so_t *self)
375375
{
376-
const dt_iop_bloom_global_data_t *gd = module->data;
376+
const dt_iop_bloom_global_data_t *gd = self->data;
377377
dt_opencl_free_kernel(gd->kernel_bloom_threshold);
378378
dt_opencl_free_kernel(gd->kernel_bloom_hblur);
379379
dt_opencl_free_kernel(gd->kernel_bloom_vblur);
380380
dt_opencl_free_kernel(gd->kernel_bloom_mix);
381-
free(module->data);
382-
module->data = NULL;
381+
free(self->data);
382+
self->data = NULL;
383383
}
384384

385385
void commit_params(dt_iop_module_t *self,

src/iop/blurs.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -634,21 +634,21 @@ int process_cl(dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, cl_mem dev_
634634
return err;
635635
}
636636

637-
void init_global(dt_iop_module_so_t *module)
637+
void init_global(dt_iop_module_so_t *self)
638638
{
639639
const int program = 34;
640640
dt_iop_blurs_global_data_t *gd = malloc(sizeof(dt_iop_blurs_global_data_t));
641-
module->data = gd;
641+
self->data = gd;
642642
gd->kernel_blurs_convolve = dt_opencl_create_kernel(program, "convolve");
643643
}
644644

645645

646-
void cleanup_global(dt_iop_module_so_t *module)
646+
void cleanup_global(dt_iop_module_so_t *self)
647647
{
648-
dt_iop_blurs_global_data_t *gd = module->data;
648+
dt_iop_blurs_global_data_t *gd = self->data;
649649
dt_opencl_free_kernel(gd->kernel_blurs_convolve);
650-
free(module->data);
651-
module->data = NULL;
650+
free(self->data);
651+
self->data = NULL;
652652
}
653653
#endif
654654

src/iop/borders.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -655,22 +655,22 @@ int process_cl(dt_iop_module_t *self,
655655
#endif
656656

657657

658-
void init_global(dt_iop_module_so_t *module)
658+
void init_global(dt_iop_module_so_t *self)
659659
{
660660
const int program = 2; // basic.cl from programs.conf
661661
dt_iop_borders_global_data_t *gd
662662
= (dt_iop_borders_global_data_t *)malloc(sizeof(dt_iop_borders_global_data_t));
663-
module->data = gd;
663+
self->data = gd;
664664
gd->kernel_borders_fill = dt_opencl_create_kernel(program, "borders_fill");
665665
}
666666

667667

668-
void cleanup_global(dt_iop_module_so_t *module)
668+
void cleanup_global(dt_iop_module_so_t *self)
669669
{
670-
dt_iop_borders_global_data_t *gd = module->data;
670+
dt_iop_borders_global_data_t *gd = self->data;
671671
dt_opencl_free_kernel(gd->kernel_borders_fill);
672-
free(module->data);
673-
module->data = NULL;
672+
free(self->data);
673+
self->data = NULL;
674674
}
675675

676676

src/iop/censorize.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -395,20 +395,20 @@ void tiling_callback(dt_iop_module_t *self,
395395
tiling->yalign = 1;
396396
}
397397

398-
void init_global(dt_iop_module_so_t *module)
398+
void init_global(dt_iop_module_so_t *self)
399399
{
400400
const int program = 6; // gaussian.cl, from programs.conf
401401
dt_iop_censorize_global_data_t *gd = malloc(sizeof(dt_iop_censorize_global_data_t));
402-
module->data = gd;
402+
self->data = gd;
403403
gd->kernel_lowpass_mix = dt_opencl_create_kernel(program, "lowpass_mix");
404404
}
405405

406-
void cleanup_global(dt_iop_module_so_t *module)
406+
void cleanup_global(dt_iop_module_so_t *self)
407407
{
408-
dt_iop_censorize_global_data_t *gd = module->data;
408+
dt_iop_censorize_global_data_t *gd = self->data;
409409
dt_opencl_free_kernel(gd->kernel_lowpass_mix);
410-
free(module->data);
411-
module->data = NULL;
410+
free(self->data);
411+
self->data = NULL;
412412
}
413413

414414
#endif

0 commit comments

Comments
 (0)