Compare commits
4 Commits
6eda2c4e48
...
20260119
| Author | SHA1 | Date | |
|---|---|---|---|
| 3448f62f31 | |||
| 567e66acb5 | |||
| 9e79133464 | |||
| e08107aa13 |
+1
-1
Submodule libXISF updated: 2e74d94641...7b70b6a081
@@ -59,6 +59,15 @@
|
|||||||
</screenshots>
|
</screenshots>
|
||||||
<content_rating type="oars-1.1"/>
|
<content_rating type="oars-1.1"/>
|
||||||
<releases>
|
<releases>
|
||||||
|
<release version="20251101" date="2025-11-01">
|
||||||
|
<description>
|
||||||
|
<ul>
|
||||||
|
<li>Better image Save as</li>
|
||||||
|
<li>Fix xisf file corruption when platesolving</li>
|
||||||
|
<li>Add selecting language</li>
|
||||||
|
</ul>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
<release version="20250915" date="2025-09-15">
|
<release version="20250915" date="2025-09-15">
|
||||||
<description>
|
<description>
|
||||||
<ul>
|
<ul>
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ void Image::thumbnailLoadFinish(std::shared_ptr<RawImage> rawImage)
|
|||||||
emit thumbnailLoaded(this);
|
emit thumbnailLoaded(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageRingList::ImageRingList(Database *database, const QStringList &nameFilter, QObject *parent) : QAbstractItemModel(parent)
|
ImageRingList::ImageRingList(Database *database, const QStringList &nameFilter, QObject *parent) : QAbstractListModel(parent)
|
||||||
, m_liveMode(false)
|
, m_liveMode(false)
|
||||||
, m_analyzeLevel(None)
|
, m_analyzeLevel(None)
|
||||||
, m_database(database)
|
, m_database(database)
|
||||||
@@ -412,7 +412,7 @@ void ImageRingList::clearThumbnails()
|
|||||||
img->clearThumbnail();
|
img->clearThumbnail();
|
||||||
}
|
}
|
||||||
|
|
||||||
QModelIndex ImageRingList::index(int row, int column, const QModelIndex &parent) const
|
/*QModelIndex ImageRingList::index(int row, int column, const QModelIndex &parent) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(parent);
|
Q_UNUSED(parent);
|
||||||
return createIndex(row, column, m_images.at(row).get());
|
return createIndex(row, column, m_images.at(row).get());
|
||||||
@@ -422,7 +422,7 @@ QModelIndex ImageRingList::parent(const QModelIndex &child) const
|
|||||||
{
|
{
|
||||||
Q_UNUSED(child);
|
Q_UNUSED(child);
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
int ImageRingList::rowCount(const QModelIndex &parent) const
|
int ImageRingList::rowCount(const QModelIndex &parent) const
|
||||||
{
|
{
|
||||||
@@ -432,14 +432,16 @@ int ImageRingList::rowCount(const QModelIndex &parent) const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ImageRingList::columnCount(const QModelIndex &parent) const
|
/*int ImageRingList::columnCount(const QModelIndex &parent) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(parent);
|
Q_UNUSED(parent);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
QVariant ImageRingList::data(const QModelIndex &index, int role) const
|
QVariant ImageRingList::data(const QModelIndex &index, int role) const
|
||||||
{
|
{
|
||||||
|
if(index.isValid() && index.row() >= 0 && index.row() < m_images.size())
|
||||||
|
{
|
||||||
switch(role)
|
switch(role)
|
||||||
{
|
{
|
||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
@@ -457,6 +459,8 @@ QVariant ImageRingList::data(const QModelIndex &index, int role) const
|
|||||||
default:
|
default:
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant ImageRingList::headerData(int section, Qt::Orientation orientation, int role) const
|
QVariant ImageRingList::headerData(int section, Qt::Orientation orientation, int role) const
|
||||||
|
|||||||
+4
-4
@@ -51,7 +51,7 @@ typedef std::shared_ptr<Image> ImagePtr;
|
|||||||
|
|
||||||
class Database;
|
class Database;
|
||||||
|
|
||||||
class ImageRingList : public QAbstractItemModel
|
class ImageRingList : public QAbstractListModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
int m_width;
|
int m_width;
|
||||||
@@ -93,10 +93,10 @@ public:
|
|||||||
void updateMark();
|
void updateMark();
|
||||||
void clearThumbnails();
|
void clearThumbnails();
|
||||||
|
|
||||||
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
|
//QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
|
||||||
QModelIndex parent(const QModelIndex &child) const override;
|
//QModelIndex parent(const QModelIndex &child) const override;
|
||||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||||
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
//int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
||||||
public slots:
|
public slots:
|
||||||
|
|||||||
+5
-1
@@ -193,7 +193,11 @@ void ConvertRunable::run()
|
|||||||
QFileInfo info(m_outfile);
|
QFileInfo info(m_outfile);
|
||||||
info.dir().mkpath(".");
|
info.dir().mkpath(".");
|
||||||
|
|
||||||
if(m_params.autostretch)
|
if(m_params.stretch)
|
||||||
|
{
|
||||||
|
rawimage->applySTF(m_params.mtf);
|
||||||
|
}
|
||||||
|
else if(m_params.autostretch)
|
||||||
{
|
{
|
||||||
rawimage->calcStats();
|
rawimage->calcStats();
|
||||||
MTFParam mtfParam = rawimage->calcMTFParams();
|
MTFParam mtfParam = rawimage->calcMTFParams();
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include <QSemaphore>
|
#include <QSemaphore>
|
||||||
#include <QSize>
|
#include <QSize>
|
||||||
#include "imageinfodata.h"
|
#include "imageinfodata.h"
|
||||||
|
#include "mtfparam.h"
|
||||||
|
|
||||||
class Image;
|
class Image;
|
||||||
|
|
||||||
@@ -33,6 +34,8 @@ public:
|
|||||||
QSize resize;
|
QSize resize;
|
||||||
Qt::AspectRatioMode aspect = Qt::KeepAspectRatio;
|
Qt::AspectRatioMode aspect = Qt::KeepAspectRatio;
|
||||||
bool autostretch = false;
|
bool autostretch = false;
|
||||||
|
bool stretch = false;
|
||||||
|
MTFParam mtf;
|
||||||
ConvertParams(){}
|
ConvertParams(){}
|
||||||
ConvertParams(const QVariantMap &map);
|
ConvertParams(const QVariantMap &map);
|
||||||
};
|
};
|
||||||
|
|||||||
+14
-13
@@ -620,9 +620,13 @@ void MainWindow::reindex()
|
|||||||
void MainWindow::saveAs()
|
void MainWindow::saveAs()
|
||||||
{
|
{
|
||||||
QString selectedFilter;
|
QString selectedFilter;
|
||||||
|
ImagePtr ptr = m_ringList->currentImage();
|
||||||
|
if(!ptr)return;
|
||||||
|
|
||||||
|
QFileInfo srcFile(ptr->name());
|
||||||
QString file = QFileDialog::getSaveFileName(this,
|
QString file = QFileDialog::getSaveFileName(this,
|
||||||
tr("Save as"),
|
tr("Save as"),
|
||||||
_lastDir,
|
_lastDir + "/" + srcFile.baseName(),
|
||||||
_saveFilter,
|
_saveFilter,
|
||||||
&selectedFilter);
|
&selectedFilter);
|
||||||
auto filterToFormat = [](const QString &file, const QString &filter) -> const QString
|
auto filterToFormat = [](const QString &file, const QString &filter) -> const QString
|
||||||
@@ -644,25 +648,22 @@ void MainWindow::saveAs()
|
|||||||
|
|
||||||
if(!file.isEmpty())
|
if(!file.isEmpty())
|
||||||
{
|
{
|
||||||
|
auto button = QMessageBox::question(this, tr("Apply stretch?"), tr("Apply current stretch function to image?"));
|
||||||
|
|
||||||
QString format = filterToFormat(file, selectedFilter);
|
QString format = filterToFormat(file, selectedFilter);
|
||||||
|
|
||||||
if(format == "fits" || format == "xisf")
|
convert(file, format, button == QMessageBox::Yes);
|
||||||
{
|
|
||||||
convert(file, format);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
QImage img = m_image->renderToImage();
|
|
||||||
if(!img.isNull())
|
|
||||||
img.save(file, filterToFormat(file, selectedFilter).toLatin1().data());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::convert(const QString &outfile, const QString &format)
|
void MainWindow::convert(const QString &outfile, const QString &format, bool stretch)
|
||||||
{
|
{
|
||||||
QString file = m_ringList->currentImage()->name();
|
QString file = m_ringList->currentImage()->name();
|
||||||
QThreadPool::globalInstance()->start(new ConvertRunable(file, outfile, format));
|
ConvertRunable::ConvertParams param;
|
||||||
|
param.stretch = stretch;
|
||||||
|
param.mtf = m_stretchPanel->params();
|
||||||
|
|
||||||
|
QThreadPool::globalInstance()->start(new ConvertRunable(file, outfile, format, param));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::markImage()
|
void MainWindow::markImage()
|
||||||
|
|||||||
+1
-1
@@ -52,7 +52,7 @@ public slots:
|
|||||||
void indexDir(const QString &dir);
|
void indexDir(const QString &dir);
|
||||||
void reindex();
|
void reindex();
|
||||||
void saveAs();
|
void saveAs();
|
||||||
void convert(const QString &outfile, const QString &format);
|
void convert(const QString &outfile, const QString &format, bool stretch);
|
||||||
void markImage();
|
void markImage();
|
||||||
void unmarkImage();
|
void unmarkImage();
|
||||||
void markAndNext();
|
void markAndNext();
|
||||||
|
|||||||
@@ -1195,6 +1195,21 @@ void RawImage::applySTF(const MTFParam &mtfParams)
|
|||||||
for(size_t i = 0; i < len; i++)
|
for(size_t i = 0; i < len; i++)
|
||||||
{
|
{
|
||||||
float x;
|
float x;
|
||||||
|
if(m_ch == 4)
|
||||||
|
{
|
||||||
|
size_t c = i & 0x3;
|
||||||
|
if(c < 3)
|
||||||
|
{
|
||||||
|
if constexpr(std::numeric_limits<std::remove_reference_t<decltype(*src)>>::is_integer)x = src[i] * iscale;
|
||||||
|
else x = src[i] * unit.first + unit.second;
|
||||||
|
x = (x - mtfParams.blackPoint[c]) / (mtfParams.whitePoint[c] - mtfParams.blackPoint[c]);
|
||||||
|
x = std::clamp(x, 0.0f, 1.0f);
|
||||||
|
x = ((mtfParams.midPoint[c] - 1.0f) * x) / ((2.0f * mtfParams.midPoint[c] - 1.0f) * x - mtfParams.midPoint[c]);
|
||||||
|
src[i] = x * s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if constexpr(std::numeric_limits<std::remove_reference_t<decltype(*src)>>::is_integer)x = src[i] * iscale;
|
if constexpr(std::numeric_limits<std::remove_reference_t<decltype(*src)>>::is_integer)x = src[i] * iscale;
|
||||||
else x = src[i] * unit.first + unit.second;
|
else x = src[i] * unit.first + unit.second;
|
||||||
x = (x - mtfParams.blackPoint[0]) / (mtfParams.whitePoint[0] - mtfParams.blackPoint[0]);
|
x = (x - mtfParams.blackPoint[0]) / (mtfParams.whitePoint[0] - mtfParams.blackPoint[0]);
|
||||||
@@ -1202,6 +1217,7 @@ void RawImage::applySTF(const MTFParam &mtfParams)
|
|||||||
x = ((mtfParams.midPoint[0] - 1.0f) * x) / ((2.0f * mtfParams.midPoint[0] - 1.0f) * x - mtfParams.midPoint[0]);
|
x = ((mtfParams.midPoint[0] - 1.0f) * x) / ((2.0f * mtfParams.midPoint[0] - 1.0f) * x - mtfParams.midPoint[0]);
|
||||||
src[i] = x * s;
|
src[i] = x * s;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
switch(m_type)
|
switch(m_type)
|
||||||
|
|||||||
@@ -104,6 +104,11 @@ StretchToolbar::~StretchToolbar()
|
|||||||
settings.setValue("stretchtoolbar/autostretch", m_autoStretchOnLoad->isChecked());
|
settings.setValue("stretchtoolbar/autostretch", m_autoStretchOnLoad->isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const MTFParam &StretchToolbar::params() const
|
||||||
|
{
|
||||||
|
return m_mtfParam;
|
||||||
|
}
|
||||||
|
|
||||||
void StretchToolbar::stretchImage(Image *img)
|
void StretchToolbar::stretchImage(Image *img)
|
||||||
{
|
{
|
||||||
if(img && img->rawImage())
|
if(img && img->rawImage())
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ class StretchToolbar : public QToolBar
|
|||||||
public:
|
public:
|
||||||
explicit StretchToolbar(QWidget *parent = nullptr);
|
explicit StretchToolbar(QWidget *parent = nullptr);
|
||||||
~StretchToolbar();
|
~StretchToolbar();
|
||||||
|
const MTFParam& params() const;
|
||||||
public slots:
|
public slots:
|
||||||
void stretchImage(Image *img);
|
void stretchImage(Image *img);
|
||||||
void resetMTF();
|
void resetMTF();
|
||||||
|
|||||||
Reference in New Issue
Block a user