54#define DT_IOP_ORDER_VERSION 5
56#define DT_IOP_ORDER_INFO (darktable.unmuted & DT_DEBUG_IOPORDER)
60 const int multi_priority);
96 { { 0.5f },
"basebuffer", 0},
97 { { 1.0f },
"rawprepare", 0},
98 { { 2.0f },
"invert", 0},
99 { { 3.0f },
"temperature", 0},
100 { { 4.0f },
"highlights", 0},
101 { { 5.0f },
"cacorrect", 0},
102 { { 6.0f },
"hotpixels", 0},
103 { { 7.0f },
"rawdenoise", 0},
104 { { 8.0f },
"demosaic", 0},
105 { { 8.5f },
"detailmask", 0},
106 { { 9.0f },
"mask_manager", 0},
107 { {10.0f },
"denoiseprofile", 0},
108 { {11.0f },
"tonemap", 0},
109 { {12.0f },
"exposure", 0},
110 { {13.0f },
"spots", 0},
111 { {14.0f },
"retouch", 0},
112 { {15.0f },
"lens", 0},
113 { {15.5f },
"cacorrectrgb", 0},
114 { {15.5f },
"initialscale", 0},
115 { {16.0f },
"ashift", 0},
116 { {17.0f },
"liquify", 0},
117 { {18.0f },
"rotatepixels", 0},
118 { {19.0f },
"scalepixels", 0},
119 { {20.0f },
"flip", 0},
120 { {21.0f },
"clipping", 0},
121 { {21.5f },
"toneequal", 0},
122 { {21.7f },
"crop", 0},
123 { {22.0f },
"graduatednd", 0},
124 { {23.0f },
"basecurve", 0},
125 { {24.0f },
"bilateral", 0},
126 { {25.0f },
"profile_gamma", 0},
127 { {26.0f },
"hazeremoval", 0},
128 { {27.0f },
"colorin", 0},
129 { {27.5f },
"channelmixerrgb", 0},
130 { {27.5f },
"diffuse", 0},
131 { {27.5f },
"censorize", 0},
132 { {27.5f },
"negadoctor", 0},
133 { {27.5f },
"blurs", 0},
134 { {27.5f },
"basicadj", 0},
135 { {28.0f },
"colorreconstruct", 0},
136 { {29.0f },
"colorchecker", 0},
137 { {30.0f },
"defringe", 0},
138 { {31.0f },
"equalizer", 0},
139 { {32.0f },
"vibrance", 0},
140 { {33.0f },
"colorbalance", 0},
141 { {33.4f },
"splittoningrgb", 0},
142 { {33.45f },
"colorprimaries", 0},
143 { {33.5f },
"colorbalancergb", 0},
144 { {33.6f },
"colorequal", 0},
145 { {33.7f },
"drawlayer", 0},
146 { {34.0f },
"colorize", 0},
147 { {36.0f },
"colormapping", 0},
148 { {37.0f },
"bloom", 0},
149 { {38.0f },
"nlmeans", 0},
150 { {39.0f },
"globaltonemap", 0},
151 { {40.0f },
"shadhi", 0},
152 { {41.0f },
"atrous", 0},
153 { {42.0f },
"bilat", 0},
154 { {43.0f },
"colorzones", 0},
155 { {44.0f },
"lowlight", 0},
156 { {45.0f },
"monochrome", 0},
157 { {46.0f },
"filmic", 0},
158 { {46.25f },
"crystgrain", 0},
159 { {46.5f },
"filmicrgb", 0},
160 { {47.0f },
"colisa", 0},
161 { {48.0f },
"zonesystem", 0},
162 { {49.0f },
"tonecurve", 0},
163 { {50.0f },
"levels", 0},
164 { {50.2f },
"rgblevels", 0},
165 { {50.5f },
"rgbcurve", 0},
166 { {51.0f },
"relight", 0},
167 { {52.0f },
"colorcorrection", 0},
168 { {53.0f },
"sharpen", 0},
169 { {54.0f },
"lowpass", 0},
170 { {55.0f },
"highpass", 0},
171 { {56.0f },
"grain", 0},
172 { {56.5f },
"lut3d", 0},
173 { {57.0f },
"colorcontrast", 0},
174 { {58.0f },
"colorout", 0},
175 { {59.0f },
"channelmixer", 0},
176 { {60.0f },
"soften", 0},
177 { {61.0f },
"vignette", 0},
178 { {62.0f },
"splittoning", 0},
179 { {63.0f },
"velvia", 0},
180 { {65.0f },
"finalscale", 0},
181 { {66.0f },
"overexposed", 0},
182 { {67.0f },
"rawoverexposed", 0},
183 { {67.5f },
"dither", 0},
184 { {68.0f },
"borders", 0},
185 { {69.0f },
"watermark", 0},
186 { {71.0f },
"gamma", 0},
192 { { 0.5 },
"basebuffer", 0},
193 { { 1.0 },
"rawprepare", 0},
194 { { 2.0 },
"invert", 0},
195 { { 3.0f },
"temperature", 0},
196 { { 4.0f },
"highlights", 0},
197 { { 5.0f },
"cacorrect", 0},
198 { { 6.0f },
"hotpixels", 0},
199 { { 7.0f },
"rawdenoise", 0},
200 { { 8.0f },
"demosaic", 0},
201 { { 8.5f },
"detailmask", 0},
202 { { 9.0f },
"denoiseprofile", 0},
203 { {10.0f },
"bilateral", 0},
204 { {11.0f },
"rotatepixels", 0},
205 { {12.0f },
"scalepixels", 0},
206 { {13.0f },
"lens", 0},
207 { {13.5f },
"cacorrectrgb", 0},
209 { {14.0f },
"hazeremoval", 0},
210 { {14.0f },
"initialscale", 0},
211 { {15.0f },
"ashift", 0},
212 { {16.0f },
"flip", 0},
213 { {17.0f },
"clipping", 0},
214 { {18.0f },
"liquify", 0},
215 { {19.0f },
"spots", 0},
216 { {20.0f },
"retouch", 0},
217 { {21.0f },
"exposure", 0},
218 { {22.0f },
"mask_manager", 0},
219 { {23.0f },
"tonemap", 0},
220 { {24.0f },
"toneequal", 0},
221 { {24.5f },
"crop", 0},
222 { {25.0f },
"graduatednd", 0},
223 { {26.0f },
"profile_gamma", 0},
224 { {28.0f },
"colorin", 0},
225 { {28.5f },
"channelmixerrgb", 0},
226 { {28.5f },
"diffuse", 0},
227 { {28.5f },
"censorize", 0},
228 { {28.5f },
"negadoctor", 0},
229 { {28.5f },
"blurs", 0},
230 { {29.0f },
"nlmeans", 0},
232 { {30.0f },
"colorchecker", 0},
235 { {31.0f },
"defringe", 0},
237 { {32.0f },
"atrous", 0},
238 { {33.0f },
"lowpass", 0},
239 { {34.0f },
"highpass", 0},
240 { {35.0f },
"sharpen", 0},
242 { {37.0f },
"colortransfer", 0},
246 { {38.0f },
"colormapping", 0},
247 { {39.0f },
"channelmixer", 0},
251 { {40.0f },
"basicadj", 0},
252 { {41.0f },
"colorbalance", 0},
253 { {41.4f },
"splittoningrgb", 0},
254 { {41.45f },
"colorprimaries", 0},
255 { {41.5f },
"colorbalancergb", 0},
256 { {41.6f },
"colorequal", 0},
257 { {41.7f },
"drawlayer", 0},
258 { {42.0f },
"rgbcurve", 0},
259 { {43.0f },
"rgblevels", 0},
260 { {44.0f },
"basecurve", 0},
262 { {45.0f },
"filmic", 0},
263 { {45.5f },
"crystgrain", 0},
264 { {46.0f },
"filmicrgb", 0},
265 { {36.0f },
"lut3d", 0},
266 { {47.0f },
"colisa", 0},
267 { {48.0f },
"tonecurve", 0},
268 { {49.0f },
"levels", 0},
269 { {50.0f },
"shadhi", 0},
270 { {51.0f },
"zonesystem", 0},
271 { {52.0f },
"globaltonemap", 0},
272 { {53.0f },
"relight", 0},
273 { {54.0f },
"bilat", 0},
275 { {55.0f },
"colorcorrection", 0},
277 { {56.0f },
"colorcontrast", 0},
278 { {57.0f },
"velvia", 0},
279 { {58.0f },
"vibrance", 0},
280 { {60.0f },
"colorzones", 0},
281 { {61.0f },
"bloom", 0},
282 { {62.0f },
"colorize", 0},
283 { {63.0f },
"lowlight", 0},
284 { {64.0f },
"monochrome", 0},
285 { {65.0f },
"grain", 0},
286 { {66.0f },
"soften", 0},
287 { {67.0f },
"splittoning", 0},
288 { {68.0f },
"vignette", 0},
289 { {69.0f },
"colorreconstruct", 0},
290 { {70.0f },
"colorout", 0},
291 { {72.0f },
"finalscale", 0},
292 { {73.0f },
"overexposed", 0},
293 { {74.0f },
"rawoverexposed", 0},
294 { {75.0f },
"dither", 0},
295 { {76.0f },
"borders", 0},
296 { {77.0f },
"watermark", 0},
297 { {78.0f },
"gamma", 0},
304 { { 0.5 },
"basebuffer", 0 },
305 { { 1.0 },
"rawprepare", 0 },
306 { { 2.0 },
"invert", 0 },
307 { { 3.0f },
"temperature", 0 },
308 { { 4.0f },
"highlights", 0 },
309 { { 5.0f },
"cacorrect", 0 },
310 { { 6.0f },
"hotpixels", 0 },
311 { { 7.0f },
"rawdenoise", 0 },
312 { { 8.0f },
"demosaic", 0 },
313 { { 8.5f },
"detailmask", 0 },
315 { { 28.0f },
"colorin", 0 },
317 { { 28.0f },
"denoiseprofile", 0},
318 { { 28.0f },
"bilateral", 0},
319 { { 28.0f },
"rotatepixels", 0},
320 { { 28.0f },
"scalepixels", 0},
321 { { 28.0f },
"lens", 0},
322 { { 28.0f },
"cacorrectrgb", 0},
324 { { 28.0f },
"hazeremoval", 0},
325 { { 28.0f },
"initialscale", 0 },
326 { { 28.0f },
"ashift", 0},
327 { { 28.0f },
"flip", 0},
328 { { 28.0f },
"clipping", 0},
329 { { 28.0f },
"liquify", 0},
330 { { 28.0f },
"spots", 0},
331 { { 28.0f },
"retouch", 0},
332 { { 28.0f },
"exposure", 0},
333 { { 28.0f },
"mask_manager", 0},
334 { { 28.0f },
"tonemap", 0},
335 { { 28.0f },
"toneequal", 0},
336 { { 28.0f },
"crop", 0},
337 { { 28.0f },
"graduatednd", 0},
338 { { 28.0f },
"profile_gamma", 0},
340 { { 28.5f },
"channelmixerrgb", 0 },
341 { { 28.5f },
"diffuse", 0 },
342 { { 28.5f },
"censorize", 0 },
343 { { 28.5f },
"negadoctor", 0 },
344 { { 28.5f },
"blurs", 0 },
345 { { 29.0f },
"nlmeans", 0 },
347 { { 30.0f },
"colorchecker", 0 },
350 { { 31.0f },
"defringe", 0 },
352 { { 32.0f },
"atrous", 0 },
353 { { 33.0f },
"lowpass", 0 },
354 { { 34.0f },
"highpass", 0 },
355 { { 35.0f },
"sharpen", 0 },
356 { { 38.0f },
"colormapping", 0 },
357 { { 39.0f },
"channelmixer", 0 },
361 { { 40.0f },
"basicadj", 0 },
362 { { 41.0f },
"colorbalance", 0 },
363 { { 41.4f },
"splittoningrgb", 0 },
364 { { 41.45f },
"colorprimaries", 0 },
365 { { 41.5f },
"colorbalancergb", 0 },
366 { { 41.6f },
"colorequal", 0 },
367 { { 41.7f },
"drawlayer", 0 },
368 { { 42.0f },
"rgbcurve", 0 },
370 { { 43.0f },
"rgblevels", 0 },
371 { { 44.0f },
"basecurve", 0 },
373 { { 45.0f },
"filmic", 0 },
374 { { 45.5f },
"crystgrain", 0 },
375 { { 46.0f },
"filmicrgb", 0 },
376 { { 36.0f },
"lut3d", 0 },
377 { { 47.0f },
"colisa", 0 },
378 { { 48.0f },
"tonecurve", 0 },
379 { { 49.0f },
"levels", 0 },
380 { { 50.0f },
"shadhi", 0 },
381 { { 51.0f },
"zonesystem", 0 },
382 { { 52.0f },
"globaltonemap", 0 },
383 { { 53.0f },
"relight", 0 },
384 { { 54.0f },
"bilat", 0 },
386 { { 55.0f },
"colorcorrection", 0 },
389 { { 56.0f },
"colorcontrast", 0 },
390 { { 57.0f },
"velvia", 0 },
391 { { 58.0f },
"vibrance", 0 },
392 { { 60.0f },
"colorzones", 0 },
393 { { 61.0f },
"bloom", 0 },
394 { { 62.0f },
"colorize", 0 },
395 { { 63.0f },
"lowlight", 0 },
396 { { 64.0f },
"monochrome", 0 },
397 { { 65.0f },
"grain", 0 },
398 { { 66.0f },
"soften", 0 },
399 { { 67.0f },
"splittoning", 0 },
400 { { 68.0f },
"vignette", 0 },
401 { { 69.0f },
"colorreconstruct", 0 },
403 { { 70.0f },
"colorout", 0 },
404 { { 72.0f },
"finalscale", 0 },
405 { { 73.0f },
"overexposed", 0 },
406 { { 74.0f },
"rawoverexposed", 0 },
407 { { 75.0f },
"dither", 0 },
408 { { 76.0f },
"borders", 0 },
409 { { 77.0f },
"watermark", 0 },
410 { { 78.0f },
"gamma", 0 },
416 { { 0.5f},
"basebuffer", 0 },
417 { { 1.0f },
"rawprepare", 0 },
418 { { 2.0f },
"invert", 0 },
419 { { 3.0f },
"highlights", 0 },
420 { { 4.0f },
"cacorrect", 0 },
421 { { 5.0f },
"hotpixels", 0 },
422 { { 6.0f },
"rawdenoise", 0 },
423 { { 7.0f },
"demosaic", 0 },
426 { { 8.0f },
"colorin", 0 },
431 { { 9.0f },
"detailmask", 0 },
432 { { 10.0f },
"temperature", 0 },
433 { { 11.0f },
"denoiseprofile", 0},
434 { { 12.0f },
"bilateral", 0},
435 { { 13.0f },
"rotatepixels", 0},
436 { { 14.0f },
"scalepixels", 0},
437 { { 15.0f },
"lens", 0},
438 { { 16.0f },
"cacorrectrgb", 0},
440 { { 17.0f },
"hazeremoval", 0},
441 { { 18.0f },
"initialscale", 0 },
442 { { 19.0f },
"ashift", 0},
443 { { 20.0f },
"flip", 0},
444 { { 21.0f },
"clipping", 0},
445 { { 22.0f },
"liquify", 0},
446 { { 23.0f },
"spots", 0},
447 { { 24.0f },
"retouch", 0},
448 { { 25.0f },
"mask_manager", 0},
451 { { 26.0f },
"exposure", 0},
452 { { 27.0f },
"vignette", 0 },
453 { { 28.0f },
"graduatednd", 0},
454 { { 29.0f },
"toneequal", 0},
455 { { 30.0f },
"crop", 0},
456 { { 31.0f },
"profile_gamma", 0},
461 { { 32.0f },
"negadoctor", 0 },
462 { { 33.0f },
"channelmixerrgb", 0 },
463 { { 34.0f },
"channelmixer", 0 },
466 { { 35.0f },
"diffuse", 0 },
467 { { 36.0f },
"censorize", 0 },
468 { { 37.0f },
"blurs", 0 },
471 { { 38.0f },
"basicadj", 0 },
472 { { 39.0f },
"splittoningrgb", 0 },
473 { { 40.0f },
"colorprimaries", 0 },
474 { { 41.0f },
"colorbalance", 0 },
475 { { 42.0f },
"colorbalancergb", 0 },
476 { { 43.0f },
"colorequal", 0 },
477 { { 44.0f },
"drawlayer", 0 },
478 { { 45.0f },
"crystgrain", 0 },
481 { { 46.0f },
"finalscale", 0 },
483 { { 47.0f },
"tonemap", 0},
486 { { 48.0f },
"filmic", 0 },
487 { { 49.0f },
"filmicrgb", 0 },
488 { { 50.0f },
"basecurve", 0 },
494 { { 51.0f },
"nlmeans", 0 },
495 { { 52.0f },
"defringe", 0 },
496 { { 53.0f },
"bilat", 0 },
497 { { 54.0f },
"atrous", 0 },
498 { { 55.0f },
"lowpass", 0 },
499 { { 56.0f },
"highpass", 0 },
500 { { 57.0f },
"sharpen", 0 },
503 { { 58.0f },
"lut3d", 0 },
504 { { 59.0f },
"rgbcurve", 0 },
505 { { 60.0f },
"rgblevels", 0 },
506 { { 61.0f },
"splittoning", 0 },
509 { { 62.0f },
"colorchecker", 0 },
510 { { 63.0f },
"colormapping", 0 },
511 { { 64.0f },
"colorcorrection", 0 },
514 { { 65.0f },
"colorcontrast", 0 },
515 { { 66.0f },
"velvia", 0 },
516 { { 67.0f },
"vibrance", 0 },
517 { { 68.0f },
"colorzones", 0 },
520 { { 69.0f },
"colisa", 0 },
521 { { 70.0f },
"tonecurve", 0 },
522 { { 71.0f },
"levels", 0 },
523 { { 72.0f },
"shadhi", 0 },
524 { { 73.0f },
"zonesystem", 0 },
525 { { 74.0f },
"globaltonemap", 0 },
528 { { 75.0f },
"relight", 0 },
529 { { 76.0f },
"bloom", 0 },
530 { { 77.0f },
"colorize", 0 },
531 { { 78.0f },
"lowlight", 0 },
532 { { 79.0f },
"monochrome", 0 },
533 { { 80.0f },
"grain", 0 },
534 { { 81.0f },
"soften", 0 },
535 { { 82.0f },
"colorreconstruct", 0 },
539 { { 83.0f },
"colorout", 0 },
540 { { 84.0f },
"overexposed", 0 },
541 { { 85.0f },
"rawoverexposed", 0 },
545 { { 86.0f },
"borders", 0 },
546 { { 87.0f },
"watermark", 0 },
549 { { 88.0f },
"dither", 0 },
553 { { 89.0f },
"gamma", 0 },
561 { { 0.0f },
"basebuffer", 0 },
562 { { 1.0f },
"rawprepare", 0},
563 { { 2.0f },
"invert", 0},
564 { { 3.0f },
"temperature", 0},
565 { { 4.0f },
"highlights", 0},
566 { { 5.0f },
"cacorrect", 0},
567 { { 6.0f },
"hotpixels", 0},
568 { { 7.0f },
"rawdenoise", 0},
569 { { 8.0f },
"demosaic", 0},
572 { { 9.0f },
"denoiseprofile", 0},
573 { {10.0f },
"bilateral", 0},
574 { {11.0f },
"rotatepixels", 0},
575 { {12.0f },
"scalepixels", 0},
576 { {13.0f },
"detailmask", 0},
577 { {14.0f },
"lens", 0},
578 { {15.0f },
"cacorrectrgb", 0},
580 { {16.0f },
"hazeremoval", 0},
582 { {17.0f },
"initialscale", 0},
583 { {18.0f },
"ashift", 0},
584 { {19.0f },
"flip", 0},
585 { {20.0f },
"clipping", 0},
586 { {21.0f },
"liquify", 0},
587 { {22.0f },
"spots", 0},
588 { {23.0f },
"retouch", 0},
591 { {24.0f },
"mask_manager", 0},
594 { {25.0f },
"exposure", 0},
595 { {26.0f },
"vignette", 0 },
596 { {27.0f },
"graduatednd", 0},
597 { {28.0f },
"toneequal", 0},
598 { {29.0f },
"crop", 0},
601 { {30.0f },
"profile_gamma", 0},
603 { {31.0f },
"colorin", 0},
608 { { 32.0f },
"negadoctor", 0 },
609 { { 33.0f },
"channelmixerrgb", 0 },
610 { { 34.0f },
"channelmixer", 0 },
613 { { 35.0f },
"diffuse", 0 },
614 { { 36.0f },
"censorize", 0 },
615 { { 37.0f },
"blurs", 0 },
618 { { 38.0f },
"basicadj", 0 },
619 { { 39.0f },
"splittoningrgb", 0 },
620 { { 40.0f },
"colorprimaries", 0 },
621 { { 41.0f },
"colorbalance", 0 },
622 { { 42.0f },
"colorbalancergb", 0 },
623 { { 43.0f },
"colorequal", 0 },
624 { { 44.0f },
"drawlayer", 0 },
625 { { 45.0f },
"crystgrain", 0 },
628 { { 46.0f },
"finalscale", 0 },
630 { { 47.0f },
"tonemap", 0},
633 { { 48.0f },
"filmic", 0 },
634 { { 49.0f },
"filmicrgb", 0 },
635 { { 50.0f },
"basecurve", 0 },
641 { { 51.0f },
"nlmeans", 0 },
642 { { 52.0f },
"defringe", 0 },
643 { { 53.0f },
"bilat", 0 },
644 { { 54.0f },
"atrous", 0 },
645 { { 55.0f },
"lowpass", 0 },
646 { { 56.0f },
"highpass", 0 },
647 { { 57.0f },
"sharpen", 0 },
650 { { 58.0f },
"lut3d", 0 },
651 { { 59.0f },
"rgbcurve", 0 },
652 { { 60.0f },
"rgblevels", 0 },
653 { { 61.0f },
"splittoning", 0 },
656 { { 62.0f },
"colorchecker", 0 },
657 { { 63.0f },
"colormapping", 0 },
658 { { 64.0f },
"colorcorrection", 0 },
661 { { 65.0f },
"colorcontrast", 0 },
662 { { 66.0f },
"velvia", 0 },
663 { { 67.0f },
"vibrance", 0 },
664 { { 68.0f },
"colorzones", 0 },
667 { { 69.0f },
"colisa", 0 },
668 { { 70.0f },
"tonecurve", 0 },
669 { { 71.0f },
"levels", 0 },
670 { { 72.0f },
"shadhi", 0 },
671 { { 73.0f },
"zonesystem", 0 },
672 { { 74.0f },
"globaltonemap", 0 },
675 { { 75.0f },
"relight", 0 },
676 { { 76.0f },
"bloom", 0 },
677 { { 77.0f },
"colorize", 0 },
678 { { 78.0f },
"lowlight", 0 },
679 { { 79.0f },
"monochrome", 0 },
680 { { 80.0f },
"grain", 0 },
681 { { 81.0f },
"soften", 0 },
682 { { 82.0f },
"colorreconstruct", 0 },
686 { { 83.0f },
"colorout", 0 },
687 { { 84.0f },
"overexposed", 0 },
688 { { 85.0f },
"rawoverexposed", 0 },
692 { { 86.0f },
"borders", 0 },
693 { { 87.0f },
"watermark", 0 },
696 { { 88.0f },
"dither", 0 },
700 { { 89.0f },
"gamma", 0 },
720static GList *
_insert_before(GList *iop_order_list,
const char *module,
const char *new_module)
722 gboolean exists =
FALSE;
725 for(
const GList *l = iop_order_list; l; l = g_list_next(l))
728 if(!strcmp(entry->operation, new_module))
738 for(GList *l = iop_order_list; l; l = g_list_next(l))
751 iop_order_list = g_list_insert_before(iop_order_list, l, new_entry);
757 return iop_order_list;
764 gboolean has_stored_order =
FALSE;
771 if(sqlite3_step(stmt) == SQLITE_ROW)
773 iop_order_version = sqlite3_column_int(stmt, 0);
774 has_stored_order =
TRUE;
776 sqlite3_finalize(stmt);
788 return iop_order_version;
798 { .
op_prev =
"basebuffer", .op_next =
"rawprepare" },
799 { .op_prev =
"rawprepare", .op_next =
"invert" },
800 { .op_prev =
"invert", .op_next =
"temperature" },
801 { .op_prev =
"temperature", .op_next =
"highlights" },
802 { .op_prev =
"highlights", .op_next =
"cacorrect" },
803 { .op_prev =
"cacorrect", .op_next =
"hotpixels" },
804 { .op_prev =
"hotpixels", .op_next =
"rawdenoise" },
805 { .op_prev =
"rawdenoise", .op_next =
"demosaic" },
806 { .op_prev =
"demosaic", .op_next =
"colorin" },
807 { .op_prev =
"colorin", .op_next =
"colorout" },
808 { .op_prev =
"colorout", .op_next =
"gamma" },
809 { .op_prev =
"flip", .op_next =
"crop" },
810 { .op_prev =
"flip", .op_next =
"clipping" },
811 { .op_prev =
"ashift", .op_next =
"clipping" },
812 { .op_prev =
"colorin", .op_next =
"channelmixerrgb"},
816 while(rule_entry[
i].op_prev[0])
823 rules = g_list_prepend(rules, rule);
827 return g_list_reverse(rules);
834 for(GList *iops_order = iop_order_list; iops_order; iops_order = g_list_next(iops_order))
838 if(strcmp(order_entry->
operation, op_name) == 0
839 && (order_entry->
instance == multi_priority || multi_priority == -1))
858 const int multi_priority)
870 int iop_order = INT_MAX;
876 iop_order = order_entry->o.iop_order;
879 fprintf(stderr,
"cannot get iop-order for %s instance %d\n", op_name, multi_priority);
888 if(am->o.iop_order > bm->o.iop_order)
return 1;
889 if(am->o.iop_order < bm->o.iop_order)
return -1;
897 if(am->o.iop_order_f > bm->o.iop_order_f)
return 1;
898 if(am->o.iop_order_f < bm->o.iop_order_f)
return -1;
912 GList *l = iop_order_list;
922 if(strcmp(order[
k].operation, entry->operation))
939 if(ok && order[
k].operation[0] ==
'\0')
return version;
947 GList *l = iop_order_list;
951 GList *next = g_list_next(l);
979 "INSERT OR REPLACE INTO main.module_order VALUES (?1, 0, NULL)", -1,
982 if(sqlite3_step(stmt) != SQLITE_DONE)
return FALSE;
983 sqlite3_finalize(stmt);
989 "UPDATE main.module_order SET version = ?2, iop_list = ?3 WHERE imgid = ?1", -1,
994 if(sqlite3_step(stmt) != SQLITE_DONE)
return FALSE;
995 sqlite3_finalize(stmt);
1002 "UPDATE main.module_order SET version = ?2, iop_list = NULL WHERE imgid = ?1", -1,
1006 if(sqlite3_step(stmt) != SQLITE_DONE)
return FALSE;
1007 sqlite3_finalize(stmt);
1027 GList *iop_order_list = NULL;
1029 while(entries[
k].operation[0])
1036 iop_order_list = g_list_prepend(iop_order_list, entry);
1041 return g_list_reverse(iop_order_list);
1046 GList *iop_order_list = NULL;
1070 return iop_order_list;
1075 gboolean result =
FALSE;
1080 "SELECT version, iop_list"
1081 " FROM main.module_order"
1082 " WHERE imgid=?1", -1, &stmt, NULL);
1086 if(sqlite3_step(stmt) == SQLITE_ROW)
1088 result = (sqlite3_column_type(stmt, 1) != SQLITE_NULL);
1091 sqlite3_finalize(stmt);
1098 GList *iop_order_list = NULL;
1111 "SELECT version, iop_list"
1112 " FROM main.module_order"
1113 " WHERE imgid=?1", -1, &stmt, NULL);
1117 if(sqlite3_step(stmt) == SQLITE_ROW)
1120 const gboolean has_iop_list = (sqlite3_column_type(stmt, 1) != SQLITE_NULL);
1124 const char *buf = (
char *)sqlite3_column_text(stmt, 1);
1130 fprintf(stderr,
"[dt_ioppr_get_iop_order_list] error building iop_order_list imgid %d\n", imgid);
1136 iop_order_list =
_insert_before(iop_order_list,
"nlmeans",
"negadoctor");
1137 iop_order_list =
_insert_before(iop_order_list,
"negadoctor",
"channelmixerrgb");
1138 iop_order_list =
_insert_before(iop_order_list,
"negadoctor",
"censorize");
1139 iop_order_list =
_insert_before(iop_order_list,
"rgbcurve",
"colorbalancergb");
1140 iop_order_list =
_insert_before(iop_order_list,
"colorbalancergb",
"colorprimaries");
1141 iop_order_list =
_insert_before(iop_order_list,
"colorprimaries",
"splittoningrgb");
1142 iop_order_list =
_insert_before(iop_order_list,
"rgbcurve",
"drawlayer");
1143 iop_order_list =
_insert_before(iop_order_list,
"drawlayer",
"colorequal");
1144 iop_order_list =
_insert_before(iop_order_list,
"ashift",
"cacorrectrgb");
1145 iop_order_list =
_insert_before(iop_order_list,
"graduatednd",
"crop");
1146 iop_order_list =
_insert_before(iop_order_list,
"colorbalance",
"diffuse");
1147 iop_order_list =
_insert_before(iop_order_list,
"nlmeans",
"blurs");
1148 iop_order_list =
_insert_before(iop_order_list,
"ashift",
"initialscale");
1149 iop_order_list =
_insert_before(iop_order_list,
"filmicrgb",
"crystgrain");
1150 iop_order_list =
_insert_before(iop_order_list,
"mask_manager",
"detailmask");
1151 iop_order_list =
_insert_before(iop_order_list,
"rawprepare",
"basebuffer");
1175 fprintf(stderr,
"[dt_ioppr_get_iop_order_list] invalid iop order version %d for imgid %d\n", version, imgid);
1184 iop_order_list = NULL;
1185 fprintf(stderr,
"[dt_ioppr_get_iop_order_list] sanity check failed for imgid %d, falling back to default\n", imgid);
1190 sqlite3_finalize(stmt);
1214 return iop_order_list;
1229 for(
const GList *l = iop_order_list; l; l = g_list_next(l))
1250 GList *next = g_list_next(l);
1277 GList *modules = dev->
iop;
1281 GList *next = g_list_next(modules);
1298 GList *new_iop_order_list = NULL;
1301 for(
const GList *l = ordered_modules; l; l = g_list_next(l))
1311 new_iop_order_list = g_list_append(new_iop_order_list, entry);
1314 if(new_iop_order_list)
1330 gboolean has_stored_order =
FALSE;
1335 "SELECT 1 FROM main.module_order WHERE imgid = ?1", -1,
1338 has_stored_order = (sqlite3_step(stmt) == SQLITE_ROW);
1339 sqlite3_finalize(stmt);
1342 GList *iop_order_list = NULL;
1411 for(
const GList *l = iop_order_list; l; l = g_list_next(l))
1418 mi = g_list_prepend(mi,
copy);
1422 return g_list_reverse(mi);
1436 const char *operation, GList *multi_instance_list)
1442 GList *link = iop_order_list;
1444 for(
const GList *l = multi_instance_list; l; l = g_list_next(l))
1450 if(item_nb <= count_to)
1460 link = g_list_next(link);
1464 iop_order_list = g_list_insert_before(iop_order_list, link, entry);
1474 GList *next = g_list_next(link);
1475 if(strcmp(operation, entry->operation) == 0)
1478 iop_order_list = g_list_delete_link(iop_order_list, link);
1485 return iop_order_list;
1508 GList *l_next = g_list_next(l);
1510 op = g_list_append(op, entry);
1512 copy = g_list_delete_link(
copy, l);
1517 GList *next = g_list_next(mi);
1521 op = g_list_append(op, mi_entry);
1522 copy = g_list_delete_link(
copy, mi);
1540 return iop_order_list;
1553static void _count_iop_module(GList *iop,
const char *operation,
int *max_multi_priority,
int *count,
1554 int *max_multi_priority_enabled,
int *count_enabled)
1556 *max_multi_priority = 0;
1558 *max_multi_priority_enabled = 0;
1561 for(
const GList *modules = iop; modules; modules = g_list_next(modules))
1564 if(!strcmp(mod->op, operation))
1567 if(*max_multi_priority < mod->multi_priority) *max_multi_priority = mod->multi_priority;
1572 if(*max_multi_priority_enabled < mod->multi_priority) *max_multi_priority_enabled = mod->multi_priority;
1577 assert(*count >= *count_enabled);
1591 for(
const GList *l = e_list; l; l = g_list_next(l))
1594 if(!strcmp(ep->
operation, operation)) count++;
1609 for(
const GList *l = g_list_previous(e_list); l; l = g_list_previous(l))
1612 if(!strcmp(ep->operation, operation))
return TRUE;
1629 for(
const GList *l = dev->
iop; l; l = g_list_next(l))
1632 if((!only_disabled || mod->enabled ==
FALSE) && !strcmp(mod->op, operation))
1635 if(count ==
n)
return mod->multi_priority;
1655 for(GList *e_list = entry_list; e_list; e_list = g_list_next(e_list))
1659 gboolean force_append =
FALSE;
1666 force_append =
TRUE;
1668 int max_multi_priority = 0, count = 0;
1669 int max_multi_priority_enabled = 0, count_enabled = 0;
1673 &max_multi_priority, &count, &max_multi_priority_enabled, &count_enabled);
1677 for(GList *l = g_list_last(dev->
iop_order_list); l; l = g_list_previous(l))
1686 int start_multi_priority = 0;
1689 if(append || force_append)
1691 nb_replace = count - count_enabled;
1692 add_count =
MAX(0, new_active_instances - nb_replace);
1693 start_multi_priority = max_multi_priority + 1;
1698 add_count =
MAX(0, new_active_instances - count);
1699 start_multi_priority = max_multi_priority + 1;
1703 int multi_priority = start_multi_priority;
1706 for(
const GList *s = entry_list; s; s = g_list_next(s))
1709 if(!strcmp(item->
operation, e->operation))
1712 if(nb <= nb_replace)
1725 multi_priority = start_multi_priority;
1729 for(
int k = 0;
k<add_count;
k++)
1732 g_strlcpy(
n->operation, ep->operation,
sizeof(
n->operation));
1733 n->instance = multi_priority++;
1749 GList *e_list = NULL;
1752 for(
const GList *si_list = st_items; si_list; si_list = g_list_next(si_list))
1757 memcpy(
n->operation, si->operation,
sizeof(
n->operation));
1758 n->instance = si->multi_priority;
1759 g_strlcpy(
n->name, si->multi_name,
sizeof(
n->name));
1761 e_list = g_list_prepend(e_list,
n);
1763 e_list = g_list_reverse(e_list);
1770 for(
const GList *si_list = st_items; si_list; si_list = g_list_next(si_list))
1777 el = g_list_next(el);
1780 g_list_free(e_list);
1786 GList *e_list = NULL;
1789 for(
const GList *m_list = modules; m_list; m_list = g_list_next(m_list))
1794 g_strlcpy(
n->operation, mod->op,
sizeof(
n->operation));
1795 n->instance = mod->multi_priority;
1796 g_strlcpy(
n->name, mod->multi_name,
sizeof(
n->name));
1798 e_list = g_list_prepend(e_list,
n);
1800 e_list = g_list_reverse(e_list);
1807 for(
const GList *m_list = modules; m_list; m_list = g_list_next(m_list))
1815 el = g_list_next(el);
1834 for(
const GList *history = history_list; history; history = g_list_next(history))
1838 if(hist->module == mod)
1861 GList *iop_list = *_iop_list;
1865 GList *modules = iop_list;
1869 modules = g_list_next(modules);
1886 GList *modules1 = g_list_next(modules);
1909 GList *modules1 = g_list_previous(modules);
1910 if(modules1) modules1 = g_list_previous(modules1);
1922 "[dt_ioppr_check_duplicate_iop_order 1] modules %s %s(%d) and %s %s(%d) have the same iop_order\n",
1935 "[dt_ioppr_check_duplicate_iop_order] modules %s %s(%d) and %s %s(%d) have the same iop_order\n",
1946 modules = g_list_next(modules);
1952 modules = g_list_next(modules);
1956 *_iop_list = iop_list;
1962 int iop_order_missing = 0;
1965 for(
const GList *modules = iop_list; modules; modules = g_list_next(modules))
1972 iop_order_missing = 1;
1973 fprintf(stderr,
"[dt_ioppr_check_so_iop_order] missing iop_order for module %s\n", mod->op);
1977 return iop_order_missing;
1992 return (
void *)new_entry;
2006 if(am->iop_order > bm->iop_order)
return 1;
2007 if(am->iop_order < bm->iop_order)
return -1;
2021 gboolean can_move =
FALSE;
2028 GList *modules = iop_list;
2029 for(; modules; modules = g_list_next(modules))
2032 if(mod == module)
break;
2043 for(modules = g_list_next(modules); modules; modules = g_list_next(modules))
2048 if(mod == module_next)
2064 if(strcmp(module->
op, rule->op_prev) == 0 && strcmp(mod->
op, rule->op_next) == 0)
2070 if(rule_found)
break;
2085 fprintf(stderr,
"[dt_ioppr_get_iop_order_before_iop] %s %s(%d) and %s %s(%d) have the same iop_order\n",
2095 fprintf(stderr,
"[dt_ioppr_get_iop_order_before_iop] can't find module %s %s\n", module->
op, module->
multi_name);
2102 GList *modules = g_list_last(iop_list);
2103 for(; modules; modules = g_list_previous(modules))
2106 if(mod == module)
break;
2117 for(modules = g_list_previous(modules); modules; modules = g_list_previous(modules))
2138 if(strcmp(mod->
op, rule->op_prev) == 0 && strcmp(module->
op, rule->op_next) == 0)
2144 if(rule_found)
break;
2146 if(mod == module_next) mod2 = mod;
2159 fprintf(stderr,
"[dt_ioppr_get_iop_order_before_iop] %s %s(%d) and %s %s(%d) have the same iop_order\n",
2169 fprintf(stderr,
"[dt_ioppr_get_iop_order_before_iop] can't find module %s %s\n", module->
op, module->
multi_name);
2173 fprintf(stderr,
"[dt_ioppr_get_iop_order_before_iop] modules %s %s(%d) and %s %s(%d) have the same iop_order\n",
2190 gboolean can_move =
FALSE;
2195 for(
const GList *modules = g_list_last(iop_list); modules; modules = g_list_previous(modules))
2198 if(mod == module_prev)
break;
2206 "[dt_ioppr_get_iop_order_after_iop] can't find module previous to %s %s(%d) while moving %s %s(%d) after it\n",
2231 entry->
instance =
module->multi_priority;
2233 current = g_list_alloc();
2234 current->data = entry;
2240 g_list_free(current);
2263 entry->
instance =
module->multi_priority;
2265 current = g_list_alloc();
2266 current->data = entry;
2272 GList *next = g_list_next(prev);
2278 g_list_free(current);
2298 for(
const GList *modules = iop_list; modules; modules = g_list_next(modules))
2301 if(mod->iop_order == INT_MAX)
2312 if(strcmp(mod->op, rule->op_prev) == 0)
2315 for(
const GList *modules_prev = g_list_previous(modules);
2317 modules_prev = g_list_previous(modules_prev))
2321 if(strcmp(mod_prev->op, rule->op_next) == 0)
2323 fprintf(stderr,
"[_ioppr_check_rules] found rule %s %s module %s %s(%d) is after %s %s(%d) image %i (%s)\n",
2324 rule->op_prev, rule->op_next, mod->op, mod->multi_name, mod->iop_order, mod_prev->op,
2325 mod_prev->multi_name, mod_prev->iop_order, imgid, msg);
2330 else if(strcmp(mod->op, rule->op_next) == 0)
2333 for(
const GList *modules_next = g_list_next(modules); modules_next; modules_next = g_list_next(modules_next))
2337 if(strcmp(mod_next->op, rule->op_prev) == 0)
2339 fprintf(stderr,
"[_ioppr_check_rules] found rule %s %s module %s %s(%d) is before %s %s(%d) image %i (%s)\n",
2340 rule->op_prev, rule->op_next, mod->op, mod->multi_name, mod->iop_order, mod_next->op,
2341 mod_next->multi_name, mod_next->iop_order, imgid, msg);
2351 const char *operation =
module->op;
2352 const int32_t instance =
module->multi_priority;
2360 GList *place = NULL;
2362 int max_instance = -1;
2367 if(!strcmp(e->operation, operation) && e->instance > max_instance)
2370 max_instance = e->instance;
2379 int iop_order_ok = 1;
2384 for(modules = g_list_last(dev->
iop); modules; modules = g_list_previous(dev->
iop))
2387 if(mod->iop_order != INT_MAX)
2394 if(strcmp(mod->op,
"gamma") != 0)
2397 fprintf(stderr,
"[dt_ioppr_check_iop_order] gamma is not the last iop, last is %s %s(%d) image %i (%s)\n",
2398 mod->op, mod->multi_name, mod->iop_order,imgid, msg);
2409 for(
const GList *modules = g_list_last(dev->
iop); modules; modules = g_list_previous(dev->
iop))
2412 if(!mod->default_enabled && mod->iop_order != INT_MAX)
2417 fprintf(stderr,
"[dt_ioppr_check_iop_order] module not used but enabled!! %s %s(%d) image %i (%s)\n",
2418 mod->op, mod->multi_name, mod->iop_order,imgid, msg);
2420 if(mod->multi_priority == 0)
2423 fprintf(stderr,
"[dt_ioppr_check_iop_order] base module set as not used %s %s(%d) image %i (%s)\n",
2424 mod->op, mod->multi_name, mod->iop_order,imgid, msg);
2433 for(
const GList *modules = g_list_first(dev->
iop); modules; modules = g_list_next(modules))
2444 "[dt_ioppr_check_iop_order] module %s %s(%d) should be after %s %s(%d) image %i (%s)\n",
2453 "[dt_ioppr_check_iop_order] module %s %s(%i)(%d) and %s %s(%i)(%d) have the same order image %i (%s)\n",
2465 for(
const GList *history = dev->
history; history; history = g_list_next(history))
2469 if(hist->iop_order == INT_MAX)
2474 fprintf(stderr,
"[dt_ioppr_check_iop_order] history module not used but enabled!! %s %s(%d) image %i (%s)\n",
2475 hist->op_name, hist->multi_name, hist->iop_order, imgid, msg);
2477 if(hist->multi_priority == 0)
2480 fprintf(stderr,
"[dt_ioppr_check_iop_order] history base module set as not used %s %s(%d) image %i (%s)\n",
2481 hist->op_name, hist->multi_name, hist->iop_order, imgid, msg);
2488 return iop_order_ok;
2493 g_return_val_if_fail(!
IS_NULL_PTR(iop_order_list), NULL);
2498 for(
const GList *l = iop_order_list; l; l = g_list_next(l))
2501 *
size += strlen(entry->operation) +
sizeof(int32_t) * 2;
2508 char *params = (
char *)malloc(*
size);
2513 for(
const GList *l = iop_order_list; l; l = g_list_next(l))
2517 const int32_t len = strlen(entry->operation);
2518 memcpy(params+pos, &len,
sizeof(int32_t));
2519 pos +=
sizeof(int32_t);
2522 memcpy(params+pos, entry->operation, len);
2526 memcpy(params+pos, &(entry->instance),
sizeof(int32_t));
2527 pos +=
sizeof(int32_t);
2535 GString *text = g_string_new(
"");
2537 const GList *
const last = g_list_last(iop_order_list);
2538 for(
const GList *l = iop_order_list; l; l = g_list_next(l))
2542 snprintf(buf,
sizeof(buf),
"%s,%d%s", entry->operation, entry->instance, (l == last) ?
"" :
",");
2543 g_string_append(text, buf);
2546 return g_string_free(text,
FALSE);
2573 GList *first = g_list_first(list);
2576 ok = ok && (g_strcmp0(entry_first->
operation,
"basebuffer") == 0);
2580 GList *last = g_list_last(list);
2583 ok = ok && (g_strcmp0(entry_last->
operation,
"gamma") == 0);
2590 GList *iop_order_list = NULL;
2593 for(GList *l = list; l; l = g_list_next(l))
2605 const char *data = (
char *)l->data;
2607 sscanf(data,
"%d", &inst);
2611 iop_order_list = g_list_prepend(iop_order_list, entry);
2613 iop_order_list = g_list_reverse(iop_order_list);
2622 return iop_order_list;
2628 iop_order_list = NULL;
2634 GList *iop_order_list = NULL;
2644 const int32_t len = *(int32_t *)buf;
2645 buf +=
sizeof(int32_t);
2647 if(len < 0 || len > 20) {
dt_free(entry);
goto error; }
2656 buf +=
sizeof(int32_t);
2661 iop_order_list = g_list_prepend(iop_order_list, entry);
2663 size -= (2 *
sizeof(int32_t) + len);
2665 iop_order_list = g_list_reverse(iop_order_list);
2669 return iop_order_list;
2673 iop_order_list = NULL;
2677#undef DT_IOP_ORDER_INFO
static void error(char *msg)
static const dt_adaptation_t kind
gboolean dt_image_needs_rawprepare(const dt_image_t *img)
void dt_print(dt_debug_thread_t thread, const char *msg,...)
static void dt_free_gpointer(gpointer ptr)
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
static gboolean g_list_shorter_than(const GList *list, unsigned len)
sqlite3 * dt_database_get(const dt_database_t *db)
#define DT_DEBUG_SQLITE3_PREPARE_V2(a, b, c, d, e)
#define DT_DEBUG_SQLITE3_BIND_TEXT(a, b, c, d, e)
#define DT_DEBUG_SQLITE3_BIND_INT(a, b, c)
int dt_deprecated(const char *op)
Modules without a proper IOP order should throw errors and log, except if they are deprecated definit...
void dt_dev_write_history(dt_develop_t *dev, gboolean async)
Thread-safe wrapper around dt_dev_write_history_ext() for dev->image_storage.id.
void dt_dev_history_pixelpipe_update(dt_develop_t *dev, gboolean rebuild)
Rebuild or resync pixelpipes after backend history changes.
void dt_dev_history_gui_update(dt_develop_t *dev)
Apply history-loaded params to module GUIs.
void dt_dev_history_notify_change(dt_develop_t *dev, const int32_t imgid)
Notify the rest of the app that history changes were written.
gboolean dt_dev_reload_history_items(dt_develop_t *dev, const int32_t imgid)
Reload history from DB and rebuild pipelines/GUI state.
void dt_image_cache_read_release(dt_image_cache_t *cache, const dt_image_t *img)
dt_image_t * dt_image_cache_testget(dt_image_cache_t *cache, const int32_t imgid, char mode)
dt_iop_module_t * dt_iop_get_module_by_instance_name(GList *modules, const char *operation, const char *multi_name)
dt_iop_module_t * dt_iop_get_module_by_op_priority(GList *modules, const char *operation, const int multi_priority)
const dt_iop_order_entry_t ansel_raw_order[]
static void dt_ioppr_check_duplicate_iop_order(GList **_iop_list, GList *history_list)
Detect and resolve duplicate iop_order values.
static GList * dt_ioppr_extract_multi_instances_list(GList *iop_order_list)
Extract all order entries that have multiple instances.
const dt_iop_order_entry_t v30_order[]
static void _ioppr_check_rules(GList *iop_list, const int32_t imgid, const char *msg)
Validate pipeline order against fence and rule constraints.
GList * dt_ioppr_get_iop_order_list(int32_t imgid, gboolean sorted)
Load the order list for an image from the DB.
gboolean dt_ioppr_has_multiple_instances(GList *iop_order_list)
Detect whether multiple instances are grouped for a non-custom order.
gboolean dt_ioppr_has_iop_order_list(int32_t imgid)
Check whether the image has an explicit order list stored in DB.
static gboolean _ioppr_sanity_check_iop_order(GList *list)
Basic sanity check for an order list.
GList * dt_ioppr_merge_module_multi_instance_iop_order_list(GList *iop_order_list, const char *operation, GList *multi_instance_list)
Merge an operation's multiple instances into the order list.
void * dt_ioppr_serialize_iop_order_list(GList *iop_order_list, size_t *size)
Serialize an order list into a binary blob (used for presets).
GList * dt_ioppr_get_iop_order_list_version(dt_iop_order_t version)
Return the built-in order list for a given version.
gint dt_sort_iop_list_by_order_f(gconstpointer a, gconstpointer b)
Compare two list nodes holding modules by iop_order.
static void * _dup_iop_order_entry(const void *src, gpointer data)
Deep-copy callback for dt_iop_order_entry_t.
gint dt_sort_iop_by_order(gconstpointer a, gconstpointer b)
Compare two module instances by iop_order for sorting.
static void _ioppr_reset_iop_order(GList *iop_order_list)
Reset iop_order values to a sequential order for a list.
GList * dt_ioppr_get_iop_order_rules()
Return the list of ordering rules (prev/next constraints).
static void dt_ioppr_migrate_iop_order(struct dt_develop_t *dev, const int32_t imgid)
Apply a new order list by reloading history and rebuilding UI/pipelines.
static dt_dev_history_item_t * _ioppr_search_history_by_module(GList *history_list, dt_iop_module_t *mod)
Find a history item referencing a given module instance.
static int _count_entries_operation(GList *e_list, const char *operation)
Count order-list entries matching an operation name.
static GList * _insert_before(GList *iop_order_list, const char *module, const char *new_module)
Insert a missing module entry before another module in an order list.
void dt_ioppr_rebuild_iop_order_from_modules(struct dt_develop_t *dev, GList *ordered_modules)
Rebuild dev->iop_order_list from a list of ordered modules.
gint dt_sort_iop_list_by_order(gconstpointer a, gconstpointer b)
GList * _table_to_list(const dt_iop_order_entry_t entries[])
Build an order list from a static entry table.
gboolean dt_ioppr_check_can_move_before_iop(GList *iop_list, dt_iop_module_t *module, dt_iop_module_t *module_next)
Validate whether module can be moved before module_next.
gboolean dt_ioppr_check_can_move_after_iop(GList *iop_list, dt_iop_module_t *module, dt_iop_module_t *module_prev)
Validate whether module can be moved after module_prev.
gboolean dt_ioppr_move_iop_after(struct dt_develop_t *dev, dt_iop_module_t *module, dt_iop_module_t *module_prev)
Move a module instance after another module in the pipe.
static GList * dt_ioppr_merge_multi_instance_iop_order_list(GList *iop_order_list, GList *multi_instance_list)
Merge multiple-instance entries into an order list.
const dt_iop_order_entry_t ansel_jpg_order[]
static gboolean dt_ioppr_write_iop_order(const dt_iop_order_t kind, GList *iop_order_list, const int32_t imgid)
Persist an order list for a given image with a specific kind.
GList * dt_ioppr_iop_order_copy_deep(GList *iop_order_list)
Deep-copy an order list.
gboolean dt_ioppr_write_iop_order_list(GList *iop_order_list, const int32_t imgid)
Persist an order list to the DB for a given image.
void dt_ioppr_resync_modules_order(dt_develop_t *dev)
Update dev->iop module order values from dev->iop_order_list.
int dt_ioppr_get_iop_order(GList *iop_order_list, const char *op_name, const int multi_priority)
Return the iop_order for a given operation/instance pair.
int _get_multi_priority(dt_develop_t *dev, const char *operation, const int n, const gboolean only_disabled)
Return the multi_priority of the n-th instance of an operation.
int dt_ioppr_check_so_iop_order(GList *iop_list, GList *iop_order_list)
Check whether any module .so is missing an iop_order entry.
const dt_iop_order_entry_t legacy_order[]
static const dt_iop_order_entry_t * orders[5]
const char * iop_order_string[]
gboolean dt_ioppr_move_iop_before(struct dt_develop_t *dev, dt_iop_module_t *module, dt_iop_module_t *module_next)
Move a module instance before another module in the pipe.
dt_iop_order_t dt_ioppr_get_iop_order_list_kind(GList *iop_order_list)
Determine the kind of an order list by inspecting its content.
void dt_ioppr_update_for_style_items(dt_develop_t *dev, GList *st_items, gboolean append)
Update dev->iop_order_list with modules referenced by style items.
void dt_ioppr_set_default_iop_order(dt_develop_t *dev, const int32_t imgid)
Set dev->iop_order_list to the default order for a given image.
void dt_ioppr_resync_pipeline(dt_develop_t *dev, const int32_t imgid, const char *msg, gboolean check_duplicates)
Resynchronize pipeline order and related structures.
char * dt_ioppr_serialize_text_iop_order_list(GList *iop_order_list)
Serialize an order list to a text representation.
const dt_iop_order_entry_t v30_jpg_order[]
GList * dt_ioppr_deserialize_text_iop_order_list(const char *buf)
Deserialize an order list from a text representation.
void dt_ioppr_insert_module_instance(struct dt_develop_t *dev, dt_iop_module_t *module)
Ensure a module instance has an entry in dev->iop_order_list.
const char * dt_iop_order_string(const dt_iop_order_t order)
Return the human-readable name for an IOP order enum value.
void dt_ioppr_update_for_modules(dt_develop_t *dev, GList *modules, gboolean append)
Update dev->iop_order_list with modules from a module list.
static dt_iop_order_entry_t * dt_ioppr_get_iop_order_entry(GList *iop_order_list, const char *op_name, const int multi_priority)
Return the first order entry matching operation/instance.
static gboolean _operation_already_handled(GList *e_list, const char *operation)
Check if an operation was already handled earlier in the list.
dt_iop_order_t dt_ioppr_get_iop_order_version(const int32_t imgid)
Fetch the IOP order version stored for an image.
static void dt_ioppr_resync_iop_list(dt_develop_t *dev)
Resynchronize dev->iop list order against dev->iop_order_list.
GList * dt_ioppr_deserialize_iop_order_list(const char *buf, size_t size)
Deserialize an order list from a binary blob.
int dt_ioppr_check_iop_order(dt_develop_t *dev, const int32_t imgid, const char *msg)
Debug helper to validate the current order for a develop context.
static void _count_iop_module(GList *iop, const char *operation, int *max_multi_priority, int *count, int *max_multi_priority_enabled, int *count_enabled)
Count module instances and track their highest priorities.
static void dt_ioppr_update_for_entries(dt_develop_t *dev, GList *entry_list, gboolean append)
Update dev->iop_order_list to include entries from entry_list.
void dt_ioppr_change_iop_order(struct dt_develop_t *dev, const int32_t imgid, GList *new_iop_list)
Replace the current order list with a new one and persist it.
GList * dt_ioppr_get_iop_order_link(GList *iop_order_list, const char *op_name, const int multi_priority)
Find a list link matching an operation and instance.
float *const restrict const size_t k
void copy(double *dest, double *source, size_t num_el)
Copy a flat buffer.
const struct dt_database_t * db
struct dt_image_cache_t * image_cache
struct dt_develop_t * develop
struct dt_iop_module_t::@31 raster_mask
struct dt_iop_module_t::@31::@32 source
GModule *dt_dev_operation_t op
struct dt_iop_module_t::@31::@33 sink
union dt_iop_order_entry_t::@8 o
GList * dt_util_str_to_glist(const gchar *separator, const gchar *text)