Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jbl/1013574 pyramidtype #65

Merged
merged 12 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.15)
cmake_policy(SET CMP0091 NEW) # enable new "MSVC runtime library selection" (https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html)

project(libCZI
VERSION 0.51.1
VERSION 0.52.0
HOMEPAGE_URL "https://github.com/ZEISS/libczi"
DESCRIPTION "libCZI is an Open Source Cross-Platform C++ library to read and write CZI")

Expand Down
6 changes: 5 additions & 1 deletion Src/libCZI/CZIReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
info.logicalRect = IntRect{ entry.x,entry.y,entry.width,entry.height };
info.physicalSize = IntSize{ (std::uint32_t)entry.storedWidth, (std::uint32_t)entry.storedHeight };
info.mIndex = entry.mIndex;
info.pyramidType = CziUtils::PyramidTypeFromByte(entry.pyramid_type_from_spare);
return funcEnum(index, info);
});
}
Expand All @@ -130,6 +131,7 @@
info.logicalRect = IntRect{ entry.x,entry.y,entry.width,entry.height };
info.physicalSize = IntSize{ (std::uint32_t)entry.storedWidth, (std::uint32_t)entry.storedHeight };
info.mIndex = entry.mIndex;
info.pyramidType = CziUtils::PyramidTypeFromByte(entry.pyramid_type_from_spare);

Check warning on line 134 in Src/libCZI/CZIReader.cpp

View check run for this annotation

Codecov / codecov/patch

Src/libCZI/CZIReader.cpp#L134

Added line #L134 was not covered by tests
info.filePosition = entry.FilePosition;
return funcEnum(index, info);
});
Expand Down Expand Up @@ -232,6 +234,7 @@
info->logicalRect = IntRect{ entry.x,entry.y,entry.width,entry.height };
info->physicalSize = IntSize{ static_cast<std::uint32_t>(entry.storedWidth), static_cast<std::uint32_t>(entry.storedHeight) };
info->mIndex = entry.mIndex;
info->pyramidType = CziUtils::PyramidTypeFromByte(entry.pyramid_type_from_spare);

Check warning on line 237 in Src/libCZI/CZIReader.cpp

View check run for this annotation

Codecov / codecov/patch

Src/libCZI/CZIReader.cpp#L237

Added line #L237 was not covered by tests
}

return true;
Expand Down Expand Up @@ -266,7 +269,7 @@
});
}

/*virtual*/void CCZIReader::EnumerateSubset(const char* contentFileType, const char* name, const std::function<bool(int index, const libCZI::AttachmentInfo& infi)>& funcEnum)
/*virtual*/void CCZIReader::EnumerateSubset(const char* contentFileType, const char* name, const std::function<bool(int index, const libCZI::AttachmentInfo& info)>& funcEnum)
{
this->ThrowIfNotOperational();
libCZI::AttachmentInfo ai;
Expand Down Expand Up @@ -315,6 +318,7 @@
info.mIndex = subBlkData.mIndex;
info.logicalRect = subBlkData.logicalRect;
info.physicalSize = subBlkData.physicalSize;
info.pyramidType = CziUtils::PyramidTypeFromByte(subBlkData.spare[0]);

return std::make_shared<CCziSubBlock>(info, subBlkData, free);
}
Expand Down
2 changes: 1 addition & 1 deletion Src/libCZI/CZIReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class CCZIReader : public libCZI::ICZIReader, public std::enable_shared_from_thi
void Close() override;

// interface IAttachmentRepository
void EnumerateAttachments(const std::function<bool(int index, const libCZI::AttachmentInfo& infi)>& funcEnum) override;
void EnumerateAttachments(const std::function<bool(int index, const libCZI::AttachmentInfo& info)>& funcEnum) override;
void EnumerateSubset(const char* contentFileType, const char* name, const std::function<bool(int index, const libCZI::AttachmentInfo& infi)>& funcEnum) override;
std::shared_ptr<libCZI::IAttachment> ReadAttachment(int index) override;

Expand Down
2 changes: 2 additions & 0 deletions Src/libCZI/CziParse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ using namespace libCZI;
sbd.compression = subBlckSegment.data.entryDV.Compression;
sbd.pixelType = subBlckSegment.data.entryDV.PixelType;
sbd.mIndex = (std::numeric_limits<int>::max)();
memcpy(sbd.spare, subBlckSegment.data.entryDV._spare, sizeof(sbd.spare));

if (subBlckSegment.data.entryDV.DimensionCount > MAXDIMENSIONS)
{
Expand Down Expand Up @@ -616,6 +617,7 @@ using namespace libCZI;
entry.FilePosition = subBlkDirDV->FilePosition;
entry.PixelType = subBlkDirDV->PixelType;
entry.Compression = subBlkDirDV->Compression;
entry.pyramid_type_from_spare = subBlkDirDV->_spare[0];

addFunc(entry);
}
Expand Down
1 change: 1 addition & 0 deletions Src/libCZI/CziParse.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ class CCZIParse
libCZI::IntRect logicalRect;
libCZI::IntSize physicalSize;
int mIndex; // if not present, then this is int::max
std::uint8_t spare[6];
};

static SubBlockData ReadSubBlock(libCZI::IStream* str, std::uint64_t offset, const SubBlockStorageAllocate& allocateInfo);
Expand Down
2 changes: 2 additions & 0 deletions Src/libCZI/CziReaderWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@
info.mIndex = subBlkData.mIndex;
info.logicalRect = subBlkData.logicalRect;
info.physicalSize = subBlkData.physicalSize;
info.pyramidType = CziUtils::PyramidTypeFromByte(subBlkData.spare[0]);

return std::make_shared<CCziSubBlock>(info, subBlkData, free);
}
Expand All @@ -698,6 +699,7 @@
info->logicalRect = IntRect{ entry.x,entry.y,entry.width,entry.height };
info->physicalSize = IntSize{ static_cast<std::uint32_t>(entry.storedWidth), static_cast<std::uint32_t>(entry.storedHeight) };
info->mIndex = entry.mIndex;
info->pyramidType = CziUtils::PyramidTypeFromByte(entry.pyramid_type_from_spare);

Check warning on line 702 in Src/libCZI/CziReaderWriter.cpp

View check run for this annotation

Codecov / codecov/patch

Src/libCZI/CziReaderWriter.cpp#L702

Added line #L702 was not covered by tests
}

return true;
Expand Down
2 changes: 1 addition & 1 deletion Src/libCZI/CziReaderWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class CCziReaderWriter : public libCZI::ICziReaderWriter

// interface IAttachmentRepository
void EnumerateAttachments(const std::function<bool(int index, const libCZI::AttachmentInfo& info)>& funcEnum) override;
void EnumerateSubset(const char* contentFileType, const char* name, const std::function<bool(int index, const libCZI::AttachmentInfo& infi)>& funcEnum) override;
void EnumerateSubset(const char* contentFileType, const char* name, const std::function<bool(int index, const libCZI::AttachmentInfo& info)>& funcEnum) override;
std::shared_ptr<libCZI::IAttachment> ReadAttachment(int index) override;

private:
Expand Down
11 changes: 10 additions & 1 deletion Src/libCZI/CziStructs.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,16 @@ struct PACKED SubBlockDirectoryEntryDV
std::int64_t FilePosition;
std::int32_t FilePart;
std::int32_t Compression;
unsigned char _spare[6];

/// _spare[0] seems to contain information about the "pyramid-type", where valid values are
///
/// 0: None
/// 1: SingleSubblock
/// 2: MultiSubblock
///
/// The significance and importance of this field is unclear, and it seems of questionable use. It is
/// considered legacy and should not be used.
std::uint8_t _spare[6];
std::int32_t DimensionCount;

// max. allocation for ease of use (valid size = 32 + EntryCount * 20)
Expand Down
2 changes: 2 additions & 0 deletions Src/libCZI/CziSubBlockDirectory.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class CCziSubBlockDirectoryBase
int PixelType;
std::uint64_t FilePosition;
int Compression;
std::uint8_t pyramid_type_from_spare; ///< The field "pyramid-type" (from spare-bytes of the subblock-directory-entry)

bool IsMIndexValid() const
{
Expand All @@ -41,6 +42,7 @@ class CCziSubBlockDirectoryBase
void Invalidate()
{
this->mIndex = this->x = this->y = this->width = this->height = this->storedWidth = this->storedHeight = (std::numeric_limits<int>::min)();
this->pyramid_type_from_spare = 0;
}
};

Expand Down
24 changes: 24 additions & 0 deletions Src/libCZI/CziUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,30 @@
return PixelType::Invalid;
}

/*static*/libCZI::SubBlockPyramidType CziUtils::PyramidTypeFromByte(std::uint8_t byte)
{
switch (byte)
{
case 0: return SubBlockPyramidType::None;
case 1: return SubBlockPyramidType::SingleSubBlock;
case 2: return SubBlockPyramidType::MultiSubBlock;
}

return SubBlockPyramidType::Invalid;

Check warning on line 40 in Src/libCZI/CziUtils.cpp

View check run for this annotation

Codecov / codecov/patch

Src/libCZI/CziUtils.cpp#L40

Added line #L40 was not covered by tests
}

/*static*/std::uint8_t CziUtils::ByteFromPyramidType(libCZI::SubBlockPyramidType pyramid_type)
{
switch (pyramid_type)
{
case SubBlockPyramidType::None: return 0;
case SubBlockPyramidType::SingleSubBlock: return 1;
case SubBlockPyramidType::MultiSubBlock: return 2;
}

return 0;

Check warning on line 52 in Src/libCZI/CziUtils.cpp

View check run for this annotation

Codecov / codecov/patch

Src/libCZI/CziUtils.cpp#L52

Added line #L52 was not covered by tests
}

/*static*/int CziUtils::IntFromPixelType(libCZI::PixelType p)
{
switch (p)
Expand Down
2 changes: 2 additions & 0 deletions Src/libCZI/CziUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class CziUtils
{
public:
static libCZI::PixelType PixelTypeFromInt(int i);
static libCZI::SubBlockPyramidType PyramidTypeFromByte(std::uint8_t byte);
static std::uint8_t ByteFromPyramidType(libCZI::SubBlockPyramidType pyramid_type);
static int IntFromPixelType(libCZI::PixelType);
static libCZI::CompressionMode CompressionModeFromInt(int i);
static std::int32_t CompressionModeToInt(libCZI::CompressionMode m);
Expand Down
109 changes: 56 additions & 53 deletions Src/libCZI/CziWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@
AddSubBlockInfo addSbInfo(addSbBlkInfo);
addSbInfo.sizeData = addSbBlkInfo.dataSize;
addSbInfo.getData = [&](int callCnt, size_t offset, const void*& ptr, size_t& size)->bool
{
return SetIfCallCountZero(callCnt, addSbBlkInfo.ptrData, addSbBlkInfo.dataSize, ptr, size);
};
{
return SetIfCallCountZero(callCnt, addSbBlkInfo.ptrData, addSbBlkInfo.dataSize, ptr, size);
};

addSbInfo.sizeAttachment = addSbBlkInfo.sbBlkAttachmentSize;
addSbInfo.getAttachment = [&](int callCnt, size_t offset, const void*& ptr, size_t& size)->bool
{
return SetIfCallCountZero(callCnt, addSbBlkInfo.ptrSbBlkAttachment, addSbBlkInfo.sbBlkAttachmentSize, ptr, size);
};
{
return SetIfCallCountZero(callCnt, addSbBlkInfo.ptrSbBlkAttachment, addSbBlkInfo.sbBlkAttachmentSize, ptr, size);

Check warning on line 41 in Src/libCZI/CziWriter.cpp

View check run for this annotation

Codecov / codecov/patch

Src/libCZI/CziWriter.cpp#L41

Added line #L41 was not covered by tests
};

addSbInfo.sizeMetadata = addSbBlkInfo.sbBlkMetadataSize;
addSbInfo.getMetaData = [&](int callCnt, size_t offset, const void*& ptr, size_t& size)->bool
{
return SetIfCallCountZero(callCnt, addSbBlkInfo.ptrSbBlkMetadata, addSbBlkInfo.sbBlkMetadataSize, ptr, size);
};
{
return SetIfCallCountZero(callCnt, addSbBlkInfo.ptrSbBlkMetadata, addSbBlkInfo.sbBlkMetadataSize, ptr, size);

Check warning on line 47 in Src/libCZI/CziWriter.cpp

View check run for this annotation

Codecov / codecov/patch

Src/libCZI/CziWriter.cpp#L47

Added line #L47 was not covered by tests
};

return this->SyncAddSubBlock(addSbInfo);
}
Expand All @@ -58,28 +58,28 @@
addSbInfo.sizeData = addSbInfoLinewise.physicalHeight * stride;
auto linesCnt = addSbInfoLinewise.physicalHeight;
addSbInfo.getData = [&](int callCnt, size_t offset, const void*& ptr, size_t& size)->bool
{
if (callCnt < linesCnt)
{
ptr = addSbInfoLinewise.getBitmapLine(callCnt);
size = stride;
return true;
}
if (callCnt < linesCnt)

Check warning on line 62 in Src/libCZI/CziWriter.cpp

View check run for this annotation

Codecov / codecov/patch

Src/libCZI/CziWriter.cpp#L62

Added line #L62 was not covered by tests
{
ptr = addSbInfoLinewise.getBitmapLine(callCnt);
size = stride;
return true;

Check warning on line 66 in Src/libCZI/CziWriter.cpp

View check run for this annotation

Codecov / codecov/patch

Src/libCZI/CziWriter.cpp#L64-L66

Added lines #L64 - L66 were not covered by tests
}

return false;
};
return false;
};

Check warning on line 70 in Src/libCZI/CziWriter.cpp

View check run for this annotation

Codecov / codecov/patch

Src/libCZI/CziWriter.cpp#L69-L70

Added lines #L69 - L70 were not covered by tests

addSbInfo.sizeAttachment = addSbInfoLinewise.sbBlkAttachmentSize;
addSbInfo.getAttachment = [&](int callCnt, size_t offset, const void*& ptr, size_t& size)->bool
{
return SetIfCallCountZero(callCnt, addSbInfoLinewise.ptrSbBlkAttachment, addSbInfoLinewise.sbBlkAttachmentSize, ptr, size);
};
{
return SetIfCallCountZero(callCnt, addSbInfoLinewise.ptrSbBlkAttachment, addSbInfoLinewise.sbBlkAttachmentSize, ptr, size);
};

Check warning on line 76 in Src/libCZI/CziWriter.cpp

View check run for this annotation

Codecov / codecov/patch

Src/libCZI/CziWriter.cpp#L75-L76

Added lines #L75 - L76 were not covered by tests

addSbInfo.sizeMetadata = addSbInfoLinewise.sbBlkMetadataSize;
addSbInfo.getMetaData = [&](int callCnt, size_t offset, const void*& ptr, size_t& size)->bool
{
return SetIfCallCountZero(callCnt, addSbInfoLinewise.ptrSbBlkMetadata, addSbInfoLinewise.sbBlkMetadataSize, ptr, size);
};
{
return SetIfCallCountZero(callCnt, addSbInfoLinewise.ptrSbBlkMetadata, addSbInfoLinewise.sbBlkMetadataSize, ptr, size);
};

Check warning on line 82 in Src/libCZI/CziWriter.cpp

View check run for this annotation

Codecov / codecov/patch

Src/libCZI/CziWriter.cpp#L81-L82

Added lines #L81 - L82 were not covered by tests

return this->SyncAddSubBlock(addSbInfo);
}
Expand All @@ -90,28 +90,28 @@

addSbInfo.sizeData = addSbBlkInfoStrideBitmap.physicalHeight * (addSbBlkInfoStrideBitmap.physicalWidth * (size_t)CziUtils::GetBytesPerPel(addSbBlkInfoStrideBitmap.PixelType));
addSbInfo.getData = [&](int callCnt, size_t offset, const void*& ptr, size_t& size)->bool
{
if (callCnt < addSbBlkInfoStrideBitmap.physicalHeight)
{
ptr = static_cast<const char*>(addSbBlkInfoStrideBitmap.ptrBitmap) + callCnt * (size_t)addSbBlkInfoStrideBitmap.strideBitmap;
size = addSbBlkInfoStrideBitmap.physicalWidth * (size_t)CziUtils::GetBytesPerPel(addSbBlkInfoStrideBitmap.PixelType);
return true;
}
if (callCnt < addSbBlkInfoStrideBitmap.physicalHeight)
{
ptr = static_cast<const char*>(addSbBlkInfoStrideBitmap.ptrBitmap) + callCnt * (size_t)addSbBlkInfoStrideBitmap.strideBitmap;
size = addSbBlkInfoStrideBitmap.physicalWidth * (size_t)CziUtils::GetBytesPerPel(addSbBlkInfoStrideBitmap.PixelType);
return true;
}

return false;
};
return false;

Check warning on line 101 in Src/libCZI/CziWriter.cpp

View check run for this annotation

Codecov / codecov/patch

Src/libCZI/CziWriter.cpp#L101

Added line #L101 was not covered by tests
};

addSbInfo.sizeAttachment = addSbBlkInfoStrideBitmap.sbBlkAttachmentSize;
addSbInfo.getAttachment = [&](int callCnt, size_t offset, const void*& ptr, size_t& size)->bool
{
return SetIfCallCountZero(callCnt, addSbBlkInfoStrideBitmap.ptrSbBlkAttachment, addSbBlkInfoStrideBitmap.sbBlkAttachmentSize, ptr, size);
};
{
return SetIfCallCountZero(callCnt, addSbBlkInfoStrideBitmap.ptrSbBlkAttachment, addSbBlkInfoStrideBitmap.sbBlkAttachmentSize, ptr, size);

Check warning on line 107 in Src/libCZI/CziWriter.cpp

View check run for this annotation

Codecov / codecov/patch

Src/libCZI/CziWriter.cpp#L107

Added line #L107 was not covered by tests
};

addSbInfo.sizeMetadata = addSbBlkInfoStrideBitmap.sbBlkMetadataSize;
addSbInfo.getMetaData = [&](int callCnt, size_t offset, const void*& ptr, size_t& size)->bool
{
return SetIfCallCountZero(callCnt, addSbBlkInfoStrideBitmap.ptrSbBlkMetadata, addSbBlkInfoStrideBitmap.sbBlkMetadataSize, ptr, size);
};
{
return SetIfCallCountZero(callCnt, addSbBlkInfoStrideBitmap.ptrSbBlkMetadata, addSbBlkInfoStrideBitmap.sbBlkMetadataSize, ptr, size);

Check warning on line 113 in Src/libCZI/CziWriter.cpp

View check run for this annotation

Codecov / codecov/patch

Src/libCZI/CziWriter.cpp#L113

Added line #L113 was not covered by tests
};

return this->SyncAddSubBlock(addSbInfo);
}
Expand Down Expand Up @@ -269,7 +269,8 @@
ptr->PixelType = CziUtils::IntFromPixelType(addSbBlkInfo.PixelType);
ptr->FilePosition = ptr->FilePart = 0;
ptr->Compression = addSbBlkInfo.compressionModeRaw;
memset(ptr->_spare, 0, sizeof(ptr->_spare));
ptr->_spare[0] = CziUtils::ByteFromPyramidType(addSbBlkInfo.pyramid_type);
memset(ptr->_spare + 1, 0, sizeof(ptr->_spare) - 1);
ptr->DimensionCount = CalcCountOfDimensionsEntriesInDirectoryEntryDV(addSbBlkInfo);

// first X and Y
Expand Down Expand Up @@ -331,7 +332,8 @@
ptr->FilePosition = entry.FilePosition;
ptr->FilePart = 0;
ptr->Compression = entry.Compression;
memset(ptr->_spare, 0, sizeof(ptr->_spare));
ptr->_spare[0] = entry.pyramid_type_from_spare;
memset(ptr->_spare + 1, 0, sizeof(ptr->_spare) - 1); // skipping the pyramid-spare-byte we set above here
ptr->DimensionCount = CalcCountOfDimensionsEntriesInDirectoryEntryDV(entry);

// first X and Y
Expand Down Expand Up @@ -829,6 +831,7 @@
entry.PixelType = CziUtils::IntFromPixelType(addSbBlkInfo.PixelType);
entry.FilePosition = 0;
entry.Compression = addSbBlkInfo.compressionModeRaw;
entry.pyramid_type_from_spare = CziUtils::ByteFromPyramidType(addSbBlkInfo.pyramid_type);
return entry;
}

Expand Down Expand Up @@ -1176,13 +1179,13 @@
info.segmentPosForNewSegment = this->nextSegmentPos;
info.entryCnt = this->attachmentDirectory.GetAttachmentCount();
info.enumEntriesFunc = [&](const std::function<void(size_t, const CCziAttachmentsDirectoryBase::AttachmentEntry&)>& f)->void
{
this->attachmentDirectory.EnumEntries([&](size_t index, const CCziAttachmentsDirectoryBase::AttachmentEntry& e)->bool
{
f(index, e);
return true;
});
};
{
this->attachmentDirectory.EnumEntries([&](size_t index, const CCziAttachmentsDirectoryBase::AttachmentEntry& e)->bool
{
f(index, e);
return true;
});
};
info.writeFunc = std::bind(&CCziWriter::WriteToOutputStream, this, placeholders::_1, placeholders::_2, placeholders::_3, placeholders::_4, placeholders::_5);
auto posAndSize = CWriterUtils::WriteAttachmentDirectory(info);
if (get<0>(posAndSize) == info.segmentPosForNewSegment)
Expand Down Expand Up @@ -1217,13 +1220,13 @@

info.segmentPosForNewSegment = this->nextSegmentPos;
info.enumEntriesFunc = [&](const std::function<void(size_t, const CCziSubBlockDirectoryBase::SubBlkEntry&)>& f)->void
{
this->sbBlkDirectory.EnumEntries([&](size_t index, const CCziSubBlockDirectoryBase::SubBlkEntry& e)->bool
{
f(index, e);
return true;
});
};
{
this->sbBlkDirectory.EnumEntries([&](size_t index, const CCziSubBlockDirectoryBase::SubBlkEntry& e)->bool
{
f(index, e);
return true;
});
};
info.writeFunc = std::bind(&CCziWriter::WriteToOutputStream, this, placeholders::_1, placeholders::_2, placeholders::_3, placeholders::_4, placeholders::_5);
auto posAndSize = CWriterUtils::WriteSubBlkDirectory(info);
if (get<0>(posAndSize) == info.segmentPosForNewSegment)
Expand Down
8 changes: 6 additions & 2 deletions Src/libCZI/libCZI.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ namespace libCZI
/// The M-index of the sub-block (if available). If not available, it has the value std::numeric_limits<int>::max() or std::numeric_limits<int>::min().
int mIndex;

/// This field indicates the "pyramid-type" of the sub-block. The significance and importance of this field is unclear, and is considered
/// legacy. It is recommended to ignore this field.
SubBlockPyramidType pyramidType;

/// Calculate a zoom-factor from the physical- and logical size.
/// \remark
/// This calculation not really well-defined.
Expand Down Expand Up @@ -351,7 +355,7 @@ namespace libCZI
/// \return The raw data.
virtual std::shared_ptr<const void> GetRawData(size_t* ptrSize) = 0;

virtual ~IAttachment() {}
virtual ~IAttachment() = default;

/// A helper method used to cast the pointer to a specific type.
/// \param [out] ptr The pointer to the data is stored here.
Expand Down Expand Up @@ -595,7 +599,7 @@ namespace libCZI
/// functor is true, the enumeration is continued, otherwise it is stopped.
/// The first argument is the index of the attachment and the second is providing
/// information about the attachment.
virtual void EnumerateSubset(const char* contentFileType, const char* name, const std::function<bool(int index, const AttachmentInfo& infi)>& funcEnum) = 0;
virtual void EnumerateSubset(const char* contentFileType, const char* name, const std::function<bool(int index, const AttachmentInfo& info)>& funcEnum) = 0;

/// Reads the attachment identified by the specified index. If there is no attachment present (for
/// the specified index) then an empty shared_ptr is returned. If a different kind of problem
Expand Down
Loading