Files
tenmon/loadrunable.h
T

50 lines
1.2 KiB
C++

#ifndef LOADRUNABLE_H
#define LOADRUNABLE_H
#include <QRunnable>
#include <QString>
#include <QSemaphore>
#include "imageinfo.h"
class RawImage;
bool readFITSHeader(const QString &path, ImageInfoData &info);
bool readXISFHeader(const QString &path, ImageInfoData &info);
bool loadImage(const QString &path, ImageInfoData &info, std::shared_ptr<RawImage> &rawImage, bool planar = false);
class Image;
class LoadRunable : public QRunnable
{
QString m_file;
Image *m_receiver;
AnalyzeLevel m_analyzeLevel;
bool m_thumbnail;
public:
LoadRunable(const QString &file, Image *receiver, AnalyzeLevel level, bool thumbnail = false);
void run() override;
};
class ConvertRunable : public QRunnable
{
public:
struct ConvertParams
{
int compressionLevel = -1;
QString compressionType;
ConvertParams(){}
ConvertParams(const QVariantMap &map);
};
ConvertRunable(const QString &in, const QString &out, const QString &format, const ConvertParams &params = ConvertParams(), QSemaphore *semaphore = nullptr);
void run() override;
private:
QString m_infile;
QString m_outfile;
QString m_format;
ConvertParams m_params;
QSemaphore *m_semaphore;
};
#endif // LOADRUNABLE_H