Skip to content

Commit f6dadc3

Browse files
committed
Version 1.0.14
2 parents 91211e0 + 2937ffe commit f6dadc3

File tree

123 files changed

+450
-764
lines changed

Some content is hidden

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

123 files changed

+450
-764
lines changed

AbstractCommand.h

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,12 @@
2222
#include "ref_countable.h"
2323
#include "intrusive_ptr.h"
2424

25-
template<typename R>
26-
class AbstractCommand0 : public ref_countable {
25+
template<typename Res, typename... ArgTypes>
26+
class AbstractCommand : public ref_countable {
2727
public:
28-
typedef intrusive_ptr<AbstractCommand0> Ptr;
28+
typedef intrusive_ptr<AbstractCommand> Ptr;
2929

30-
virtual R operator()() = 0;
30+
virtual Res operator()(ArgTypes... args) = 0;
3131
};
3232

33-
34-
template<typename R, typename A1>
35-
class AbstractCommand1 : public ref_countable {
36-
public:
37-
typedef intrusive_ptr<AbstractCommand1> Ptr;
38-
39-
virtual R operator()(A1 arg1) = 0;
40-
};
41-
42-
43-
template<typename R, typename T1, typename T2>
44-
class AbstractCommand2 : public ref_countable {
45-
public:
46-
typedef intrusive_ptr<AbstractCommand2> Ptr;
47-
48-
virtual R operator()(T1 arg1, T2 arg2) = 0;
49-
};
50-
51-
5233
#endif // ifndef ABSTRACTCOMMAND_H_

BackgroundExecutor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ class BackgroundExecutor {
2929
DECLARE_NON_COPYABLE(BackgroundExecutor)
3030

3131
public:
32-
typedef intrusive_ptr<AbstractCommand0<void>> TaskResultPtr;
33-
typedef intrusive_ptr<AbstractCommand0<TaskResultPtr>> TaskPtr;
32+
typedef intrusive_ptr<AbstractCommand<void>> TaskResultPtr;
33+
typedef intrusive_ptr<AbstractCommand<TaskResultPtr>> TaskPtr;
3434

3535
BackgroundExecutor();
3636

BackgroundTask.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include <QAtomicInt>
2727
#include <exception>
2828

29-
class BackgroundTask : public AbstractCommand0<FilterResultPtr>, public TaskStatus {
29+
class BackgroundTask : public AbstractCommand<FilterResultPtr>, public TaskStatus {
3030
public:
3131
enum Type { INTERACTIVE, BATCH };
3232

BlackOnWhiteEstimator.cpp

Lines changed: 0 additions & 103 deletions
This file was deleted.

BlackOnWhiteEstimator.h

Lines changed: 0 additions & 35 deletions
This file was deleted.

BubbleAnimation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ bool BubbleAnimation::nextFrame(const QColor& head_color,
6464

6565
for (int i = 0; i < m_numBubbles; ++i) {
6666
const double angle = -0.5 * PI + 2.0 * PI * (m_curFrame - i) / m_numBubbles;
67-
const double s = sin(angle);
68-
const double c = cos(angle);
67+
const double s = std::sin(angle);
68+
const double c = std::cos(angle);
6969
const QPointF vec(c * reduced_radius, s * reduced_radius);
7070
QRectF r(0.0, 0.0, 2.0 * bubble_radius, 2.0 * bubble_radius);
7171
r.moveCenter(center + vec);

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,6 @@ SET(
557557
DefaultParamsProvider.cpp DefaultParamsProvider.h
558558
DeviationProvider.h
559559
OrderByDeviationProvider.cpp OrderByDeviationProvider.h
560-
BlackOnWhiteEstimator.cpp BlackOnWhiteEstimator.h
561560
ImageSettings.cpp ImageSettings.h
562561
version.h
563562
config.h.in

ConsoleBatch.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ BackgroundTaskPtr ConsoleBatch::createCompositeTask(const PageInfo& page, const
139139
}
140140
assert(fix_orientation_task);
141141

142-
return BackgroundTaskPtr(
143-
new LoadFileTask(BackgroundTask::BATCH, page, m_ptrThumbnailCache, m_ptrPages, fix_orientation_task));
142+
return make_intrusive<LoadFileTask>(BackgroundTask::BATCH, page, m_ptrThumbnailCache, m_ptrPages,
143+
fix_orientation_task);
144144
} // ConsoleBatch::createCompositeTask
145145

146146
// process the image vector **images** and save output to **output_dir**

ContentSpanFinder.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121

2222
using namespace imageproc;
2323

24-
void ContentSpanFinder::findImpl(const SlicedHistogram& histogram, VirtualFunction1<void, Span>& handler) const {
24+
void ContentSpanFinder::findImpl(const SlicedHistogram& histogram,
25+
const VirtualFunction<void, const Span&>& handler) const {
2526
const auto hist_size = static_cast<const int>(histogram.size());
2627

2728
int i = 0;

ContentSpanFinder.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,16 @@ class ContentSpanFinder {
5151
void find(const imageproc::SlicedHistogram& histogram, T handler) const;
5252

5353
private:
54-
void findImpl(const imageproc::SlicedHistogram& histogram, VirtualFunction1<void, Span>& handler) const;
54+
void findImpl(const imageproc::SlicedHistogram& histogram, const VirtualFunction<void, const Span&>& handler) const;
5555

5656
int m_minContentWidth;
5757
int m_minWhitespaceWidth;
5858
};
5959

6060

61-
template<typename T>
62-
void ContentSpanFinder::find(const imageproc::SlicedHistogram& histogram, T handler) const {
63-
ProxyFunction1<T, void, Span> proxy(handler);
64-
findImpl(histogram, proxy);
61+
template<typename Callable>
62+
void ContentSpanFinder::find(const imageproc::SlicedHistogram& histogram, Callable handler) const {
63+
findImpl(histogram, ProxyFunction<Callable, void, const Span&>(handler));
6564
}
6665

6766
#endif // ifndef CONTENTSPANFINDER_H_

0 commit comments

Comments
 (0)