Compare commits
4 Commits
9ba2515aa8
...
84a71896f8
Author | SHA1 | Date | |
---|---|---|---|
84a71896f8 | |||
0ba02d4070 | |||
eff0780014 | |||
7665ea76b6 |
@ -47,3 +47,8 @@ find_path(FITS_INCLUDE fitsio2.h PATH_SUFFIXES cfitsio REQUIRED)
|
||||
target_include_directories(tenmon PRIVATE ${OpenCV_INCLUDE_DIRS} ${FITS_INCLUDE})
|
||||
|
||||
target_link_libraries(tenmon Qt5::Widgets Qt5::Sql Qt5::OpenGL ${OpenCV_LIBS} ${GSL_LIB} ${EXIF_LIB} ${FITS_LIB} ${RAW_LIB})
|
||||
|
||||
install(TARGETS tenmon)
|
||||
if(UNIX)
|
||||
install(SCRIPT install.cmake)
|
||||
endif(UNIX)
|
||||
|
@ -310,5 +310,6 @@ void ImageRingList::dirChanged(QString dir)
|
||||
currentFile = (*m_currImage)->name();
|
||||
|
||||
setDir(dir, currentFile);
|
||||
emit currentImageChanged(m_currImage-m_images.begin());
|
||||
if(m_images.size())
|
||||
emit currentImageChanged(m_currImage-m_images.begin());
|
||||
}
|
||||
|
4
install.cmake
Normal file
4
install.cmake
Normal file
@ -0,0 +1,4 @@
|
||||
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 icon.png org.nou.tenmon WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
|
@ -184,6 +184,7 @@ bool loadFITS(QString path, ImageInfoData &info, RawImage **image)
|
||||
int naxis;
|
||||
long naxes[3] = {0};
|
||||
fits_get_img_param(file, 3, &imgtype, &naxis, naxes, &status);
|
||||
fits_get_img_equivtype(file, &imgtype, &status);
|
||||
|
||||
if(naxis >= 2 && naxis <= 3 && status == 0)
|
||||
{
|
||||
@ -198,6 +199,10 @@ bool loadFITS(QString path, ImageInfoData &info, RawImage **image)
|
||||
fitstype = TBYTE;
|
||||
break;
|
||||
case SHORT_IMG:
|
||||
cvtype = CV_16S;
|
||||
fitstype = TSHORT;
|
||||
break;
|
||||
case USHORT_IMG:
|
||||
cvtype = CV_16U;
|
||||
fitstype = TUSHORT;
|
||||
break;
|
||||
@ -219,6 +224,8 @@ bool loadFITS(QString path, ImageInfoData &info, RawImage **image)
|
||||
cv::Mat tmp(h, w, cvtype);
|
||||
fpixel[2] = i;
|
||||
fits_read_pix(file, fitstype, fpixel, size, NULL, tmp.ptr(), NULL, &status);
|
||||
if(cvtype == CV_16S)
|
||||
tmp.convertTo(tmp, CV_16U, 1, 32767);
|
||||
cvimg.push_back(tmp);
|
||||
}
|
||||
|
||||
|
9
org.nou.tenmon.desktop
Normal file
9
org.nou.tenmon.desktop
Normal file
@ -0,0 +1,9 @@
|
||||
[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;
|
||||
Terminal=false
|
@ -146,6 +146,7 @@ void RawImage::calcStats()
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(img.type() == CV_32F)m_median /= histSize;
|
||||
cv::Mat absDev;
|
||||
img.convertTo(absDev, CV_32F, 1, -m_median);
|
||||
absDev = cv::abs(absDev);
|
||||
@ -161,6 +162,7 @@ void RawImage::calcStats()
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(img.type() == CV_32F)m_mad /= histSize;
|
||||
}
|
||||
|
||||
void RawImage::rect(int &x, int &y, int w, int h, std::vector<double> &r) const
|
||||
|
9
tenmon.desktop
Normal file
9
tenmon.desktop
Normal file
@ -0,0 +1,9 @@
|
||||
[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;
|
||||
Terminal=false
|
Loading…
x
Reference in New Issue
Block a user