Compare commits
5 Commits
v0.1.1
..
2107d68e71
| Author | SHA1 | Date | |
|---|---|---|---|
| 2107d68e71 | |||
| 2e8bbf6e30 | |||
| a0968bba3a | |||
| 4f48eebb10 | |||
| 3141092456 |
+9
-3
@@ -1,6 +1,6 @@
|
|||||||
cmake_minimum_required(VERSION 3.14)
|
cmake_minimum_required(VERSION 3.14)
|
||||||
|
|
||||||
project(libXISF VERSION 0.1.1 LANGUAGES CXX C)
|
project(libXISF VERSION 0.1.2 LANGUAGES CXX C)
|
||||||
|
|
||||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
set(CMAKE_AUTOUIC ON)
|
set(CMAKE_AUTOUIC ON)
|
||||||
@@ -12,7 +12,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|||||||
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
|
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
|
||||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED)
|
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED)
|
||||||
|
|
||||||
add_library(XISF SHARED
|
option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
|
||||||
|
|
||||||
|
add_library(XISF
|
||||||
libXISF_global.h
|
libXISF_global.h
|
||||||
libxisf.cpp
|
libxisf.cpp
|
||||||
libxisf.h
|
libxisf.h
|
||||||
@@ -26,7 +28,11 @@ set_target_properties(XISF PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PRO
|
|||||||
|
|
||||||
target_link_libraries(XISF PUBLIC Qt${QT_VERSION_MAJOR}::Core)
|
target_link_libraries(XISF PUBLIC Qt${QT_VERSION_MAJOR}::Core)
|
||||||
|
|
||||||
target_compile_definitions(XISF PRIVATE LIBXISF_LIBRARY)
|
if(BUILD_SHARED_LIBS)
|
||||||
|
target_compile_definitions(XISF PRIVATE LIBXISF_LIBRARY)
|
||||||
|
else(BUILD_SHARED_LIBS)
|
||||||
|
target_compile_definitions(XISF PUBLIC LIBXISF_STATIC_LIB)
|
||||||
|
endif(BUILD_SHARED_LIBS)
|
||||||
|
|
||||||
set(XISF_PUBLIC_HEADERS libxisf.h libXISF_global.h)
|
set(XISF_PUBLIC_HEADERS libxisf.h libXISF_global.h)
|
||||||
|
|
||||||
|
|||||||
Vendored
+6
@@ -1,3 +1,9 @@
|
|||||||
|
libxisf (0.1.2-ubuntu1) focal; urgency=medium
|
||||||
|
|
||||||
|
* Add qtbase5-dev as dependency to libxisf-dev
|
||||||
|
|
||||||
|
-- Dušan Poizl <nou@nouspiro.space> Thu, 09 Feb 2023 21:28:45 +0100
|
||||||
|
|
||||||
libxisf (0.1.1-ubuntu1) focal; urgency=medium
|
libxisf (0.1.1-ubuntu1) focal; urgency=medium
|
||||||
|
|
||||||
* Fixed packaging
|
* Fixed packaging
|
||||||
|
|||||||
Vendored
+1
-1
@@ -14,7 +14,7 @@ Package: libxisf-dev
|
|||||||
Section: libdevel
|
Section: libdevel
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Multi-Arch: same
|
Multi-Arch: same
|
||||||
Depends: libxisf (= ${binary:Version}), ${misc:Depends}
|
Depends: libxisf (= ${binary:Version}), ${misc:Depends}, qtbase5-dev
|
||||||
Description: Library to load and save XISF images
|
Description: Library to load and save XISF images
|
||||||
Native format of PixInsight astroprocessing suite
|
Native format of PixInsight astroprocessing suite
|
||||||
|
|
||||||
|
|||||||
+7
-3
@@ -21,10 +21,14 @@
|
|||||||
|
|
||||||
#include <QtCore/qglobal.h>
|
#include <QtCore/qglobal.h>
|
||||||
|
|
||||||
#if defined(LIBXISF_LIBRARY)
|
#ifdef LIBXISF_STATIC_LIB
|
||||||
# define LIBXISF_EXPORT Q_DECL_EXPORT
|
# define LIBXISF_EXPORT
|
||||||
#else
|
#else
|
||||||
# define LIBXISF_EXPORT Q_DECL_IMPORT
|
# if defined(LIBXISF_LIBRARY)
|
||||||
|
# define LIBXISF_EXPORT Q_DECL_EXPORT
|
||||||
|
# else
|
||||||
|
# define LIBXISF_EXPORT Q_DECL_IMPORT
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // LIBXISF_GLOBAL_H
|
#endif // LIBXISF_GLOBAL_H
|
||||||
|
|||||||
+4
-4
@@ -404,12 +404,12 @@ bool Image::addFITSKeywordAsProperty(const QString &name, const QVariant &value)
|
|||||||
|
|
||||||
void *Image::imageData()
|
void *Image::imageData()
|
||||||
{
|
{
|
||||||
return _dataBlock.data.data();
|
return _dataBlock.data.isNull() ? nullptr : _dataBlock.data.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
const void *Image::imageData() const
|
const void *Image::imageData() const
|
||||||
{
|
{
|
||||||
return _dataBlock.data.data();
|
return _dataBlock.data.isNull() ? nullptr : _dataBlock.data.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Image::imageDataSize() const
|
size_t Image::imageDataSize() const
|
||||||
@@ -591,13 +591,13 @@ int XISFReader::imagesCount() const
|
|||||||
return _images.size();
|
return _images.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
const Image& XISFReader::getImage(uint32_t n)
|
const Image& XISFReader::getImage(uint32_t n, bool readPixels)
|
||||||
{
|
{
|
||||||
if(n >= _images.size())
|
if(n >= _images.size())
|
||||||
throw Error("Out of bounds");
|
throw Error("Out of bounds");
|
||||||
|
|
||||||
Image &img = _images[n];
|
Image &img = _images[n];
|
||||||
if(img._dataBlock.attachmentPos)
|
if(img._dataBlock.attachmentPos && readPixels)
|
||||||
{
|
{
|
||||||
_io->seek(img._dataBlock.attachmentPos);
|
_io->seek(img._dataBlock.attachmentPos);
|
||||||
img._dataBlock.decompress(_io->read(img._dataBlock.attachmentSize));
|
img._dataBlock.decompress(_io->read(img._dataBlock.attachmentSize));
|
||||||
|
|||||||
@@ -227,7 +227,11 @@ public:
|
|||||||
void close();
|
void close();
|
||||||
/** Return number of images inside file */
|
/** Return number of images inside file */
|
||||||
int imagesCount() const;
|
int imagesCount() const;
|
||||||
const Image& getImage(uint32_t n);
|
/** Return reference to Image
|
||||||
|
* @param n index of image
|
||||||
|
* @param readPixel when false it will read pixel data from file and imageData()
|
||||||
|
* will return nullptr */
|
||||||
|
const Image& getImage(uint32_t n, bool readPixels = true);
|
||||||
private:
|
private:
|
||||||
void readXISFHeader();
|
void readXISFHeader();
|
||||||
void readSignature();
|
void readSignature();
|
||||||
|
|||||||
Reference in New Issue
Block a user