1 /*
2  * UFRaw - Unidentified Flying Raw converter for digital camera images
3  *
4  * uf_progress.h - progress bar header
5  * Copyright 2009-2016 by Frank van Maarseveen, Udi Fuchs
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  */
12 
13 #ifndef _UF_PROGRESS_H
14 #define _UF_PROGRESS_H
15 
16 #define PROGRESS_WAVELET_DENOISE	1
17 #define PROGRESS_DESPECKLE		2
18 #define PROGRESS_INTERPOLATE		3
19 #define PROGRESS_RENDER			4	/* tiled work */
20 
21 #define PROGRESS_LOAD			5
22 #define PROGRESS_SAVE			6
23 
24 extern void (*ufraw_progress)(int what, int ticks);
25 
26 /*
27  * The first call for a PROGRESS_* activity should specify a negative number
28  * of ticks. This call will prepare the corresponding progress bar segment.
29  * Subsequent calls for the same activity should specify a non-negative number
30  * of ticks corresponding to the amount of work just done. The total number
31  * of ticks including the initialization call should be approximately zero.
32  *
33  * This function is thread safe. See also preview_progress().
34  */
progress(int what,int ticks)35 static inline void progress(int what, int ticks)
36 {
37     if (ufraw_progress)
38         ufraw_progress(what, ticks);
39 }
40 
41 #endif /* _UF_PROGRESS_H */
42