Compare commits

...

3 Commits

  1. 19
      README
  2. 12
      mainwindow.cpp
  3. 16
      rawimage.cpp
  4. 1
      rawimage.h

@ -2,10 +2,23 @@ FITS/XISF image viewer with multithreaded image loading
To get all dependencies install these packages
sudo apt install qtbase5-dev libraw-dev libexif-dev libcfitsio-dev libgsl-dev cmake
sudo apt install qtbase5-dev libraw-dev libexif-dev libcfitsio-dev libgsl-dev wcslib-dev libopencv-dev cmake
on OpenSUSE
sudo zypper install opencv-devel gsl-devel exif-devel libraw-devel wcslib-devel libqt5-qtbase-devel
MacOS X
To compile on MacOS install XCode first. Then install homebrew in x86_64 mode
with "arch -i x86_64". Building on native ARM is not supported.
homebrew install qt5 libraw cfitsio libexif libgsl wcslib opencv
You may need to set CMAKE_PREFIX_PATH for Qt5 and OpenCV so CMake can find them.
Then to build run standard cmake
cmake -B build -S .
make
./tenmon
cmake --build build
./build/tenmon

@ -13,7 +13,7 @@
#include <signal.h>
#include <unistd.h>
#include <QSettings>
#include <QCoreApplication>
#include <QGuiApplication>
#include <QThreadPool>
#include <QStatusBar>
#include "loadrunable.h"
@ -208,6 +208,16 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
}
m_imageGL->setFocus();
// workaround for nasty wayland backend bug https://bugreports.qt.io/browse/QTBUG-87332
if(static_cast<QGuiApplication*>(QCoreApplication::instance())->platformName() == "wayland")
{
infoDock->setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable);
filesystemDock->setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable);
databaseViewDock->setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable);
filetreeDock->setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable);
m_stretchPanel->setFloatable(false);
}
}
MainWindow::~MainWindow()

@ -67,6 +67,7 @@ RawImage::RawImage(cv::Mat &img)
{
m_img = img;
m_stats = false;
scaleToUnit();
}
RawImage::RawImage(const RawImage &d)
@ -378,3 +379,18 @@ bool RawImage::pixel(int x, int y, QVector3D &rgb) const
}
return true;
}
void RawImage::scaleToUnit()
{
if(CV_MAT_DEPTH(m_img.type()) == CV_32F)
{
double min, max;
cv::minMaxIdx(m_img, &min, &max);
if(min < 0 || max > 1)
{
float scale = 1.0 / (max - min);
float zero = min * scale;
m_img = m_img * scale - zero;
}
}
}

@ -84,6 +84,7 @@ public:
float thumbAspect() const;
const cv::Mat& mat() const;
bool pixel(int x, int y, QVector3D &rgb) const;
void scaleToUnit();
};
#endif // RAWIMAGE_H

Loading…
Cancel
Save