2 Commits

Author SHA1 Message Date
nou 4f48eebb10 Add qtbase5-dev as dependency to libxisf-dev 2023-02-09 21:31:19 +01:00
nou 3141092456 Add readPixel param to getImage() 2023-02-09 21:27:59 +01:00
5 changed files with 17 additions and 7 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
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_AUTOUIC ON)
+6
View File
@@ -1,3 +1,9 @@
libxisf (0.1.2-ubuntu1) UNRELEASED; 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
* Fixed packaging
+1 -1
View File
@@ -14,7 +14,7 @@ Package: libxisf-dev
Section: libdevel
Architecture: any
Multi-Arch: same
Depends: libxisf (= ${binary:Version}), ${misc:Depends}
Depends: libxisf qtbase5-dev (= ${binary:Version}), ${misc:Depends}
Description: Library to load and save XISF images
Native format of PixInsight astroprocessing suite
+4 -4
View File
@@ -404,12 +404,12 @@ bool Image::addFITSKeywordAsProperty(const QString &name, const QVariant &value)
void *Image::imageData()
{
return _dataBlock.data.data();
return _dataBlock.data.isNull() ? nullptr : _dataBlock.data.data();
}
const void *Image::imageData() const
{
return _dataBlock.data.data();
return _dataBlock.data.isNull() ? nullptr : _dataBlock.data.data();
}
size_t Image::imageDataSize() const
@@ -591,13 +591,13 @@ int XISFReader::imagesCount() const
return _images.size();
}
const Image& XISFReader::getImage(uint32_t n)
const Image& XISFReader::getImage(uint32_t n, bool readPixels)
{
if(n >= _images.size())
throw Error("Out of bounds");
Image &img = _images[n];
if(img._dataBlock.attachmentPos)
if(img._dataBlock.attachmentPos && readPixels)
{
_io->seek(img._dataBlock.attachmentPos);
img._dataBlock.decompress(_io->read(img._dataBlock.attachmentSize));
+5 -1
View File
@@ -227,7 +227,11 @@ public:
void close();
/** Return number of images inside file */
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:
void readXISFHeader();
void readSignature();