Add thumbnails

This commit is contained in:
2022-04-18 07:16:46 +02:00
parent 2c95364fc4
commit 4e6230eef2
14 changed files with 347 additions and 39 deletions
+20 -5
View File
@@ -12,11 +12,13 @@
#include <pcl/XISF.h>
#include "rawimage.h"
#include "starfit.h"
#include <opencv2/imgcodecs.hpp>
LoadRunable::LoadRunable(const QString &file, Image *receiver, AnalyzeLevel level) :
LoadRunable::LoadRunable(const QString &file, Image *receiver, AnalyzeLevel level, bool thumbnail) :
m_file(file),
m_receiver(receiver),
m_analyzeLevel(level)
m_analyzeLevel(level),
m_thumbnail(thumbnail)
{
}
@@ -334,7 +336,7 @@ bool loadXISF(const QString &path, ImageInfoData &info, RawImage **image)
void LoadRunable::run()
{
if(!m_receiver->isCurrent())
if(!m_thumbnail && !m_receiver->isCurrent())
{
return;
}
@@ -375,7 +377,7 @@ void LoadRunable::run()
rawImage = new RawImage(img);
}
if(rawImage && m_analyzeLevel >= Statistics)
if(rawImage && m_analyzeLevel >= Statistics && !m_thumbnail)
{
double mean, median, min, max, mad;
double stdDev;
@@ -440,7 +442,20 @@ void LoadRunable::run()
}
}
QMetaObject::invokeMethod(m_receiver, "imageLoaded", Qt::QueuedConnection, Q_ARG(void*, rawImage), Q_ARG(ImageInfoData, info));
if(m_thumbnail)
{
if(rawImage)
{
rawImage->convertToThumbnail();
QMetaObject::invokeMethod(m_receiver, "thumbnailLoadFinish", Qt::QueuedConnection, Q_ARG(void*, rawImage));
}
else
{
qDebug() << "failed";
}
}
else
QMetaObject::invokeMethod(m_receiver, "imageLoaded", Qt::QueuedConnection, Q_ARG(void*, rawImage), Q_ARG(ImageInfoData, info));
}
bool readFITSHeader(const QString &path, ImageInfoData &info)