Compare commits
8 Commits
7e95440dd6
...
20251101
| Author | SHA1 | Date | |
|---|---|---|---|
| 9e79133464 | |||
| e08107aa13 | |||
| 6eda2c4e48 | |||
| b16ae3a9ee | |||
| 56bba27ae3 | |||
| 1070dc32c1 | |||
| f61cf12f0a | |||
| 530b0c62c3 |
+17
-3
@@ -61,7 +61,7 @@ This image should be 256 pixel wide. Each row of image will be used as separate
|
||||
<li>mid point - defines the value to be stretched to 50% intensity</li>
|
||||
<li>white point - all pixels with higher value (brighter) than this will be clipped white</li>
|
||||
</ul>
|
||||
<p>Following the slider are 7 buttons for automatic stretching:</p>
|
||||
<p>Following the slider are 8 buttons to control image display:</p>
|
||||
<ul>
|
||||
<li><i>Linked channels</i> toggle stretching each RGB channel individually.</li>
|
||||
<li><i>Auto Stretch</i> automatically apply black and mid points to render the image with optimal brightness.</li>
|
||||
@@ -70,6 +70,7 @@ This image should be 256 pixel wide. Each row of image will be used as separate
|
||||
<li><i>False colors</i> show black and white in false colour palette.</li>
|
||||
<li><i>Debayer CFA</i> Demosaicing black and white image from CFA sensor to color one.</li>
|
||||
<li><i>Apply Auto stretch on load</i> toggle automatically applying Autostretch for each image when loaded.</li>
|
||||
<li><i>Draw equatorial grid</i> toggle drawing equatorial coordinate grid and catalogue objects. Needs that file have WCS data.</li>
|
||||
</ul>
|
||||
|
||||
<h3>Marking images</h3>
|
||||
@@ -134,12 +135,24 @@ solver.
|
||||
<p>Then finally there are various action button. Settings button show dialog where you can set path to existing index files or auto download some.
|
||||
Extract button will just extract stars from image and it will show their count, HFR and eccentricity. This action doesn't need index files.
|
||||
Solve button will try to find coordinates of images. Abort button will stop extraction or solving. Update FITS header will update FITS fits keywords
|
||||
with found solution.
|
||||
with found solution.</p>
|
||||
|
||||
<p>In settings dialog you can set path to index files which is by default custom internal one. It also try to locate commonly used path from other
|
||||
programs like KStars for astrometry.net index files.
|
||||
</p>
|
||||
|
||||
<h3>File Manager</h3>
|
||||
<p>
|
||||
This is simple double panel file manager. It can show columns with selected FITS keywords. Each panel have tabs where it easily switch between
|
||||
multiple directories. You can copy or move files and directories either inside one panel or between two panels by selecting and then dragging.
|
||||
By default files are copies. To move then press Shift key before start dragging. Double click on file will open it in main window if it is image
|
||||
or other file it will open default program that is associated with it this file type. You can also drag file to other programs like from default
|
||||
file explorer programs that are in system or from file explorer to this program.
|
||||
</p>
|
||||
<p>
|
||||
In menu you can select which FITS keywords will be showed. Temporarilly disable loading FITS header or copy file paths of selected files as text.
|
||||
</p>
|
||||
|
||||
<h3>Batch processing</h3>
|
||||
<p>This module allow to write scripts in JavaScript that process image files. Batch Processing window consist from three main parts. On top is list of input files and directories.
|
||||
You can add directories or individual files to this list. Directories are scanned recursively to find all files even non image files. This list of files is then passed to script in array named <b>files</b>.
|
||||
@@ -159,7 +172,8 @@ this output directory is ignored.</p>
|
||||
<p>Bellow that is list of scripts. These scripts are located in application data directory. Select script which you want to run by clicking on it. Clicking on <i>Open scripts</i> will open directory with these scripts where you create new and edit them.
|
||||
Location of this directory is on Windows: "C:/Users/<USER>/AppData/Roaming/nou/Tenmon/scripts" Linux: "~/.local/share/nou/Tenmon/scripts" MacOS: "~/Library/Application Support/nou/Tenmon/scripts"</p>
|
||||
|
||||
<p>Next is Log windows that contain any messages that come from scripts. Mainly calls to <code>core.log()</code> At bottom there buttons that can start or stop execution of selected scripts.</p>
|
||||
<p>Next is Log windows that contain any messages that come from scripts. Mainly calls to <code>core.log()</code> At bottom there is console that enable run simple script commands and
|
||||
buttons that can start or stop execution of selected scripts.</p>
|
||||
|
||||
<h4>core</h4>
|
||||
<p>There is global object called <b>core</b> that have these methods.</p>
|
||||
|
||||
@@ -51,6 +51,17 @@ na ktorej sa dajú nastaviť tri body.
|
||||
<li>stredný bod - pixeli s touto hodnotou budú zobrazené ako 50% šedá</li>
|
||||
<li>biely bod - pixeli nad touto hodnotou budú zobrazené ako biele</li>
|
||||
</ul>
|
||||
<p>Nasleduje 8 tlačidiel pre nastavenie zobrazenie obrázka:</p>
|
||||
<ul>
|
||||
<li><i>Prepojené kanály</i> prepína medzi nataihnutím jasových urovní pre každý RGB kanál zvlášť alebo jednotné pre všetky kanály.</li>
|
||||
<li><i>Automatické natiahnutie</i> automaticky nastavý čierny, šedý a biely bod pre optimálne zobrazenie..</li>
|
||||
<li><i>Resetuj funkciu prevodu na obrazovku</i> nastavý hodnoty čierneho, šedého a bieleho bodu na východzie hodnoty.</li>
|
||||
<li><i>Invertuj farby</i> invertuje zobrazené farby a zobrazý obrázok ako negatív.</li>
|
||||
<li><i>Falošné farby</i> pre zobrazenie čiernobielych obrázkov sa použije farebná paleta.</li>
|
||||
<li><i>Preved CFA na farbu</i> Demosaicing black and white image from CFA sensor to color one.</li>
|
||||
<li><i>Aplikuj automatické natiahnutie pri načítaní</i> pri zapnutí </li>
|
||||
<li><i>Vykresli equatoriálnu mriežku</i> zapína zobrazenie equatoriálnej mriežky. Je poitrebné aby súbor obsahoval WCS dáta.</li>
|
||||
</ul>
|
||||
<p>Prvé tlačidlo prepína prepojenie nastavenia čierneho, stretdného a bieleho bodu. Po prepnutí sa dá každý farebný kanál nastaviť
|
||||
samostatne.
|
||||
Nasleduje tlačidlo ktoré nastaví hodnoty čierneho a stredného bodu tak aby bol obrázok zobrazený optimálnym jasom.
|
||||
@@ -94,6 +105,34 @@ V nasledovnom príklade sa vyhľadajú súbory ktoré majú v mene súboru "Bias
|
||||
zástupný znak za hocijaký reťazec znakov aj žiadny. Znak _ je tiež zástupný znak zastupujúci práve jeden znak.
|
||||
Bez použitia zástupných znakov sa vyhľadá iba presný výskyt.</p>
|
||||
|
||||
<h3>Plate Solving</h3>
|
||||
<p>Tento modul umožnuje vyriešiť obrázok a určiť RA, DEC koordináty a aktualizovať FITS a XISF súbory s WCS dátami.
|
||||
<b>Profil</b> toto nastavuje rôzne parametre ovplivňujúce extrahovanie hviezd a hľadanie koordinátov.
|
||||
<b>Štartovný bod</b> program sa pokúsi automaticky určiť bod začiatku hľadania koordinátov pre zrýchlenie hľadania.
|
||||
Možete nechať jednu alebo obydve voľbi nezaškrtnuté kedy sa bude hľadať riešenie naslepo. Ak je pozícia alebo škála nesprávna hľadanie môže zlyhať.
|
||||
<b>Riešenie</b> táto časť obsahuje výsledné riešenie hľadania ako sú RA,DEC koordináty stredu obrázku, veľkosť zorného poľa, uhol natočenia v stupňoch,
|
||||
škála obrázku v arcsekundách na pixel, počet nájdených hviezd a veľkosť hviezd HFR a excentricita. Potom je tu ešte okno so záznamom z riešenia.
|
||||
</p>
|
||||
<p>Pod tým je tlačidlo pre nastavenie cesty k indexovým súborom a ich stiahnutie. Je možné buď stiahnuť indexové súbory alebo použiť už existujúce súbory.
|
||||
Tlačidlo Extrahovať nájde hviezdy a zobrazý ich počet veľkosť HFR a excentricitu. Na toto nie sú potrebné indexové súbory.
|
||||
Tlačidlo Vyriešiť sa pokúsi nájsť koordináty obrázka. Zrušiť preruší hľadanie riešenia. Aktualizovať FITS hlavičku zapíše najdené riešenie do súboru.</p>
|
||||
|
||||
<p>In settings dialog you can set path to index files which is by default custom internal one. It also try to locate commonly used path from other
|
||||
programs like KStars for astrometry.net index files.
|
||||
</p>
|
||||
|
||||
<h3>File Manager</h3>
|
||||
<p>
|
||||
This is simple double panel file manager. It can show columns with selected FITS keywords. Each panel have tabs where it easily switch between
|
||||
multiple directories. You can copy or move files and directories either inside one panel or between two panels by selecting and then dragging.
|
||||
By default files are copies. To move then press Shift key before start dragging. Double click on file will open it in main window if it is image
|
||||
or other file it will open default program that is associated with it this file type. You can also drag file to other programs like from default
|
||||
file explorer programs that are in system or from file explorer to this program.
|
||||
</p>
|
||||
<p>
|
||||
In menu you can select which FITS keywords will be showed. Temporarilly disable loading FITS header or copy file paths of selected files as text.
|
||||
</p>
|
||||
|
||||
<h3>Hromadné spracovanie</h3>
|
||||
|
||||
Tento modul umožnuje písanie skriptov v JavaScripte ktoré spracujú súbory obrázkov. Okno Hromadného spracovanie pozostáva z troch častí. Navrchu je zoznam vstupných súborov a adresárov.
|
||||
@@ -109,6 +148,12 @@ V skripte potom cez toto pole iteruje nasledovne.
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>Pod týmto zoznamom je výstupný adresár. Všetky relatívne cesty predané do metod ako sú copy(), move() alebo convert() budú relatívne voči tomuto adresáru.
|
||||
Ak je ako argument použitá absolútna cesta tak je tento vystupný adresár ignorovaný.</p>
|
||||
|
||||
<p>Nasleduje logovacie okno kde sú zapisováné všetký výpisy z behu scriptu. Hlavne volania z <code>core.log()</code> Na spodu je konzola kde je možné vkladať jednoduché príkazy a nakoniec ešte tlačítka
|
||||
ktoré spúštať alebo zastavovať vybraný skript.</p>
|
||||
|
||||
<h4>core</h4>
|
||||
V skripte je dostupný globálny objekt nazvaný <b>core</b> ktorý má nasledovné metódy.
|
||||
<ul>
|
||||
|
||||
+1
-1
Submodule libXISF updated: c6581e1122...2e74d94641
@@ -33,6 +33,7 @@
|
||||
<li>Color space aware</li>
|
||||
<li>Histogram</li>
|
||||
<li>Scripting</li>
|
||||
<li>Plate solving</li>
|
||||
</ul>
|
||||
</description>
|
||||
<categories>
|
||||
@@ -58,6 +59,25 @@
|
||||
</screenshots>
|
||||
<content_rating type="oars-1.1"/>
|
||||
<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">
|
||||
<description>
|
||||
<ul>
|
||||
<li>Draw equatorial grid and objects overlay</li>
|
||||
<li>File Manager</li>
|
||||
<li>Support for PCL:AstrometricSolution</li>
|
||||
<li>Script console</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="20250429" date="2025-04-29">
|
||||
<description>
|
||||
<ul>
|
||||
|
||||
@@ -113,12 +113,8 @@ BatchProcessing::BatchProcessing(Database *database, QWidget *parent) : QDialog(
|
||||
|
||||
_engine = new Script::ScriptEngine(_database, this);
|
||||
connect(_engine, &Script::ScriptEngine::newMessage, this, &BatchProcessing::newMessage);
|
||||
QStringList apiList;
|
||||
apiList << "core.log" << "core.mark" << "core.unmark" << "core.isMarked" << "core.getObjects" << "core.setMaxthread";
|
||||
apiList << "core.sync" << "core.getString" << "core.getInt" << "core.getFloat" << "core.question" << "core.plot";
|
||||
apiList << "fileName" << "absoluteFileName";
|
||||
|
||||
_completerModel = new QStringListModel(this);
|
||||
_completerModel->setStringList(apiList);
|
||||
_completer = new QCompleter(_completerModel, this);
|
||||
_ui->consoleLineEdit->setCompleter(_completer);
|
||||
connect(_ui->executeButton, &QPushButton::clicked, _ui->consoleLineEdit, &QLineEdit::returnPressed);
|
||||
@@ -128,13 +124,13 @@ BatchProcessing::BatchProcessing(Database *database, QWidget *parent) : QDialog(
|
||||
QString program = _ui->consoleLineEdit->text();
|
||||
QJSValue val = _engine->eval(program);
|
||||
_ui->consoleLineEdit->addLine();
|
||||
qDebug() << val.toString();
|
||||
//qDebug() << val.toString();
|
||||
}
|
||||
});
|
||||
|
||||
connect(_ui->consoleLineEdit, &QLineEdit::textEdited, [this](const QString &text){
|
||||
QStringList comp = _engine->complete(text);
|
||||
qDebug() << comp;
|
||||
//qDebug() << comp;
|
||||
_completerModel->setStringList(comp);
|
||||
});
|
||||
|
||||
|
||||
+15
-3
@@ -8,6 +8,7 @@
|
||||
#include <QMimeData>
|
||||
#include <QClipboard>
|
||||
#include <QThread>
|
||||
#include <QDirIterator>
|
||||
#include "loadimage.h"
|
||||
|
||||
class FileTimes
|
||||
@@ -678,10 +679,21 @@ void DirView::setDir(const QString &path)
|
||||
if(oldPath.left(ROOT_LEN) != path.left(ROOT_LEN))
|
||||
_dirFileSystemModel->setRootPath(path.left(ROOT_LEN));
|
||||
|
||||
_dirFileSystemModel->setDir(path);
|
||||
setRootIndex(_dirFileSystemModel->index(path, 0));
|
||||
QString newPath = path;
|
||||
if(!QFileInfo::exists(path))
|
||||
{
|
||||
QDir dir(path);
|
||||
do
|
||||
{
|
||||
dir.setPath(QDir::cleanPath(dir.filePath("..")));
|
||||
}while(!dir.exists() && !dir.isRoot());
|
||||
newPath = dir.path();
|
||||
}
|
||||
|
||||
_dirFileSystemModel->setDir(newPath);
|
||||
setRootIndex(_dirFileSystemModel->index(newPath, 0));
|
||||
clearSelection();
|
||||
if(oldPath != path)emit dirChanged(path);
|
||||
if(oldPath != newPath)emit dirChanged(newPath);
|
||||
}
|
||||
|
||||
QString DirView::dir() const
|
||||
|
||||
+5
-1
@@ -193,7 +193,11 @@ void ConvertRunable::run()
|
||||
QFileInfo info(m_outfile);
|
||||
info.dir().mkpath(".");
|
||||
|
||||
if(m_params.autostretch)
|
||||
if(m_params.stretch)
|
||||
{
|
||||
rawimage->applySTF(m_params.mtf);
|
||||
}
|
||||
else if(m_params.autostretch)
|
||||
{
|
||||
rawimage->calcStats();
|
||||
MTFParam mtfParam = rawimage->calcMTFParams();
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <QSemaphore>
|
||||
#include <QSize>
|
||||
#include "imageinfodata.h"
|
||||
#include "mtfparam.h"
|
||||
|
||||
class Image;
|
||||
|
||||
@@ -33,6 +34,8 @@ public:
|
||||
QSize resize;
|
||||
Qt::AspectRatioMode aspect = Qt::KeepAspectRatio;
|
||||
bool autostretch = false;
|
||||
bool stretch = false;
|
||||
MTFParam mtf;
|
||||
ConvertParams(){}
|
||||
ConvertParams(const QVariantMap &map);
|
||||
};
|
||||
|
||||
+14
-2
@@ -3,6 +3,7 @@
|
||||
#include <QSurfaceFormat>
|
||||
#include <QTranslator>
|
||||
#include <QCommandLineParser>
|
||||
#include <QSettings>
|
||||
#include <stdlib.h>
|
||||
#include "../thumbnailer/genthumbnail.h"
|
||||
|
||||
@@ -76,8 +77,19 @@ int main(int argc, char *argv[])
|
||||
|
||||
QTranslator translator;
|
||||
QTranslator translator2;
|
||||
if(translator.load(QLocale(), "tenmon", "_", ":/translations"))
|
||||
a.installTranslator(&translator);
|
||||
QSettings settings;
|
||||
QString lang = settings.value("settings/lang").toString();
|
||||
if(lang.isEmpty())
|
||||
{
|
||||
if(translator.load(QLocale(), "tenmon", "_", ":/translations"))
|
||||
a.installTranslator(&translator);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(translator.load("tenmon_" + lang, ":/translations"))
|
||||
a.installTranslator(&translator);
|
||||
}
|
||||
|
||||
if(translator2.load(QLocale(), "tenmon", "_", a.applicationDirPath()))
|
||||
a.installTranslator(&translator2);
|
||||
|
||||
|
||||
+27
-15
@@ -18,6 +18,7 @@
|
||||
#include <QThreadPool>
|
||||
#include <QStatusBar>
|
||||
#include <QImageReader>
|
||||
#include <QImageWriter>
|
||||
#include <QMimeDatabase>
|
||||
#include <QDesktopServices>
|
||||
#include <QJsonDocument>
|
||||
@@ -57,12 +58,18 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
|
||||
for(auto format : supportedFormats)
|
||||
{
|
||||
QMimeType mimeType = db.mimeTypeForName(format);
|
||||
_saveFilter.append(mimeType.filterString() + ";;");
|
||||
_openFilter.append("*.");
|
||||
_openFilter.append(mimeType.suffixes().join(" *."));
|
||||
_openFilter.append(" ");
|
||||
nameFilter.append(mimeType.suffixes());
|
||||
}
|
||||
auto supportedWrite = QImageWriter::supportedMimeTypes();
|
||||
for(auto format : supportedWrite)
|
||||
{
|
||||
QMimeType mimeType = db.mimeTypeForName(format);
|
||||
_saveFilter.append(mimeType.filterString() + ";;");
|
||||
}
|
||||
|
||||
_openFilter.append("*.fit *.fits *.fts *.fz *.xisf *.cr2 *.cr3 *.nef *.dng)");
|
||||
_openFilter.append(tr(";;All files (*)"));
|
||||
nameFilter.append({"fit", "fits", "fts", "fz", "xisf", "cr2", "cr3", "nef", "dng"});
|
||||
@@ -613,12 +620,16 @@ void MainWindow::reindex()
|
||||
void MainWindow::saveAs()
|
||||
{
|
||||
QString selectedFilter;
|
||||
ImagePtr ptr = m_ringList->currentImage();
|
||||
if(!ptr)return;
|
||||
|
||||
QFileInfo srcFile(ptr->name());
|
||||
QString file = QFileDialog::getSaveFileName(this,
|
||||
tr("Save as"),
|
||||
_lastDir,
|
||||
_lastDir + "/" + srcFile.baseName(),
|
||||
_saveFilter,
|
||||
&selectedFilter);
|
||||
auto filterToFormat = [](const QString &file, const QString &filter) -> const char*
|
||||
auto filterToFormat = [](const QString &file, const QString &filter) -> const QString
|
||||
{
|
||||
QString suffix = QFileInfo(file).suffix();
|
||||
if(!suffix.compare("jpg", Qt::CaseInsensitive) || !suffix.compare("jpeg", Qt::CaseInsensitive))return "jpeg";
|
||||
@@ -628,30 +639,31 @@ void MainWindow::saveAs()
|
||||
if(filter.contains("png"))return "png";
|
||||
if(filter.contains("fits"))return "fits";
|
||||
if(filter.contains("xisf"))return "xisf";
|
||||
QRegularExpression suf("\\(\\*\\.([a-zA-Z]+).*\\)");
|
||||
auto match = suf.match(filter);
|
||||
if(match.hasMatch())
|
||||
return match.captured(1);
|
||||
return "jpeg";
|
||||
};
|
||||
|
||||
if(!file.isEmpty())
|
||||
{
|
||||
auto button = QMessageBox::question(this, tr("Apply stretch?"), tr("Apply current stretch function to image?"));
|
||||
|
||||
QString format = filterToFormat(file, selectedFilter);
|
||||
|
||||
if(format == "fits" || format == "xisf")
|
||||
{
|
||||
convert(file, format);
|
||||
}
|
||||
else
|
||||
{
|
||||
QImage img = m_image->renderToImage();
|
||||
if(!img.isNull())
|
||||
img.save(file, filterToFormat(file, selectedFilter));
|
||||
}
|
||||
convert(file, format, button == QMessageBox::Yes);
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
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()
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ public slots:
|
||||
void indexDir(const QString &dir);
|
||||
void reindex();
|
||||
void saveAs();
|
||||
void convert(const QString &outfile, const QString &format);
|
||||
void convert(const QString &outfile, const QString &format, bool stretch);
|
||||
void markImage();
|
||||
void unmarkImage();
|
||||
void markAndNext();
|
||||
|
||||
+22
-6
@@ -1195,12 +1195,28 @@ void RawImage::applySTF(const MTFParam &mtfParams)
|
||||
for(size_t i = 0; i < len; i++)
|
||||
{
|
||||
float x;
|
||||
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[0]) / (mtfParams.whitePoint[0] - mtfParams.blackPoint[0]);
|
||||
x = std::clamp(x, 0.0f, 1.0f);
|
||||
x = ((mtfParams.midPoint[0] - 1.0f) * x) / ((2.0f * mtfParams.midPoint[0] - 1.0f) * x - mtfParams.midPoint[0]);
|
||||
src[i] = x * s;
|
||||
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;
|
||||
else x = src[i] * unit.first + unit.second;
|
||||
x = (x - mtfParams.blackPoint[0]) / (mtfParams.whitePoint[0] - mtfParams.blackPoint[0]);
|
||||
x = std::clamp(x, 0.0f, 1.0f);
|
||||
x = ((mtfParams.midPoint[0] - 1.0f) * x) / ((2.0f * mtfParams.midPoint[0] - 1.0f) * x - mtfParams.midPoint[0]);
|
||||
src[i] = x * s;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+29
-1
@@ -129,11 +129,30 @@ SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent)
|
||||
delete item;
|
||||
});
|
||||
|
||||
m_lang = new QComboBox(this);
|
||||
m_lang->addItems({"English", "Français", "Slovenčina", "Português"});
|
||||
QString lang;
|
||||
switch(QLocale().language())
|
||||
{
|
||||
default:
|
||||
case QLocale::English: lang = "en"; break;
|
||||
case QLocale::French: lang = "fr"; break;
|
||||
case QLocale::Slovak: lang = "sk"; break;
|
||||
case QLocale::Portuguese: lang = "pt_BR"; break;
|
||||
}
|
||||
|
||||
lang = settings.value("settings/lang", lang).toString();
|
||||
if(lang == "en")m_lang->setCurrentIndex(0);
|
||||
else if(lang == "fr")m_lang->setCurrentIndex(1);
|
||||
else if(lang == "sk")m_lang->setCurrentIndex(2);
|
||||
else if(lang == "pt_BR")m_lang->setCurrentIndex(3);
|
||||
|
||||
layout->addRow(tr("Image preload count"), m_preloadImages);
|
||||
layout->addRow(tr("Thumbnails size"), m_thumSize);
|
||||
layout->addRow(tr("Saturation"), m_saturation);
|
||||
layout->addRow(tr("Slideshow interval"), m_slideShowTime);
|
||||
layout->addRow(tr("Image interpolation"), m_filtering);
|
||||
layout->addRow(tr("Language"), m_lang);
|
||||
layout->addRow(m_qualityThumbnail);
|
||||
layout->addRow(m_useNativeDialog);
|
||||
layout->addRow(m_bestFit);
|
||||
@@ -150,7 +169,6 @@ SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent)
|
||||
#endif
|
||||
//layout->addRow(new QLabel(tr("Changes in settings will take effect after program restart.")));
|
||||
|
||||
|
||||
QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
|
||||
buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||
connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
||||
@@ -237,4 +255,14 @@ void SettingsDialog::saveSettings()
|
||||
}
|
||||
settings.setValue("settings/headerhighlightkeywords", headerHighlight.keys());
|
||||
settings.setValue("settings/headerhighlightcolors", colors);
|
||||
QString lang;
|
||||
int langIdx = m_lang->currentIndex();
|
||||
switch(langIdx)
|
||||
{
|
||||
case 0: lang = "en"; break;
|
||||
case 1: lang = "fr"; break;
|
||||
case 2: lang = "sk"; break;
|
||||
case 3: lang = "pt_BR"; break;
|
||||
}
|
||||
settings.setValue("settings/lang", lang);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ private:
|
||||
QListWidget *m_headerHighlight;
|
||||
QColor m_color = Qt::yellow;
|
||||
QLineEdit *m_keyword;
|
||||
QComboBox *m_lang;
|
||||
};
|
||||
|
||||
#endif // SETTINGSDIALOG_H
|
||||
|
||||
@@ -104,6 +104,11 @@ StretchToolbar::~StretchToolbar()
|
||||
settings.setValue("stretchtoolbar/autostretch", m_autoStretchOnLoad->isChecked());
|
||||
}
|
||||
|
||||
const MTFParam &StretchToolbar::params() const
|
||||
{
|
||||
return m_mtfParam;
|
||||
}
|
||||
|
||||
void StretchToolbar::stretchImage(Image *img)
|
||||
{
|
||||
if(img && img->rawImage())
|
||||
|
||||
@@ -22,6 +22,7 @@ class StretchToolbar : public QToolBar
|
||||
public:
|
||||
explicit StretchToolbar(QWidget *parent = nullptr);
|
||||
~StretchToolbar();
|
||||
const MTFParam& params() const;
|
||||
public slots:
|
||||
void stretchImage(Image *img);
|
||||
void resetMTF();
|
||||
|
||||
Reference in New Issue
Block a user