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

Interface for sub-block repository. This interface is used to access the sub-blocks in a CZI-file. More...

#include <libCZI.h>

Inheritance diagram for libCZI::ISubBlockRepository:
libCZI::ICZIReader libCZI::ICziReaderWriter

Public Member Functions

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< ISubBlockReadSubBlock (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
 

Detailed Description

Interface for sub-block repository. This interface is used to access the sub-blocks in a CZI-file.

Member Function Documentation

◆ EnumerateSubBlocks()

virtual void libCZI::ISubBlockRepository::EnumerateSubBlocks ( const std::function< bool(int index, const SubBlockInfo &info)> &  funcEnum)
pure virtual

Enumerate all sub-blocks.

Parameters
funcEnumThe functor which will be called for every sub-block. If the return value of the functor is true, the enumeration is continued, otherwise it is stopped. The first argument is the index of the sub-block and the second is providing information about the sub-block.

◆ EnumSubset()

virtual void libCZI::ISubBlockRepository::EnumSubset ( const IDimCoordinate planeCoordinate,
const IntRect roi,
bool  onlyLayer0,
const std::function< bool(int index, const SubBlockInfo &info)> &  funcEnum 
)
pure virtual

Enumerate the subset of sub-blocks defined by the parameters.

Parameters
planeCoordinateThe plane coordinate. Only sub-blocks on this plane will be considered.
roiThe ROI - only sub-blocks which intersects with this ROI will be considered.
onlyLayer0If true, then only sub-blocks on pyramid-layer 0 will be considered.
funcEnumThe functor which will be called for every sub-block. If the return value of the functor is true, the enumeration is continued, otherwise it is stopped. The first argument is the index of the sub-block and the second is providing information about the sub-block.

◆ GetPyramidStatistics()

virtual PyramidStatistics libCZI::ISubBlockRepository::GetPyramidStatistics ( )
pure virtual

Gets the statistics about the pyramid-layers. This information is constructed from all T, Z, C, ... Pyramids are constructed per scene in CZI.

Returns
The pyramid statistics.

◆ GetStatistics()

virtual SubBlockStatistics libCZI::ISubBlockRepository::GetStatistics ( )
pure virtual

Gets the statistics about the sub-blocks (determined from examining all sub-blocks).

Returns
The sub-block statistics.

◆ ReadSubBlock()

virtual std::shared_ptr<ISubBlock> libCZI::ISubBlockRepository::ReadSubBlock ( int  index)
pure virtual

Reads the sub-block identified by the specified index. If there is no sub-block present (for the specified index) then an empty shared_ptr is returned. If a different kind of problem occurs (e. g. I/O error or corrupted data) an exception is thrown.

Parameters
indexIndex of the sub-block (as reported by the Enumerate-methods).
Returns
If successful, the sub-block object; otherwise an empty shared_ptr.

◆ TryGetSubBlockInfo()

virtual bool libCZI::ISubBlockRepository::TryGetSubBlockInfo ( int  index,
SubBlockInfo info 
) const
pure virtual

Attempts to get the subblock information of the subblock with the specified index. If the specified index is not valid, then false is returned.

Parameters
indexIndex of the subblock to query information for.
[in,out]infoIf non-null and operation is successful, then the information is put here.
Returns
True if it succeeds; false otherwise.

◆ TryGetSubBlockInfoOfArbitrarySubBlockInChannel()

virtual bool libCZI::ISubBlockRepository::TryGetSubBlockInfoOfArbitrarySubBlockInChannel ( int  channelIndex,
SubBlockInfo info 
)
pure virtual

Attempts to get subblock information of an arbitrary subblock in of the specified channel. The purpose is that it is quite often necessary to determine the pixeltype of a channel - and if we do not want to/cannot rely on metadata for determining this, then the obvious way is to look at an (arbitrary) subblock. In order to allow the repository to have this information available fast (i. e. cached) we introduce a specific method for this purpose. A cornerstone case is when no subblock has a channel-index - the rule is: if no subblock has channel- information, then a channelIndex of 0 fits. Otherwise a subblock is a match if the channel- index is an exact match.

Parameters
channelIndexThe channel index.
[out]infoThe sub-block information (will be set only if the method is successful).
Returns
true if it succeeds, false if it fails.

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