Hugin trunk 0.1
Loading...
Searching...
No Matches
ProgressDisplay.h
Go to the documentation of this file.
1// -*- c-basic-offset: 4 -*-
26#ifndef _APPBASE_PROGRESSDISPLAY_H
27#define _APPBASE_PROGRESSDISPLAY_H
28
29#include <iostream>
30#include <string>
31
32#include <hugin_shared.h>
33#include <hugin_utils/utils.h>
34
35
36namespace AppBase {
37
42{
43protected:
45 explicit ProgressDisplay(int maximum=0) : m_canceled(false), m_maximum(maximum), m_progress(0) {};
46public:
47 /* virtual destructor */
48 virtual ~ProgressDisplay() {};
50 void setMessage(const std::string& message, const std::string& filename="");
52 void taskFinished();
54 bool updateDisplay();
55 bool updateDisplay(const std::string& message);
56 bool updateDisplayValue();
58 void setMaximum(int newMaximum);
61 bool wasCancelled();
62
63protected:
67 virtual void updateProgressDisplay() = 0;
68
69protected:
71 std::string m_message;
72 std::string m_filename;
75};
76
77
81{
82protected:
84 virtual void updateProgressDisplay() {};
85};
86
90{
91 public:
93 explicit StreamProgressDisplay(std::ostream & o) : ProgressDisplay(), m_stream(o) {};
95 virtual void updateProgressDisplay();
96 protected:
97 std::ostream & m_stream;
98};
99
100}; //namespace
101
102#endif // _H
Dummy progress display, without output.
virtual void updateProgressDisplay()
update the display, does output nothing
virtual void updateProgressDisplay()=0
Template method, updates the display.
ProgressDisplay(int maximum=0)
constructor
a progress display to print progress reports to a stream
StreamProgressDisplay(std::ostream &o)
constructor, connect with given outputstream
#define IMPEX
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
Definition threshold.h:41