Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| af5aed7ef8 | |||
| 8f5249b142 | |||
| a7dc942c62 | |||
| 1a1399434b | |||
| be567841bf | |||
| 62d2671112 | |||
| 1f8923512e | |||
| 455c3b2d64 | |||
| 4fe546f0e5 | |||
| 95c6fc5343 | |||
| 2bc54ea0cc | |||
| be6e472081 |
+15
-7
@@ -35,12 +35,22 @@ set(TENMON_SRC
|
||||
mainwindow.cpp
|
||||
markedfiles.cpp
|
||||
rawimage.cpp
|
||||
settingsdialog.cpp
|
||||
starfit.cpp
|
||||
statusbar.cpp
|
||||
stfslider.cpp
|
||||
stretchtoolbar.cpp
|
||||
)
|
||||
|
||||
option(COLOR_MANAGMENT "Enable sRGB framebuffer support for gamma correct images and color profiles support" ON)
|
||||
if(${Qt5Core_VERSION_STRING} VERSION_LESS "5.14")
|
||||
set(COLOR_MANAGMENT OFF)
|
||||
endif(${Qt5Core_VERSION_STRING} VERSION_LESS "5.14")
|
||||
|
||||
if(COLOR_MANAGMENT)
|
||||
add_compile_definitions("COLOR_MANAGMENT")
|
||||
endif(COLOR_MANAGMENT)
|
||||
|
||||
qt5_add_resources(TENMON_SRC resources.qrc)
|
||||
if(WIN32)
|
||||
list(APPEND TENMON_SRC icon.rc)
|
||||
@@ -82,18 +92,16 @@ endif()
|
||||
|
||||
install(TARGETS tenmon BUNDLE DESTINATION .)
|
||||
if(UNIX AND NOT APPLE)
|
||||
include(GNUInstallDirs)
|
||||
find_program(XDG-DESKTOP-MENU_EXECUTABLE xdg-desktop-menu)
|
||||
if(XDG-DESKTOP-MENU_EXECUTABLE)
|
||||
install(SCRIPT install.cmake)
|
||||
else()
|
||||
if(DEFINED ENV{FLATPAK_DEST})
|
||||
install(FILES org.nou.tenmon.desktop DESTINATION "$ENV{FLATPAK_DEST}/share/applications")
|
||||
install(FILES org.nou.tenmon.png DESTINATION "$ENV{FLATPAK_DEST}/share/icons/hicolor/32x32/apps")
|
||||
else()
|
||||
install(FILES org.nou.tenmon.desktop DESTINATION "/usr/share/applications")
|
||||
install(FILES org.nou.tenmon.png DESTINATION "/usr/share/icons/hicolor/32x32/apps")
|
||||
endif()
|
||||
install(FILES space.nouspiro.tenmon.desktop DESTINATION "${CMAKE_INSTALL_DATADIR}/applications")
|
||||
install(FILES space.nouspiro.tenmon.png DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/64x64/apps")
|
||||
install(FILES space.nouspiro.tenmon_128.png DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/128x128/apps" RENAME space.nouspiro.tenmon.png)
|
||||
endif()
|
||||
install(FILES space.nouspiro.tenmon.metainfo.xml DESTINATION "${CMAKE_INSTALL_DATADIR}/metainfo")
|
||||
endif(UNIX AND NOT APPLE)
|
||||
|
||||
option(RELEASE_BUILD "Release build" OFF)
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
<table><tr>
|
||||
<td style="padding-right:10px"><img src=":/org.nou.tenmon.png"></td>
|
||||
<td style="padding-right:10px"><img src=":/space.nouspiro.tenmon.png"></td>
|
||||
<td><h3>Tenmon</h3>
|
||||
Tenmon is FITS/XISF image viewer and converter. It also index FITS keywords.<br>
|
||||
v@GITVERSION@ Copyright © 2022 Dušan Poizl<br><br>
|
||||
|
||||
+2
-1
@@ -7,7 +7,7 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
const int DEFAULT_WIDTH = 2;
|
||||
int DEFAULT_WIDTH = 2;
|
||||
|
||||
Image::Image(const QString name, int number, ImageRingList *ringList) :
|
||||
m_loading(false),
|
||||
@@ -260,6 +260,7 @@ void ImageRingList::loadThumbnails()
|
||||
void ImageRingList::stopLoading()
|
||||
{
|
||||
m_thumbPool->clear();
|
||||
m_thumbPool->waitForDone();
|
||||
}
|
||||
|
||||
int ImageRingList::imageCount() const
|
||||
|
||||
+58
-2
@@ -11,6 +11,7 @@
|
||||
#include <QCoreApplication>
|
||||
#include <QPainter>
|
||||
#include <QFileInfo>
|
||||
#include <cmath>
|
||||
|
||||
struct RawImageType
|
||||
{
|
||||
@@ -24,13 +25,20 @@ const RawImageType rawImageTypes[] = {
|
||||
{QOpenGLTexture::Red, QOpenGLTexture::R8_UNorm, QOpenGLTexture::UInt8, true},
|
||||
{QOpenGLTexture::Red, QOpenGLTexture::R16_UNorm, QOpenGLTexture::UInt16, true},
|
||||
{QOpenGLTexture::Red, QOpenGLTexture::R32F, QOpenGLTexture::Float32, true},
|
||||
#ifdef COLOR_MANAGMENT
|
||||
{QOpenGLTexture::RGB, QOpenGLTexture::SRGB8, QOpenGLTexture::UInt8, false},
|
||||
{QOpenGLTexture::RGBA,QOpenGLTexture::SRGB8, QOpenGLTexture::UInt8, false},
|
||||
#else
|
||||
{QOpenGLTexture::RGB, QOpenGLTexture::RGB8_UNorm, QOpenGLTexture::UInt8, false},
|
||||
{QOpenGLTexture::RGBA,QOpenGLTexture::RGB8_UNorm, QOpenGLTexture::UInt8, false},
|
||||
#endif
|
||||
{QOpenGLTexture::RGB, QOpenGLTexture::RGB16_UNorm, QOpenGLTexture::UInt16, false},
|
||||
{QOpenGLTexture::RGBA, QOpenGLTexture::RGB16_UNorm, QOpenGLTexture::UInt16, false},
|
||||
{QOpenGLTexture::RGB, QOpenGLTexture::RGB32F, QOpenGLTexture::Float32, false}
|
||||
};
|
||||
|
||||
static bool MANUAL_MIPMAP_GEN = false;
|
||||
|
||||
void setScrollRange(QScrollBar *scrollBar, int newRange)
|
||||
{
|
||||
int page = scrollBar->pageStep();
|
||||
@@ -79,6 +87,9 @@ ImageWidget::ImageWidget(Database *database, QWidget *parent) : QOpenGLWidget(pa
|
||||
});
|
||||
|
||||
setMouseTracking(true);
|
||||
#ifdef COLOR_MANAGMENT
|
||||
setTextureFormat(GL_SRGB8_ALPHA8);
|
||||
#endif
|
||||
}
|
||||
|
||||
ImageWidget::~ImageWidget()
|
||||
@@ -97,8 +108,11 @@ void ImageWidget::setImage(std::shared_ptr<RawImage> image, int index)
|
||||
m_currentImg = index;
|
||||
|
||||
const RawImageType &rawImageType = rawImageTypes[image->type()];
|
||||
m_srgb = rawImageType.textureFormat == QOpenGLTexture::SRGB8 || rawImageType.textureFormat == QOpenGLTexture::SRGB8_Alpha8;
|
||||
m_bwImg = rawImageType.bw;
|
||||
|
||||
m_image->destroy();
|
||||
m_image->setAutoMipMapGenerationEnabled(false);
|
||||
m_image->setFormat(rawImageType.textureFormat);
|
||||
m_image->setSize(image->width(), image->height());
|
||||
m_image->setMipLevels([&](){ int c = 0; int s = std::min(m_imgWidth, m_imgHeight); while(s>>=1)c++; return c; }());
|
||||
@@ -107,9 +121,42 @@ void ImageWidget::setImage(std::shared_ptr<RawImage> image, int index)
|
||||
m_image->setWrapMode(QOpenGLTexture::ClampToEdge);
|
||||
m_image->setBorderColor(0, 0, 0, 0);
|
||||
m_image->setData(0, rawImageType.pixelFormat, rawImageType.dataType, (const void*)image->data(), m_transferOptions.get());
|
||||
|
||||
auto sRGB_linear = [](cv::Point3f &pixel, const int *pos)
|
||||
{
|
||||
pixel.x = pixel.x <= 0.04045f ? pixel.x / 12.92f : std::pow((pixel.x + 0.055) / 1.055f, 2.4f);
|
||||
pixel.y = pixel.y <= 0.04045f ? pixel.y / 12.92f : std::pow((pixel.y + 0.055) / 1.055f, 2.4f);
|
||||
pixel.z = pixel.z <= 0.04045f ? pixel.z / 12.92f : std::pow((pixel.z + 0.055) / 1.055f, 2.4f);
|
||||
};
|
||||
|
||||
auto linear_sRGB = [](cv::Point3f &pixel, const int *pos)
|
||||
{
|
||||
pixel.x = pixel.x <= 0.0031308f ? pixel.x * 12.92f : 1.055f * std::pow(pixel.x , 1/2.4f) - 0.055f;
|
||||
pixel.y = pixel.y <= 0.0031308f ? pixel.y * 12.92f : 1.055f * std::pow(pixel.y , 1/2.4f) - 0.055f;
|
||||
pixel.z = pixel.z <= 0.0031308f ? pixel.z * 12.92f : 1.055f * std::pow(pixel.z , 1/2.4f) - 0.055f;
|
||||
};
|
||||
|
||||
//AMD OpenGL driver on Windows doesn't generate mipmaps for sRGB textures correctly
|
||||
if(m_srgb && MANUAL_MIPMAP_GEN)
|
||||
{
|
||||
cv::Mat img = image->mat();
|
||||
img.convertTo(img, CV_32FC3, 1/255.0);
|
||||
img.forEach<cv::Point3f>(sRGB_linear);
|
||||
cv::Size size(img.cols, img.rows);
|
||||
for(int i=1; i<m_image->mipLevels(); i++)
|
||||
{
|
||||
cv::Mat mip;
|
||||
size /= 2;
|
||||
cv::resize(img, mip, size);
|
||||
mip.copyTo(img);
|
||||
mip.forEach<cv::Point3f>(linear_sRGB);
|
||||
mip.convertTo(mip, CV_8UC3, 255);
|
||||
m_image->setData(i, rawImageType.pixelFormat, rawImageType.dataType, (const void*)mip.ptr(), m_transferOptions.get());
|
||||
}
|
||||
}
|
||||
else m_image->generateMipMaps();
|
||||
|
||||
m_image->setLevelOfDetailRange(m_superpixel ? 1 : 0, m_image->mipMaxLevel());
|
||||
m_image->generateMipMaps();
|
||||
m_bwImg = rawImageType.bw;
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -249,6 +296,7 @@ void ImageWidget::paintGL()
|
||||
}
|
||||
m_thumbnailProgram->bind();
|
||||
f->glUniform3i(m_thumbnailProgram->uniformLocation("viewport_row"), width(), height(), width()/THUMB_SIZE_BORDER);
|
||||
f->glUniform3i(m_thumbnailProgram->uniformLocation("thumb_size"), THUMB_SIZE_BORDER/2, THUMB_SIZE_BORDER, THUMB_SIZE_BORDER_Y);
|
||||
m_thumbnailProgram->setUniformValue("mtf_param", m_low, m_mid, m_high);
|
||||
m_thumbnailProgram->setUniformValue("invert", m_invert);
|
||||
m_thumbnailProgram->setUniformValue("offset", 0, m_dy);
|
||||
@@ -287,6 +335,9 @@ void ImageWidget::paintGL()
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef COLOR_MANAGMENT
|
||||
if(m_srgb)f->glEnable(GL_FRAMEBUFFER_SRGB);
|
||||
#endif
|
||||
m_vao->bind();
|
||||
m_image->bind(0);
|
||||
m_program->bind();
|
||||
@@ -297,6 +348,9 @@ void ImageWidget::paintGL()
|
||||
m_program->setUniformValue("bw", m_bwImg);
|
||||
m_program->setUniformValue("invert", m_invert);
|
||||
f->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
#ifdef COLOR_MANAGMENT
|
||||
if(m_srgb)f->glDisable(GL_FRAMEBUFFER_SRGB);
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
@@ -335,6 +389,8 @@ void ImageWidget::initializeGL()
|
||||
qDebug() << (char*)f->glGetString(GL_RENDERER);
|
||||
qDebug() << (char*)f->glGetString(GL_VERSION);
|
||||
|
||||
MANUAL_MIPMAP_GEN = QString((const char*)f->glGetString(GL_VENDOR)).startsWith("ATI Technologies Inc", Qt::CaseInsensitive);
|
||||
|
||||
qDebug() << context()->format();
|
||||
|
||||
// each vertex is x,y 2D position and s,t texture coordinates
|
||||
|
||||
@@ -57,6 +57,7 @@ class ImageWidget : public QOpenGLWidget
|
||||
bool m_showThumbnails;
|
||||
bool m_selecting;
|
||||
bool m_sizesDirty;
|
||||
bool m_srgb;
|
||||
int m_thumbnailCount;
|
||||
QVector<ImageThumb> m_thumnails;
|
||||
Database *m_database;
|
||||
|
||||
+3
-2
@@ -1,4 +1,5 @@
|
||||
find_program(XDG-DESKTOP-MENU_EXECUTABLE xdg-desktop-menu)
|
||||
find_program(XDG-ICON-RESOURCE_EXECUTABLE xdg-icon-resource)
|
||||
execute_process(COMMAND ${XDG-DESKTOP-MENU_EXECUTABLE} install --novendor org.nou.tenmon.desktop WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
|
||||
execute_process(COMMAND ${XDG-ICON-RESOURCE_EXECUTABLE} install --novendor --size 32 org.nou.tenmon.png org.nou.tenmon WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
|
||||
execute_process(COMMAND ${XDG-DESKTOP-MENU_EXECUTABLE} install --novendor space.nouspiro.tenmon.desktop WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
|
||||
execute_process(COMMAND ${XDG-ICON-RESOURCE_EXECUTABLE} install --novendor --size 64 space.nouspiro.tenmon.png space.nouspiro.tenmon WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
|
||||
execute_process(COMMAND ${XDG-ICON-RESOURCE_EXECUTABLE} install --novendor --size 128 space.nouspiro.tenmon_128.png space.nouspiro.tenmon WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
+37
-11
@@ -14,6 +14,11 @@
|
||||
#include "starfit.h"
|
||||
#include "wcslib/wcshdr.h"
|
||||
|
||||
#ifdef COLOR_MANAGMENT
|
||||
#include <QColorSpace>
|
||||
static pcl::ICCProfile sRgbIccProfile((void*)QColorSpace(QColorSpace::SRgb).iccProfile().data());
|
||||
#endif
|
||||
|
||||
LoadRunable::LoadRunable(const QString &file, Image *receiver, AnalyzeLevel level, bool thumbnail) :
|
||||
m_file(file),
|
||||
m_receiver(receiver),
|
||||
@@ -83,17 +88,17 @@ bool loadRAW(const QString path, ImageInfoData &info, RawImage **image)
|
||||
if(!image)
|
||||
return false;
|
||||
|
||||
LibRaw raw;
|
||||
raw.open_file(path.toLocal8Bit().data());
|
||||
raw.imgdata.params.half_size = true;
|
||||
raw.imgdata.params.use_camera_wb = true;
|
||||
raw.imgdata.params.user_flip = 0;
|
||||
if(raw.unpack())
|
||||
std::unique_ptr<LibRaw> raw = std::make_unique<LibRaw>();
|
||||
raw->open_file(path.toLocal8Bit().data());
|
||||
raw->imgdata.params.half_size = true;
|
||||
raw->imgdata.params.use_camera_wb = true;
|
||||
raw->imgdata.params.user_flip = 0;
|
||||
if(raw->unpack())
|
||||
return false;
|
||||
|
||||
if(image)
|
||||
{
|
||||
libraw_rawdata_t rawdata = raw.imgdata.rawdata;
|
||||
libraw_rawdata_t rawdata = raw->imgdata.rawdata;
|
||||
size_t size = rawdata.sizes.width*rawdata.sizes.height;
|
||||
|
||||
std::vector<uint16_t> out;
|
||||
@@ -115,14 +120,14 @@ bool loadRAW(const QString path, ImageInfoData &info, RawImage **image)
|
||||
memcpy((*image)->data(), &out[0], sizeof(uint16_t)*d);
|
||||
}
|
||||
|
||||
QString shutterSpeed = QString::number(raw.imgdata.other.shutter);
|
||||
if(raw.imgdata.other.shutter < 1)
|
||||
QString shutterSpeed = QString::number(raw->imgdata.other.shutter);
|
||||
if(raw->imgdata.other.shutter < 1)
|
||||
{
|
||||
shutterSpeed = QString("1/%1s").arg(1.0f/raw.imgdata.other.shutter);
|
||||
shutterSpeed = QString("1/%1s").arg(1.0f/raw->imgdata.other.shutter);
|
||||
}
|
||||
//info.append(StringPair(QObject::tr("Width"), QString::number(rawImg->width)));
|
||||
//info.append(StringPair(QObject::tr("Height"), QString::number(rawImg->height)));
|
||||
info.info.append({QObject::tr("ISO"), QString::number(raw.imgdata.other.iso_speed)});
|
||||
info.info.append({QObject::tr("ISO"), QString::number(raw->imgdata.other.iso_speed)});
|
||||
info.info.append({QObject::tr("Shutter speed"), shutterSpeed});
|
||||
#if LIBRAW_MINOR_VERSION>=19
|
||||
// info.append(StringPair(QObject::tr("Camera temperature"), QString::number(raw.imgdata.other.CameraTemperature)));
|
||||
@@ -281,11 +286,26 @@ bool loadFITS(const QString path, ImageInfoData &info, RawImage **image)
|
||||
return true;
|
||||
}
|
||||
|
||||
#include "pcl/ICCProfileTransformation.h"
|
||||
|
||||
template<typename T, typename PCLtype, int CVtype>
|
||||
bool loadPCLImage(pcl::XISFReader &xisf, RawImage **image)
|
||||
{
|
||||
PCLtype pclImage;
|
||||
xisf.ReadImage(pclImage);
|
||||
pclImage.Status().DisableInitialization();
|
||||
|
||||
#ifdef COLOR_MANAGMENT
|
||||
pcl::ICCProfile iccProfile = xisf.ReadICCProfile();
|
||||
if(iccProfile.IsProfile())
|
||||
{
|
||||
pcl::ICCProfileTransformation iccTran;
|
||||
iccTran.DisableParallelProcessing();
|
||||
iccTran.Add(iccProfile);
|
||||
iccTran.Add(sRgbIccProfile);
|
||||
iccTran >> pclImage;
|
||||
}
|
||||
#endif
|
||||
|
||||
int numChannels = pclImage.NumberOfChannels();
|
||||
cv::Mat cvImg[numChannels];
|
||||
@@ -315,6 +335,7 @@ bool loadXISF(const QString &path, ImageInfoData &info, RawImage **image)
|
||||
{
|
||||
try
|
||||
{
|
||||
pcl::XISF::EnsurePTLUTInitialized();
|
||||
pcl::String pclPath = path.utf16();
|
||||
pcl::XISFReader xisf;
|
||||
xisf.Open(pclPath);
|
||||
@@ -384,6 +405,11 @@ void LoadRunable::run()
|
||||
else
|
||||
{
|
||||
QImage img(m_file);
|
||||
#ifdef COLOR_MANAGMENT
|
||||
if(img.colorSpace().isValid())
|
||||
img.convertToColorSpace(QColorSpace::SRgb);
|
||||
#endif
|
||||
|
||||
ExifData *exif = exif_data_new_from_file(m_file.toLocal8Bit().constData());
|
||||
info.info.append({QObject::tr("Width"), QString::number(img.width())});
|
||||
info.info.append({QObject::tr("Height"), QString::number(img.height())});
|
||||
|
||||
@@ -15,12 +15,15 @@ int main(int argc, char *argv[])
|
||||
format.setMinorVersion(3);
|
||||
format.setOption(QSurfaceFormat::DebugContext);
|
||||
format.setProfile(QSurfaceFormat::OpenGLContextProfile::CoreProfile);
|
||||
#ifdef COLOR_MANAGMENT
|
||||
format.setColorSpace(QSurfaceFormat::sRGBColorSpace);
|
||||
#endif
|
||||
QSurfaceFormat::setDefaultFormat(format);
|
||||
|
||||
QApplication a(argc, argv);
|
||||
a.setOrganizationName("nou");
|
||||
a.setApplicationName("Tenmon");
|
||||
a.setWindowIcon(QIcon(":/org.nou.tenmon.png"));
|
||||
a.setWindowIcon(QIcon(":/space.nouspiro.tenmon.png"));
|
||||
|
||||
QTranslator translator;
|
||||
QTranslator translator2;
|
||||
|
||||
+14
-1
@@ -20,6 +20,7 @@
|
||||
#include "markedfiles.h"
|
||||
#include "about.h"
|
||||
#include "statusbar.h"
|
||||
#include "settingsdialog.h"
|
||||
|
||||
#ifdef __linux__
|
||||
#include <sys/ioctl.h>
|
||||
@@ -34,6 +35,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
|
||||
qRegisterMetaType<ImageInfoData>("ImageInfoData");
|
||||
qRegisterMetaType<RawImage*>("RawImage");
|
||||
|
||||
SettingsDialog::loadSettings();
|
||||
|
||||
m_info = new ImageInfo(this);
|
||||
QDockWidget *infoDock = new QDockWidget(tr("Image info"), this);
|
||||
infoDock->setWidget(m_info);
|
||||
@@ -117,6 +120,10 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
|
||||
exitAction->setShortcut(QKeySequence::Quit);
|
||||
menuBar()->addMenu(fileMenu);
|
||||
|
||||
QMenu *editMenu = new QMenu(tr("Edit"), this);
|
||||
editMenu->addAction(tr("Settings"), this, &MainWindow::showSettingsDialog);
|
||||
menuBar()->addMenu(editMenu);
|
||||
|
||||
QMenu *viewMenu = new QMenu(tr("View"), this);
|
||||
viewMenu->addAction(tr("Zoom In"), m_imageGL, SLOT(zoomIn()), QKeySequence::ZoomIn);
|
||||
viewMenu->addAction(tr("Zoom Out"), m_imageGL, SLOT(zoomOut()), QKeySequence::ZoomOut);
|
||||
@@ -533,10 +540,16 @@ void MainWindow::starFinder(bool findStars)
|
||||
|
||||
void MainWindow::showMarkFilesDialog()
|
||||
{
|
||||
MarkedFiles markedFiles;
|
||||
MarkedFiles markedFiles(this);
|
||||
markedFiles.exec();
|
||||
}
|
||||
|
||||
void MainWindow::showSettingsDialog()
|
||||
{
|
||||
SettingsDialog settingsDialog(this);
|
||||
settingsDialog.exec();
|
||||
}
|
||||
|
||||
void MainWindow::updateWindowTitle()
|
||||
{
|
||||
ImagePtr ptr = m_ringList->currentImage();
|
||||
|
||||
@@ -63,6 +63,7 @@ protected slots:
|
||||
void peakFinder(bool findPeaks);
|
||||
void starFinder(bool findStars);
|
||||
void showMarkFilesDialog();
|
||||
void showSettingsDialog();
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
#include "rawimage.h"
|
||||
|
||||
int THUMB_SIZE = 128;
|
||||
int THUMB_SIZE_BORDER = 138;
|
||||
int THUMB_SIZE_BORDER_Y = 158;
|
||||
|
||||
RawImage::ImgType CV2Type(int cvtype)
|
||||
{
|
||||
switch (cvtype)
|
||||
|
||||
+3
-3
@@ -10,9 +10,9 @@
|
||||
#include <QImage>
|
||||
#include <QVector3D>
|
||||
|
||||
const int THUMB_SIZE = 128;
|
||||
const int THUMB_SIZE_BORDER = 138;
|
||||
const int THUMB_SIZE_BORDER_Y = 158;
|
||||
extern int THUMB_SIZE;
|
||||
extern int THUMB_SIZE_BORDER;
|
||||
extern int THUMB_SIZE_BORDER_Y;
|
||||
|
||||
class Peak
|
||||
{
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
<file>invert.png</file>
|
||||
<file>nuke.png</file>
|
||||
<file>bayer.png</file>
|
||||
<file>org.nou.tenmon.png</file>
|
||||
<file>space.nouspiro.tenmon.png</file>
|
||||
<file>nuke_a.png</file>
|
||||
<file>about/tenmon</file>
|
||||
<file>about/pcl</file>
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
#include "settingsdialog.h"
|
||||
#include <QFormLayout>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QLabel>
|
||||
#include <QSettings>
|
||||
#include "rawimage.h"
|
||||
|
||||
extern int DEFAULT_WIDTH;
|
||||
|
||||
class EvenNumber : public QSpinBox
|
||||
{
|
||||
public:
|
||||
explicit EvenNumber(QWidget *parent) : QSpinBox(parent){}
|
||||
protected:
|
||||
QValidator::State validate(QString &text, int &) const
|
||||
{
|
||||
bool ok;
|
||||
int val = text.toInt(&ok);
|
||||
if(ok && (val & 1) == 0)return QValidator::Acceptable;
|
||||
if(ok)return QValidator::Intermediate;
|
||||
return QValidator::Invalid;
|
||||
}
|
||||
void fixup(QString &input) const
|
||||
{
|
||||
bool ok;
|
||||
int val = input.toInt(&ok);
|
||||
val -= val & 1;
|
||||
input = QString::number(val);
|
||||
}
|
||||
};
|
||||
|
||||
SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent)
|
||||
{
|
||||
QFormLayout *layout = new QFormLayout(this);
|
||||
setWindowTitle(tr("Settings"));
|
||||
|
||||
QSettings settings;
|
||||
|
||||
m_preloadImages = new QSpinBox(this);
|
||||
m_preloadImages->setRange(0, 8);
|
||||
m_preloadImages->setValue(settings.value("settings/preloadimagecount", DEFAULT_WIDTH).toInt());
|
||||
m_preloadImages->setToolTip(tr("How many images are preloaded before and after current image."));
|
||||
|
||||
m_thumSize = new EvenNumber(this);
|
||||
m_thumSize->setRange(64, 512);
|
||||
m_thumSize->setSingleStep(2);
|
||||
m_thumSize->setValue(settings.value("settings/thumnailsize", THUMB_SIZE).toInt());
|
||||
m_thumSize->setToolTip(tr("Thumbnail size in pixels"));
|
||||
|
||||
layout->addRow(tr("Image preload count"), m_preloadImages);
|
||||
layout->addRow(tr("Thumbnails size"), m_thumSize);
|
||||
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);
|
||||
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||
connect(this, &QDialog::accepted, this, &SettingsDialog::saveSettings);
|
||||
|
||||
layout->addRow(buttonBox);
|
||||
}
|
||||
|
||||
void SettingsDialog::loadSettings()
|
||||
{
|
||||
QSettings settings;
|
||||
THUMB_SIZE = settings.value("settings/thumbnailsize", THUMB_SIZE).toInt();
|
||||
THUMB_SIZE_BORDER = THUMB_SIZE + 10;
|
||||
THUMB_SIZE_BORDER_Y = THUMB_SIZE + 30;
|
||||
DEFAULT_WIDTH = settings.value("settings/preloadimagecount", DEFAULT_WIDTH).toInt();
|
||||
}
|
||||
|
||||
void SettingsDialog::saveSettings()
|
||||
{
|
||||
QSettings settings;
|
||||
settings.setValue("settings/thumbnailsize", m_thumSize->value());
|
||||
settings.setValue("settings/preloadimagecount", m_preloadImages->value());
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef SETTINGSDIALOG_H
|
||||
#define SETTINGSDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QSpinBox>
|
||||
|
||||
class SettingsDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SettingsDialog(QWidget *parent = nullptr);
|
||||
static void loadSettings();
|
||||
private:
|
||||
void saveSettings();
|
||||
|
||||
QSpinBox *m_preloadImages;
|
||||
QSpinBox *m_thumSize;
|
||||
};
|
||||
|
||||
#endif // SETTINGSDIALOG_H
|
||||
+3
-2
@@ -7,13 +7,14 @@ out vec3 qt_TexCoord0;
|
||||
uniform ivec3 viewport_row;
|
||||
uniform mat4 mvp;
|
||||
uniform vec2 offset;
|
||||
uniform ivec3 thumb_size;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec2 pos = qt_Vertex * 0.5;
|
||||
pos.y *= -1.0;
|
||||
pos = pos * imageSize_num.xy + 69;
|
||||
ivec2 off = ivec2(imageSize_num.z % viewport_row.z, imageSize_num.z / viewport_row.z) * ivec2(138, 158);
|
||||
pos = pos * imageSize_num.xy + thumb_size.x;
|
||||
ivec2 off = ivec2(imageSize_num.z % viewport_row.z, imageSize_num.z / viewport_row.z) * thumb_size.yz;
|
||||
|
||||
gl_Position = mvp * vec4(pos - offset + off, 0.0, 1.0);
|
||||
qt_TexCoord0 = vec3(qt_MultiTexCoord0, imageSize_num.z + 0.1);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Exec=tenmon %U
|
||||
Icon=org.nou.tenmon
|
||||
Icon=space.nouspiro.tenmon
|
||||
Comment=FITS Image viewer
|
||||
Name=Tenmon
|
||||
Categories=Graphics;2DGraphics;RasterGraphics;Viewer;
|
||||
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop">
|
||||
<id>space.nouspiro.tenmon</id>
|
||||
<launchable type="desktop-id">space.nouspiro.tenmon.desktop</launchable>
|
||||
<name>Tenmon</name>
|
||||
<summary>FITS/XISF image viewer, converter, index and search</summary>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>GPL-3.0</project_license>
|
||||
<description>
|
||||
<p>
|
||||
It is intended primarily for viewing astro photos and images. It supports the following formats:
|
||||
<ul>
|
||||
<li>FITS 8, 16 bit integer and 32 bit float</li>
|
||||
<li>XISF 8, 16 bit integer and 32 bit float</li>
|
||||
<li>JPEG and PNG images</li>
|
||||
</ul>
|
||||
</p>
|
||||
Features:
|
||||
<ul>
|
||||
<li>Using same stretch function as PixInsight</li>
|
||||
<li>OpenGL accelerated drawing</li>
|
||||
<li>Index and search FITS XISF header data</li>
|
||||
<li>Quick mark images and then copy/move marked files</li>
|
||||
<li>Convert FITS <-> XISF</li>
|
||||
<li>Convert FITS/XISF -> JPEG/PNG</li>
|
||||
<li>Image statistics mean, media, min, max</li>
|
||||
<li>Support for WCS</li>
|
||||
<li>Thumbnails</li>
|
||||
</ul>
|
||||
<p>
|
||||
</p>
|
||||
</description>
|
||||
<url type="homepage">https://nouspiro.space/?page_id=206</url>
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image>https://nouspiro.space/wp-content/uploads/2022/04/tenmon-1024x579.png</image>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<content_rating type="oars-1.1"/>
|
||||
<releases>
|
||||
<release version="20221121" date="2022-11-11"/>
|
||||
<release version="20221023" date="2022-10-23"/>
|
||||
</releases>
|
||||
</component>
|
||||
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="128"
|
||||
height="128"
|
||||
viewBox="0 0 33.866666 33.866668"
|
||||
version="1.1"
|
||||
id="svg5"
|
||||
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
|
||||
sodipodi:docname="space.nouspiro.tenmon.svg"
|
||||
inkscape:export-filename="/home/nou/c++/tenmon/space.nouspiro.tenmon_128.png"
|
||||
inkscape:export-xdpi="96.000008"
|
||||
inkscape:export-ydpi="96.000008"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview7"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:document-units="mm"
|
||||
showgrid="false"
|
||||
units="px"
|
||||
width="128px"
|
||||
inkscape:zoom="2.6547419"
|
||||
inkscape:cx="54.430903"
|
||||
inkscape:cy="78.162024"
|
||||
inkscape:window-width="1862"
|
||||
inkscape:window-height="1136"
|
||||
inkscape:window-x="58"
|
||||
inkscape:window-y="27"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="layer1" />
|
||||
<defs
|
||||
id="defs2" />
|
||||
<g
|
||||
inkscape:label="Vrstva 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<rect
|
||||
style="fill:#000000;stroke:#ffffff;stroke-width:0;stroke-linejoin:round"
|
||||
id="rect1196"
|
||||
width="33.866665"
|
||||
height="33.866665"
|
||||
x="5e-07"
|
||||
y="5e-07" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:17.276px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.359917"
|
||||
x="-0.41414261"
|
||||
y="23.331123"
|
||||
id="text8592"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan8590"
|
||||
style="fill:#ffffff;stroke-width:0.359917"
|
||||
x="-0.41414261"
|
||||
y="23.331123">天文</tspan></text>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
@@ -1,9 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Exec=Tenmon %U
|
||||
Icon=org.nou.tenmon
|
||||
Comment=FITS Image viewer
|
||||
Name=Tenmon
|
||||
Categories=Graphics;2DGraphics;RasterGraphics;Viewer;
|
||||
MimeType=image/fits;image/x-xisf;
|
||||
Terminal=false
|
||||
Binary file not shown.
@@ -326,6 +326,18 @@
|
||||
<source>Images (*.jpg *.jpeg *.png *.cr2 *.nef *.dng *.fit *.fits *.xisf *.JPG *.JPEG *.PNG *.CR2 *.NEF *.DNG *.FIT *.FITS *.XISF)</source>
|
||||
<translation>Images (*.jpg *.jpeg *.png *.cr2 *.nef *.dng *.fit *.fits *.xisf *.JPG *.JPEG *.PNG *.CR2 *.NEF *.DNG *.FIT *.FITS *.XISF)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Edit</source>
|
||||
<translation>Edit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>FITS header editor</source>
|
||||
<translation>FITS header editor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Settings</source>
|
||||
<translation>Settings</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MarkedFiles</name>
|
||||
@@ -424,6 +436,33 @@
|
||||
<translation>Select columns</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsDialog</name>
|
||||
<message>
|
||||
<source>Settings</source>
|
||||
<translation>Settings</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>How many images are preloaded before and after current image.</source>
|
||||
<translation>How many images are preloaded before and after current image.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Thumbnail size in pixels</source>
|
||||
<translation>Thumbnail size in pixels</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Image preload count</source>
|
||||
<translation>Image preload count</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Thumbnails size</source>
|
||||
<translation>Thumbnails size</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Changes in settings will take effect after program restart.</source>
|
||||
<translation>Changes in settings will take effect after program restart.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>StretchToolbar</name>
|
||||
<message>
|
||||
|
||||
Binary file not shown.
@@ -326,6 +326,18 @@
|
||||
<source>Images (*.jpg *.jpeg *.png *.cr2 *.nef *.dng *.fit *.fits *.xisf *.JPG *.JPEG *.PNG *.CR2 *.NEF *.DNG *.FIT *.FITS *.XISF)</source>
|
||||
<translation>Images (*.jpg *.jpeg *.png *.cr2 *.nef *.dng *.fit *.fits *.xisf *.JPG *.JPEG *.PNG *.CR2 *.NEF *.DNG *.FIT *.FITS *.XISF)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Edit</source>
|
||||
<translation>Éditer</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>FITS header editor</source>
|
||||
<translation>Éditeur d'en-tête FITS</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Settings</source>
|
||||
<translation>Réglages</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MarkedFiles</name>
|
||||
@@ -424,6 +436,33 @@
|
||||
<translation>Choix des colonnes</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsDialog</name>
|
||||
<message>
|
||||
<source>Settings</source>
|
||||
<translation>Réglages</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>How many images are preloaded before and after current image.</source>
|
||||
<translation>Combien d'images sont préchargées avant et après l'image courante.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Thumbnail size in pixels</source>
|
||||
<translation>Taille des vignettes en pixels</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Image preload count</source>
|
||||
<translation>Nombre d'images préchargées</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Thumbnails size</source>
|
||||
<translation>Taille des vignette</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Changes in settings will take effect after program restart.</source>
|
||||
<translation>Les changements de paramètres prendront effet après le redémarrage du programme.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>StretchToolbar</name>
|
||||
<message>
|
||||
|
||||
Binary file not shown.
@@ -339,6 +339,18 @@
|
||||
<source>Images (*.jpg *.jpeg *.png *.cr2 *.nef *.dng *.fit *.fits *.xisf *.JPG *.JPEG *.PNG *.CR2 *.NEF *.DNG *.FIT *.FITS *.XISF)</source>
|
||||
<translation>Obrázky (*.jpg *.jpeg *.png *.cr2 *.nef *.dng *.fit *.fits *.xisf *.JPG *.JPEG *.PNG *.CR2 *.NEF *.DNG *.FIT *.FITS *.XISF)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Edit</source>
|
||||
<translation>Upraviť</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>FITS header editor</source>
|
||||
<translation>Editor FITS hlavičky</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Settings</source>
|
||||
<translation>Nastavenia</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MarkedFiles</name>
|
||||
@@ -437,6 +449,33 @@
|
||||
<translation>Výber stĺpcov</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsDialog</name>
|
||||
<message>
|
||||
<source>Settings</source>
|
||||
<translation>Nastavenia</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>How many images are preloaded before and after current image.</source>
|
||||
<translation>Koľko obrázkov sa prednačíta pred a za aktuálnym obrázkom.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Thumbnail size in pixels</source>
|
||||
<translation>Veľkosť náhľadu v pixeloch</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Image preload count</source>
|
||||
<translation>Počet prednačítaných obrázkov</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Thumbnails size</source>
|
||||
<translation>Veľkosť náhľadu</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Changes in settings will take effect after program restart.</source>
|
||||
<translation>Zmeny v nastaveniach sa prejavia po reštarte programu.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>StretchToolbar</name>
|
||||
<message>
|
||||
|
||||
Reference in New Issue
Block a user