libCZI
Reading and Writing CZI documents made easy
|
#include <libCZI_ReadWrite.h>
Public Member Functions | |
virtual void | Create (std::shared_ptr< IInputOutputStream > stream, std::shared_ptr< ICziReaderWriterInfo > info=nullptr)=0 |
virtual void | ReplaceSubBlock (int key, const AddSubBlockInfo &addSbBlkInfo)=0 |
virtual void | RemoveSubBlock (int key)=0 |
virtual void | ReplaceAttachment (int attchmntId, const AddAttachmentInfo &addAttachmentInfo)=0 |
virtual void | RemoveAttachment (int attchmntId)=0 |
virtual void | SyncAddSubBlock (const AddSubBlockInfo &addSbBlkInfo)=0 |
virtual void | SyncAddAttachment (const AddAttachmentInfo &addAttachmentInfo)=0 |
virtual void | SyncWriteMetadata (const WriteMetadataInfo &metadataInfo)=0 |
virtual std::shared_ptr< IMetadataSegment > | ReadMetadataSegment ()=0 |
virtual FileHeaderInfo | GetFileHeaderInfo ()=0 |
virtual void | Close ()=0 |
void | SyncAddSubBlock (const libCZI::AddSubBlockInfoMemPtr &addSbBlkInfoMemPtr) |
void | SyncAddSubBlock (const libCZI::AddSubBlockInfoLinewiseBitmap &addSbInfoLinewise) |
void | SyncAddSubBlock (const libCZI::AddSubBlockInfoStridedBitmap &addSbBlkInfoStrideBitmap) |
void | ReplaceSubBlock (int key, const libCZI::AddSubBlockInfoMemPtr &addSbBlkInfoMemPtr) |
void | ReplaceSubBlock (int key, const libCZI::AddSubBlockInfoLinewiseBitmap &addSbInfoLinewise) |
void | ReplaceSubBlock (int key, const libCZI::AddSubBlockInfoStridedBitmap &addSbBlkInfoStrideBitmap) |
Public Member Functions inherited from libCZI::ISubBlockRepository | |
virtual void | EnumerateSubBlocks (const std::function< bool(int index, const SubBlockInfo &info)> &funcEnum)=0 |
virtual void | EnumSubset (const IDimCoordinate *planeCoordinate, const IntRect *roi, bool onlyLayer0, const std::function< bool(int index, const SubBlockInfo &info)> &funcEnum)=0 |
virtual std::shared_ptr< ISubBlock > | ReadSubBlock (int index)=0 |
virtual bool | TryGetSubBlockInfoOfArbitrarySubBlockInChannel (int channelIndex, SubBlockInfo &info)=0 |
virtual bool | TryGetSubBlockInfo (int index, SubBlockInfo *info) const =0 |
virtual SubBlockStatistics | GetStatistics ()=0 |
virtual PyramidStatistics | GetPyramidStatistics ()=0 |
Public Member Functions inherited from libCZI::IAttachmentRepository | |
virtual void | EnumerateAttachments (const std::function< bool(int index, const AttachmentInfo &info)> &funcEnum)=0 |
virtual void | EnumerateSubset (const char *contentFileType, const char *name, const std::function< bool(int index, const AttachmentInfo &info)> &funcEnum)=0 |
virtual std::shared_ptr< IAttachment > | ReadAttachment (int index)=0 |
Interface for "in-place-editing" of a CZI. All write-operations immediately go into the file. If the data does not fit into the existing segments, a new segment is appended at the end (and the existing one is marked "DELETED"). All operation is strictly single-threaded. Only exactly one method may be executing at a given point in time. Notes:
|
pure virtual |
Finalizes the CZI (ie. writes out the final directory-segments) and closes the file. Note that this method must be called explicitely in order to get a valid CZI - calling the destructor alone will close the file immediately without finalization.
|
pure virtual |
Initialize the object.
stream | The read-write stream to operate on. |
info | (Optional) Parameters controlling the operation. |
|
pure virtual |
Gets the file header information.
|
pure virtual |
Reads the metadata-segment from the stream. If no metadata-segment is present, then an empty shared_ptr is returned.
|
pure virtual |
Removes the specified attachment. Physically, it is marked as "DELETED".
attchmntId | Identifier for the attachmnt (as reported by IAttachmentRepository::EnumerateAttachments). |
|
pure virtual |
Removes the specified subblock. Physically, it is marked as "DELETED".
key | The key (as retrieved by ISubBlockRepository::EnumerateSubBlocks). |
|
pure virtual |
Replace an existing attachment. The attachment is identified by an index (as reported by IAttachmentRepository::EnumerateAttachments).
attchmntId | Identifier for the attachmnt (as reported by IAttachmentRepository::EnumerateAttachments). |
addAttachmentInfo | Information describing attachment to be added. |
|
pure virtual |
Replace an existing subblock. The subblock is identified by an index (as reported by ISubBlockRepository::EnumerateSubBlocks).
key | The key (as retrieved by ISubBlockRepository::EnumerateSubBlocks). |
addSbBlkInfo | Information describing the subblock to be added. |
void libCZI::ICziReaderWriter::ReplaceSubBlock | ( | int | key, |
const libCZI::AddSubBlockInfoLinewiseBitmap & | addSbInfoLinewise | ||
) |
This helper method uses the structure 'AddSubBlockInfoLinewiseBitmap' in order to describe the subblock to be replaced. What it does is to cast the parameters into the form required by the ICziReaderWriterInfo::ReplaceSubBlock method and call it.
key | The key identifying the subblock to be replaced. |
addSbInfoLinewise | Information describing the subblock to be added. |
void libCZI::ICziReaderWriter::ReplaceSubBlock | ( | int | key, |
const libCZI::AddSubBlockInfoMemPtr & | addSbBlkInfoMemPtr | ||
) |
This helper method uses the structure 'AddSubBlockInfoMemPtr' in order to describe the subblock to be replaced. What it does is to cast the parameters into the form required by the ICziReaderWriterInfo::ReplaceSubBlock method and call it.
key | The key identifying the subblock to be replaced. |
addSbBlkInfoMemPtr | Information describing the subblock to be added. |
void libCZI::ICziReaderWriter::ReplaceSubBlock | ( | int | key, |
const libCZI::AddSubBlockInfoStridedBitmap & | addSbBlkInfoStrideBitmap | ||
) |
This helper method uses the structure 'AddSubBlockInfoStridedBitmap' in order to describe the subblock to be replaced. What it does is to cast the parameters into the form required by the ICziReaderWriterInfo::ReplaceSubBlock method and call it.
key | The key identifying the subblock to be replaced. |
addSbBlkInfoStrideBitmap | Information describing the subblock to be added. |
|
pure virtual |
Adds the specified attachment to the CZI-file.
addAttachmentInfo | Information describing the attachment to be added. |
|
pure virtual |
Adds the specified subblock to the CZI-file.
addSbBlkInfo | Information describing the subblock to be added. |
void libCZI::ICziReaderWriter::SyncAddSubBlock | ( | const libCZI::AddSubBlockInfoLinewiseBitmap & | addSbInfoLinewise | ) |
This helper method uses the structure 'AddSubBlockInfoLinewiseBitmap' in order to describe the subblock to be added. What it does is to cast the parameters into the form required by the ICziReaderWriterInfo::SyncAddSubBlock method and call it.
addSbInfoLinewise | Information describing the subblock to be added. |
void libCZI::ICziReaderWriter::SyncAddSubBlock | ( | const libCZI::AddSubBlockInfoMemPtr & | addSbBlkInfoMemPtr | ) |
This helper method uses the structure 'AddSubBlockInfoMemPtr' in order to describe the subblock to be added. What it does is to cast the parameters into the form required by the ICziReaderWriterInfo::SyncAddSubBlock method and call it.
addSbBlkInfoMemPtr | Information describing the subblock to be added. |
void libCZI::ICziReaderWriter::SyncAddSubBlock | ( | const libCZI::AddSubBlockInfoStridedBitmap & | addSbBlkInfoStrideBitmap | ) |
This helper method uses the structure 'AddSubBlockInfoStridedBitmap' in order to describe the subblock to be added. What it does is to cast the parameters into the form required by the ICziReaderWriterInfo::SyncAddSubBlock method and call it.
addSbBlkInfoStrideBitmap | Information describing the subblock to be added. |
|
pure virtual |
Write metadata segment.
metadataInfo | Information describing the metadata. |