libCZI
Reading and Writing CZI documents made easy
libCZI::ICziWriter Class Referenceabstract

#include <libCZI_Write.h>

Public Member Functions

virtual void Create (std::shared_ptr< IOutputStream > stream, std::shared_ptr< ICziWriterInfo > info)=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< libCZI::ICziMetadataBuilderGetPreparedMetadata (const PrepareMetadataInfo &info)=0
 
virtual void Close ()=0
 
virtual libCZI::SubBlockStatistics GetStatistics () const =0
 
void SyncAddSubBlock (const AddSubBlockInfoMemPtr &addSbBlkInfo)
 
void SyncAddSubBlock (const libCZI::AddSubBlockInfoLinewiseBitmap &addSbInfoLinewise)
 
void SyncAddSubBlock (const AddSubBlockInfoStridedBitmap &addSbBlkInfoStrideBitmap)
 

Detailed Description

This interface is used in order to write a CZI-file. The sequence of operations is: the object is initialized by calling the Create-method. Then use SyncAddSubBlock, SyncAddAttachment and SyncWriteMetadata to put data into the document. Finally, call Close which will finalized the document. Note that this object is not thread-safe. Calls into any of the functions must be synchronized, i. e. at no point in time we may execute different methods (or the same method for that matter) concurrently. The class by itself does not guard itself against concurrent execution.

Member Function Documentation

◆ Close()

virtual void libCZI::ICziWriter::Close ( )
pure virtual

Finalizes the CZI (i.e. 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.

◆ Create()

virtual void libCZI::ICziWriter::Create ( std::shared_ptr< IOutputStream stream,
std::shared_ptr< ICziWriterInfo info 
)
pure virtual

Initialize the writer by passing in the output-stream-object.

Parameters
streamThe stream-object.
infoSettings for document-creation. May be null.
Remarks
If this method is called twice, then an exception of type std::logic_error is thrown.

◆ GetPreparedMetadata()

virtual std::shared_ptr<libCZI::ICziMetadataBuilder> libCZI::ICziWriter::GetPreparedMetadata ( const PrepareMetadataInfo info)
pure virtual

Gets a "pre-filled" metadata object. This metadata object contains the information which is already known by the writer.

Parameters
infoInformation controlling the operation.
Returns
The "pre-filled" metadata object if successful.

◆ GetStatistics()

virtual libCZI::SubBlockStatistics libCZI::ICziWriter::GetStatistics ( ) const
pure virtual

Gets the statistics about the sub-blocks. This statistics is aggregated from the subblocks as they are added.

Returns
The sub-block statistics.

◆ SyncAddAttachment()

virtual void libCZI::ICziWriter::SyncAddAttachment ( const AddAttachmentInfo addAttachmentInfo)
pure virtual

Adds the specified attachment to the CZI-file. This is a synchronous method, meaning that it will return when all data has been written out to the file AND that it must not be called concurrently with other method-invocations of this object.

Parameters
addAttachmentInfoInformation describing attachment to be added.

◆ SyncAddSubBlock() [1/4]

virtual void libCZI::ICziWriter::SyncAddSubBlock ( const AddSubBlockInfo addSbBlkInfo)
pure virtual

Adds the specified subblock to the CZI-file. This is a synchronous method, meaning that it will return when all data has been written out to the file AND that it must not be called concurrently with other method-invocations of this object. If there are bounds specified (with the 'info'-argument to 'Create') then the coordinate is checked against the bounds. In case of any error, an exception is thrown.

Parameters
addSbBlkInfoInformation describing the subblock to be added.

◆ SyncAddSubBlock() [2/4]

void libCZI::ICziWriter::SyncAddSubBlock ( const AddSubBlockInfoMemPtr addSbBlkInfo)

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 ICziWriter::SyncAddSubBlock method and call it.

Parameters
addSbBlkInfoInformation describing the subblock to be added.

◆ SyncAddSubBlock() [3/4]

void libCZI::ICziWriter::SyncAddSubBlock ( const 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 ICziWriter::SyncAddSubBlock method and call it.

Parameters
addSbBlkInfoStrideBitmapInformation describing the subblock to be added.

◆ SyncAddSubBlock() [4/4]

void libCZI::ICziWriter::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 ICziWriter::SyncAddSubBlock method and call it.

Parameters
addSbInfoLinewiseInformation describing the subblock to be added.

◆ SyncWriteMetadata()

virtual void libCZI::ICziWriter::SyncWriteMetadata ( const WriteMetadataInfo metadataInfo)
pure virtual

Adds the specified metadata to the CZI-file. This is a synchronous method, meaning that it will return when all data has been written out to the file AND that it must not be called concurrently with other method-invocations of this object.

Parameters
metadataInfoInformation describing the metadata to be added.

The documentation for this class was generated from the following file: