Basic Image AlgorithmS Library
2.8.0
|
Visualises the progress of some computation in the console. More...
#include <Utils/ConsoleProgress.hh>
Public Member Functions | |
ConsoleProgress (unsigned int maxValue=0) | |
Constructor. More... | |
void | PrintPercentage (unsigned int curValue) |
Prints the current percentage if it is equal or greater than all integral percentage values that have been printed before. More... | |
void | PrintProgressBar (unsigned int curValue, unsigned int size=25) |
Prints progress bar showing the current percentage. More... | |
void | Reset (unsigned int maxValue=0) |
Resets the internal counter and sets the maximum value to reach. More... | |
Visualises the progress of some computation in the console.
This class is intended to show the progress of an iteration over a large number of elements. It only prints itegral percentage values and so doesn't spam the console.
If you only iterate over a small number of elements (e.g. 100), performance may be hit drastically because output is flushed after each integral percentage (i.e. an I/O operation is performed).
Definition at line 50 of file ConsoleProgress.hh.
|
inlineexplicit |
Constructor.
maxValue | the maximum value to reach, equivalent to 100% |
Definition at line 62 of file ConsoleProgress.hh.
|
inline |
Prints the current percentage if it is equal or greater than all integral percentage values that have been printed before.
curValue | the current value within interval [0, maxValue] |
Definition at line 95 of file ConsoleProgress.hh.
|
inline |
Prints progress bar showing the current percentage.
curValue | The current value within interval [0, maxValue]. |
size | The length of the progress bar in characters. |
Definition at line 124 of file ConsoleProgress.hh.
|
inline |
Resets the internal counter and sets the maximum value to reach.
maxValue | the maximum value to reach, equivalent to 100%. if set to 0, the current maxValue will not be changed. |
Definition at line 76 of file ConsoleProgress.hh.