13 #if !defined(_LIBCZISTATICLIB) && !defined(__GNUC__)
17 #if defined(LIBCZI_EXPORTS)
19 template class LIBCZI_API std::function<bool(
int callCnt,
size_t offset,
const void*& ptr,
size_t& size)>;
20 template class LIBCZI_API std::function<
const void* (
int line)>;
22 extern template class LIBCZI_API std::function<bool(
int callCnt,
size_t offset,
const void*& ptr,
size_t& size)>;
23 extern template class LIBCZI_API std::function<
const void* (
int line)>;
107 size_t reservedSizeAttachmentsDir, reservedSizeSubBlkDir, reservedSizeMetadataSegment;
108 bool reservedSizeAttachmentsDirValid, reservedSizeSubBlkDirValid, reservedSizeMetadataSegmentValid;
111 CCziWriterInfo() :
CCziWriterInfo(
GUID{ 0,0,0,{0,0,0,0,0,0,0,0} })
121 : fileGuid(fileGuid), reservedSizeAttachmentsDirValid(false), reservedSizeSubBlkDirValid(false), reservedSizeMetadataSegmentValid(false)
123 this->SetDimBounds(
nullptr);
124 this->SetMIndexBounds(mMin, mMax);
135 : fileGuid(fileGuid), reservedSizeAttachmentsDirValid(false), reservedSizeSubBlkDirValid(false), reservedSizeMetadataSegmentValid(false)
137 this->SetDimBounds(&bounds);
138 this->SetMIndexBounds(mMin, mMax);
143 bool TryGetMIndexMinMax(
int* min,
int* max)
const override;
144 bool TryGetReservedSizeForAttachmentDirectory(
size_t* size)
const override;
145 bool TryGetReservedSizeForSubBlockDirectory(
size_t* size)
const override;
146 bool TryGetReservedSizeForMetadataSegment(
size_t* size)
const override;
152 void SetReservedSizeForAttachmentsDirectory(
bool reserveSpace,
size_t s);
158 void SetReservedSizeForSubBlockDirectory(
bool reserveSpace,
size_t s);
164 void SetReservedSizeForMetadataSegment(
bool reserveSpace,
size_t s);
174 void SetMIndexBounds(
int mMin,
int mMax);
206 virtual void Clear();
246 std::function<bool(
int callCnt,
size_t offset,
const void*& ptr,
size_t& size)>
getData;
255 std::function<bool(
int callCnt,
size_t offset,
const void*& ptr,
size_t& size)>
getMetaData;
264 std::function<bool(
int callCnt,
size_t offset,
const void*& ptr,
size_t& size)>
getAttachment;
267 void Clear()
override;
277 ptrData(nullptr), dataSize(0), ptrSbBlkMetadata(nullptr), sbBlkMetadataSize(0), ptrSbBlkAttachment(nullptr), sbBlkAttachmentSize(0)
290 void Clear()
override;
300 ptrBitmap(nullptr), strideBitmap(0), ptrSbBlkMetadata(nullptr), sbBlkMetadataSize(0), ptrSbBlkAttachment(nullptr), sbBlkAttachmentSize(0)
313 void Clear()
override;
327 std::function<
const void* (
int line)> getBitmapLine;
336 void Clear()
override;
346 std::uint8_t contentFileType[8];
349 std::uint8_t name[80];
360 memset(this->contentFileType, 0,
sizeof(this->contentFileType));
361 const auto len = strlen(sz);
362 memcpy(this->contentFileType, sz, (std::min)(
sizeof(this->contentFileType), len));
371 memset(this->name, 0,
sizeof(this->name));
372 const auto len = strlen(sz);
373 memcpy(this->name, sz, (std::min)(
sizeof(this->name), len));
386 void Clear() { memset(
this, 0,
sizeof(*
this)); }
398 std::function<std::tuple<std::string, std::tuple<bool, std::string>>(int)> funcGenerateIdAndNameForChannel;
415 virtual void Create(std::shared_ptr<IOutputStream> stream, std::shared_ptr<ICziWriterInfo> info) = 0;
475 inline void AddSubBlockInfoBase::Clear()
477 this->coordinate.Clear();
478 this->mIndexValid =
false;
479 this->x = (std::numeric_limits<int>::min)();
480 this->y = (std::numeric_limits<int>::min)();
481 this->logicalWidth = 0;
482 this->logicalHeight = 0;
483 this->physicalWidth = 0;
484 this->physicalHeight = 0;
487 this->SetCompressionMode(CompressionMode::UnCompressed);
490 inline void AddSubBlockInfoMemPtr::Clear()
492 this->AddSubBlockInfoBase::Clear();
493 this->ptrData =
nullptr;
495 this->ptrSbBlkMetadata =
nullptr;
496 this->sbBlkMetadataSize = 0;
497 this->ptrSbBlkAttachment =
nullptr;
498 this->sbBlkAttachmentSize = 0;
501 inline void AddSubBlockInfoLinewiseBitmap::Clear()
503 this->AddSubBlockInfoBase::Clear();
504 this->getBitmapLine =
nullptr;
505 this->ptrSbBlkMetadata =
nullptr;
506 this->sbBlkMetadataSize = 0;
507 this->ptrSbBlkAttachment =
nullptr;
508 this->sbBlkAttachmentSize = 0;
511 inline void AddSubBlockInfo::Clear()
513 this->AddSubBlockInfoBase::Clear();
515 this->getData =
nullptr;
516 this->sizeMetadata = 0;
517 this->getMetaData =
nullptr;
518 this->sizeAttachment = 0;
519 this->getAttachment =
nullptr;
522 inline void AddSubBlockInfoStridedBitmap::Clear()
524 this->AddSubBlockInfoBase::Clear();
525 this->ptrBitmap =
nullptr;
526 this->strideBitmap = 0;
527 this->ptrSbBlkMetadata =
nullptr;
528 this->sbBlkMetadataSize = 0;
529 this->ptrSbBlkAttachment =
nullptr;
530 this->sbBlkAttachmentSize = 0;
533 inline bool CCziWriterInfo::TryGetMIndexMinMax(
int* min,
int* max)
const
535 if (!this->mBoundsValid)
540 if (min !=
nullptr) { *min = this->mMin; }
541 if (max !=
nullptr) { *max = this->mMax; }
545 inline bool CCziWriterInfo::TryGetReservedSizeForAttachmentDirectory(
size_t* size)
const
547 if (this->reservedSizeAttachmentsDirValid)
551 *size = this->reservedSizeAttachmentsDir;
560 inline bool CCziWriterInfo::TryGetReservedSizeForSubBlockDirectory(
size_t* size)
const
562 if (this->reservedSizeSubBlkDirValid)
566 *size = this->reservedSizeSubBlkDir;
575 inline bool CCziWriterInfo::TryGetReservedSizeForMetadataSegment(
size_t* size)
const
577 if (this->reservedSizeMetadataSegmentValid)
581 *size = this->reservedSizeMetadataSegment;
590 inline void CCziWriterInfo::SetReservedSizeForAttachmentsDirectory(
bool reserveSpace,
size_t s)
592 this->reservedSizeAttachmentsDirValid = reserveSpace;
595 this->reservedSizeAttachmentsDir = s;
599 inline void CCziWriterInfo::SetReservedSizeForSubBlockDirectory(
bool reserveSpace,
size_t s)
601 this->reservedSizeSubBlkDirValid = reserveSpace;
604 this->reservedSizeSubBlkDir = s;
608 inline void CCziWriterInfo::SetReservedSizeForMetadataSegment(
bool reserveSpace,
size_t s)
610 this->reservedSizeMetadataSegmentValid = reserveSpace;
613 this->reservedSizeMetadataSegment = s;
617 inline void CCziWriterInfo::SetDimBounds(
const IDimBounds* bounds)
619 if (bounds ==
nullptr)
621 this->dimBoundsValid =
false;
626 this->dimBoundsValid =
true;
630 inline void CCziWriterInfo::SetMIndexBounds(
int mMin,
int mMax)
634 this->mBoundsValid =
false;
640 this->mBoundsValid =
true;
An implementation of the ICziWriterInfo-interface.
Definition: libCZI_Write.h:100
CCziWriterInfo()
Default constructor - sets all information to "invalid" and sets fileGuid to GUID_NULL.
Definition: libCZI_Write.h:111
const GUID & GetFileGuid() const override
Definition: libCZI_Write.h:142
const IDimBounds * GetDimBounds() const override
Definition: libCZI_Write.h:141
CCziWriterInfo(const GUID &fileGuid, const IDimBounds &bounds, int mMin=1, int mMax=-1)
Definition: libCZI_Write.h:134
CCziWriterInfo(const GUID &fileGuid, int mMin=1, int mMax=-1)
Definition: libCZI_Write.h:120
Implementation of a class representing an interval (and implementing the libCZI::IDimBounds-interface...
Definition: libCZI_DimCoordinate.h:288
Implementation of a class representing a coordinate (and implementing the IDimCoordinate-interface).
Definition: libCZI_DimCoordinate.h:149
Definition: libCZI_Write.h:408
virtual void SyncAddAttachment(const AddAttachmentInfo &addAttachmentInfo)=0
void SyncAddSubBlock(const AddSubBlockInfoStridedBitmap &addSbBlkInfoStrideBitmap)
virtual libCZI::SubBlockStatistics GetStatistics() const =0
void SyncAddSubBlock(const AddSubBlockInfoMemPtr &addSbBlkInfo)
virtual void Create(std::shared_ptr< IOutputStream > stream, std::shared_ptr< ICziWriterInfo > info)=0
virtual std::shared_ptr< libCZI::ICziMetadataBuilder > GetPreparedMetadata(const PrepareMetadataInfo &info)=0
void SyncAddSubBlock(const libCZI::AddSubBlockInfoLinewiseBitmap &addSbInfoLinewise)
virtual void SyncAddSubBlock(const AddSubBlockInfo &addSbBlkInfo)=0
virtual void SyncWriteMetadata(const WriteMetadataInfo &metadataInfo)=0
The options for the CZI-writer.
Definition: libCZI_Write.h:32
virtual bool TryGetReservedSizeForMetadataSegment(size_t *size) const =0
virtual bool TryGetReservedSizeForSubBlockDirectory(size_t *size) const =0
virtual bool TryGetMIndexMinMax(int *min, int *max) const =0
virtual const GUID & GetFileGuid() const =0
virtual const IDimBounds * GetDimBounds() const =0
virtual bool TryGetReservedSizeForAttachmentDirectory(size_t *size) const =0
Interface used to represent an interval (for several dimensions).
Definition: libCZI_DimCoordinate.h:80
static std::int32_t CompressionModeToCompressionIdentifier(libCZI::CompressionMode mode)
static libCZI::CompressionMode CompressionModeFromRawCompressionIdentifier(std::int32_t m)
External interfaces, classes, functions and structs are found in the namespace "libCZI".
Definition: libCZI.h:31
CompressionMode
An enum specifying the compression method.
Definition: libCZI_Pixels.h:131
SubBlockPyramidType
Definition: libCZI_Pixels.h:144
@ None
No pyramid (indicating that the subblock is not a pyramid subblock, but a layer-0 subblock).
PixelType
An enum representing a pixel-type.
Definition: libCZI_Pixels.h:114
@ Invalid
Invalid pixel type.
This struct describes an attachment to be added to a CZI-file.
Definition: libCZI_Write.h:341
void SetContentFileType(const char *sz)
Definition: libCZI_Write.h:358
std::uint32_t dataSize
Size of the attachment data (in bytes).
Definition: libCZI_Write.h:352
void SetName(const char *sz)
Definition: libCZI_Write.h:369
GUID contentGuid
Unique identifier for the content.
Definition: libCZI_Write.h:343
const void * ptrData
Pointer to the attachment data.
Definition: libCZI_Write.h:351
Information about a subblock.
Definition: libCZI_Write.h:179
std::int32_t compressionModeRaw
Definition: libCZI_Write.h:203
libCZI::PixelType PixelType
The pixel type of the subblock.
Definition: libCZI_Write.h:194
int logicalHeight
The logical height of the subblock (in pixels).
Definition: libCZI_Write.h:191
libCZI::SubBlockPyramidType pyramid_type
Definition: libCZI_Write.h:195
int physicalWidth
The physical with of the subblock (in pixels).
Definition: libCZI_Write.h:192
bool mIndexValid
Whether the field 'mIndex' is valid;.
Definition: libCZI_Write.h:186
libCZI::CompressionMode GetCompressionMode() const
Definition: libCZI_Write.h:218
void SetCompressionMode(libCZI::CompressionMode m)
Definition: libCZI_Write.h:210
int x
The x-coordinate of the subblock.
Definition: libCZI_Write.h:188
int mIndex
The M-index of the subblock.
Definition: libCZI_Write.h:187
int physicalHeight
The physical height of the subblock (in pixels).
Definition: libCZI_Write.h:193
libCZI::CDimCoordinate coordinate
The subblock's coordinate.
Definition: libCZI_Write.h:185
int logicalWidth
The logical with of the subblock (in pixels).
Definition: libCZI_Write.h:190
AddSubBlockInfoBase()
Default constructor.
Definition: libCZI_Write.h:181
int y
The x-coordinate of the subblock.
Definition: libCZI_Write.h:189
Definition: libCZI_Write.h:228
std::function< bool(int callCnt, size_t offset, const void *&ptr, size_t &size)> getMetaData
Definition: libCZI_Write.h:255
AddSubBlockInfo(const AddSubBlockInfoBase &other)
Definition: libCZI_Write.h:235
std::function< bool(int callCnt, size_t offset, const void *&ptr, size_t &size)> getAttachment
Definition: libCZI_Write.h:264
size_t sizeData
The size of the subblock's data in bytes.
Definition: libCZI_Write.h:239
size_t sizeMetadata
The size of the subblock's metadata in bytes (note: max value is (numeric_limits<int>::max() ).
Definition: libCZI_Write.h:248
AddSubBlockInfo()
Default constructor.
Definition: libCZI_Write.h:230
std::function< bool(int callCnt, size_t offset, const void *&ptr, size_t &size)> getData
Definition: libCZI_Write.h:246
size_t sizeAttachment
The size of the subblock's attachment in bytes (note: max value is (numeric_limits<int>::max() ).
Definition: libCZI_Write.h:257
Definition: libCZI_Write.h:320
std::uint32_t sbBlkMetadataSize
The size of the subblock-metadata in bytes. If this is 0, then ptrSbBlkMetadata is not used (and no s...
Definition: libCZI_Write.h:330
AddSubBlockInfoLinewiseBitmap()
Default constructor.
Definition: libCZI_Write.h:322
const void * ptrSbBlkMetadata
Pointer to the subblock-metadata.
Definition: libCZI_Write.h:329
std::uint32_t sbBlkAttachmentSize
The size of the subblock-attachment in bytes. If this is 0, then ptrSbBlkMetadata is not used (and no...
Definition: libCZI_Write.h:333
const void * ptrSbBlkAttachment
Pointer to the subblock-attachment.
Definition: libCZI_Write.h:332
Definition: libCZI_Write.h:274
AddSubBlockInfoMemPtr()
Default constructor.
Definition: libCZI_Write.h:276
std::uint32_t dataSize
The size of the data in bytes. If this is 0, then ptrSbBlkMetadata is not used (and no sub-block-data...
Definition: libCZI_Write.h:281
std::uint32_t sbBlkAttachmentSize
The size of the subblock-attachment in bytes. If this is 0, then ptrSbBlkMetadata is not used (and no...
Definition: libCZI_Write.h:287
const void * ptrData
Pointer to the data to be put into the subblock.
Definition: libCZI_Write.h:280
std::uint32_t sbBlkMetadataSize
The size of the subblock-metadata in bytes. If this is 0, then ptrSbBlkMetadata is not used (and no s...
Definition: libCZI_Write.h:284
const void * ptrSbBlkAttachment
Pointer to the subblock-attachment.
Definition: libCZI_Write.h:286
const void * ptrSbBlkMetadata
Pointer to the subblock-metadata.
Definition: libCZI_Write.h:283
Definition: libCZI_Write.h:297
AddSubBlockInfoStridedBitmap()
Default constructor.
Definition: libCZI_Write.h:299
const void * ptrBitmap
Pointer to the the bitmap to be put into the subblock. The size of the memory-block must be (strideBi...
Definition: libCZI_Write.h:303
std::uint32_t sbBlkAttachmentSize
The size of the subblock-attachment in bytes. If this is 0, then ptrSbBlkMetadata is not used (and no...
Definition: libCZI_Write.h:310
const void * ptrSbBlkAttachment
Pointer to the subblock-attachment.
Definition: libCZI_Write.h:309
std::uint32_t strideBitmap
The stride of the bitmap.
Definition: libCZI_Write.h:304
std::uint32_t sbBlkMetadataSize
The size of the subblock-metadata in bytes. If this is 0, then ptrSbBlkMetadata is not used (and no s...
Definition: libCZI_Write.h:307
const void * ptrSbBlkMetadata
Pointer to the subblock-metadata.
Definition: libCZI_Write.h:306
Represents a globally unique identifier (GUID) consisting of four unsigned 32-bit integers.
Definition: libCZI_Utilities.h:25
Statistics about all sub-blocks found in a CZI-document.
Definition: libCZI.h:437