Add thumbnailer

This commit is contained in:
2025-02-16 23:36:25 +01:00
parent c36068aaf4
commit 58c182adc0
5 changed files with 99 additions and 7 deletions
+18 -7
View File
@@ -1,12 +1,17 @@
#include "rawimage.h"
#include <QDebug>
#include <cstring>
#include <lcms2.h>
#ifndef NO_QT
#include <QDebug>
#include <QElapsedTimer>
#include <QFloat16>
#include <QColorSpace>
#include <lcms2.h>
using F16 = qfloat16;
#else
#include <algorithm>
using F16 = uint16_t;
#endif
int THUMB_SIZE = 128;
int THUMB_SIZE_BORDER = 138;
@@ -78,6 +83,7 @@ RawImage::RawImage(RawImage &&d)
m_thumbAspect = d.m_thumbAspect;
}
#ifndef NO_QT
RawImage::RawImage(const QImage &img)
{
qDebug() << img;
@@ -145,6 +151,7 @@ RawImage::RawImage(const QImage &img)
}
m_stats.m_stats = false;
}
#endif
const RawImage::Stats& RawImage::imageStats() const
{
@@ -439,7 +446,9 @@ void RawImage::convertToThumbnail()
loop(out, reinterpret_cast<float*>(m_pixels.get()), 1.0f);
break;
default:
#ifndef NO_QT
qWarning() << "FLOAT64 should not happend";
#endif
return;
}
@@ -922,11 +931,13 @@ bool RawImage::valid() const
return m_width > 0 && m_height > 0;
}
#ifndef NO_QT
void RawImage::setICCProfile(const QByteArray &icc)
{
if(icc.size())
m_iccProfile = std::vector<uint8_t>(icc.begin(), icc.end());
}
#endif
void RawImage::setICCProfile(const LibXISF::ByteArray &icc)
{
@@ -973,12 +984,12 @@ void RawImage::convertTosRGB()
}
else
{
qDebug() << "Failed to create color transform";
//qDebug() << "Failed to create color transform";
}
}
else
{
qDebug() << "Failed to open icc profile";
//qDebug() << "Failed to open icc profile";
}
cmsCloseProfile(inProfile);
@@ -1022,13 +1033,13 @@ void RawImage::generateLUT()
}
else
{
qDebug() << "Failed to create color transform";
//qDebug() << "Failed to create color transform";
m_lut.clear();
}
}
else
{
qDebug() << "Failed to open icc profile";
//qDebug() << "Failed to open icc profile";
m_lut.clear();
}