Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Isis Developer Reference
ImageReader.h
Go to the documentation of this file.
1#ifndef ImageReader_H
2#define ImageReader_H
3
4#include <QObject>
5
6#include <QPointer>
7
8// This is the parent of the inner class
9#include <functional>
10
11// We're using an internal enum for actions()
13// This is in a signal
14#include "ImageList.h"
15// This is inlined in the templated read()
16#include "ProgressBar.h"
17// This is in a slot
18#include "PvlObject.h"
19
20template <typename A> class QFutureWatcher;
21class QMutex;
22class QProgressBar;
23class QVariant;
24
25namespace Isis {
26 class PvlObject;
27
42 class ImageReader : public QObject {
43 Q_OBJECT
44
45 public:
46 ImageReader(QMutex *cameraMutex, bool requireFootprints = true, QObject *parent = NULL);
47 virtual ~ImageReader();
48
51
52 signals:
53 void imagesReady(ImageList images);
54
55 public slots:
56 void askDefaultAlpha();
57 void read(PvlObject imagesObj);
58 void read(QStringList imageFileNames);
59 void setOpenFilled(bool openFilled);
60 void setSafeFileOpen(bool safeFileOpen);
61
62 private slots:
63 void imageReady(int);
64 void mappedFinished();
65 //void setSmallNumberOfOpenImages(bool useSmallNumber);
66
67 private:
68 Q_DISABLE_COPY(ImageReader)
69
70 template <typename Iterator>
71 void read(Iterator begin, Iterator end) {
72 int numNewEntries = 0;
73 while (begin != end) {
74 m_backlog.append(QVariant::fromValue(*begin));
75 numNewEntries++;
76 begin++;
77 }
78
79 m_progress->setRange(0, m_progress->maximum() + numNewEntries);
80
81 start();
82 }
83
84 void initProgress();
85 void start();
86
87 void readSettings();
88 void writeSettings();
89
90 private:
95 QPointer<QAction> m_askAlphaAct;
96 QList<QVariant> m_backlog;
97 QMutex *m_cameraMutex;
98 QPointer<QAction> m_openFilledAct;
99 QPointer<ProgressBar> m_progress;
100 QPointer<QAction> m_safeFileOpenAct;
101 QFutureWatcher<Image *> * m_watcher;
102
103 bool m_safeFileOpen;
104 bool m_openFilled;
105 int m_defaultAlpha;
106 bool m_requireFootprints;
107
108 bool m_mappedRunning;
109
110 private:
119 class VariantToImageFunctor : public std::function<
120 Image *(const QVariant &)> {
121
122 public:
123 VariantToImageFunctor(QMutex *cameraMutex, bool requireFootprints, QThread *targetThread,
124 bool openFilled, int defaultAlpha);
125 Image *operator()(const QVariant &);
126
127 private:
128 QMutex *m_mutex;
129 QThread *m_targetThread;
130
131 int m_defaultAlpha;
132 bool m_openFilled;
133 bool m_requireFootprints;
134 };
135 };
136};
137
138#endif
139
Property
This is a list of properties and actions that are possible.
Definition ImageDisplayProperties.h:90
Internalizes a list of images and allows for operations on the entire list.
Definition ImageList.h:52
void setSafeFileOpen(bool safeFileOpen)
Definition ImageReader.cpp:168
void read(PvlObject imagesObj)
Definition ImageReader.cpp:147
void imagesReady(ImageList images)
ImageReader(QMutex *cameraMutex, bool requireFootprints=true, QObject *parent=NULL)
MosaicWidget constructor.
Definition ImageReader.cpp:35
QList< QAction * > actions(ImageDisplayProperties::Property relevantDispProperties)
Definition ImageReader.cpp:84
virtual ~ImageReader()
Free the allocated memory by this object.
Definition ImageReader.cpp:65
void askDefaultAlpha()
Definition ImageReader.cpp:134
void setOpenFilled(bool openFilled)
Definition ImageReader.cpp:160
QProgressBar * progress()
Definition ImageReader.cpp:129
This is free and unencumbered software released into the public domain.
Definition AbstractTableModel.h:24
This is free and unencumbered software released into the public domain.
Definition BoxcarCachingAlgorithm.h:13
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16