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

#include <libCZI.h>

Public Types

enum  MemBlkType { Metadata , Data , Attachment }
 Values that represent the three different data types found in a sub-block. More...
 

Public Member Functions

virtual const SubBlockInfoGetSubBlockInfo () const =0
 
virtual void DangerousGetRawData (MemBlkType type, const void *&ptr, size_t &size) const =0
 
virtual std::shared_ptr< const void > GetRawData (MemBlkType type, size_t *ptrSize)=0
 
virtual std::shared_ptr< IBitmapDataCreateBitmap ()=0
 
template<class Q >
void DangerousGetRawData (MemBlkType type, const Q *&ptr, size_t &size) const
 

Detailed Description

Representation of a sub-block. A sub-block can contain three types of data: the bitmap-data, an attachment and metadata. The presence of an attachment is optional.

Member Enumeration Documentation

◆ MemBlkType

Values that represent the three different data types found in a sub-block.

Enumerator
Metadata 

An enum constant representing the metadata.

Data 

An enum constant representing the bitmap-data.

Attachment 

An enum constant representing the attachment (of a sub-block).

Member Function Documentation

◆ CreateBitmap()

virtual std::shared_ptr<IBitmapData> libCZI::ISubBlock::CreateBitmap ( )
pure virtual

Creates a bitmap (from the data of this sub-block).

Remarks
Within this call the bitmap is decoded (if necessary). In current implementation, the sub-block does not hold a reference to the returned bitmap here (and, if called twice, a new bitmap is created). One should not rely on this behavior, it is conceivable that in a later version the sub-block will keep a reference (and return the same bitmap if called twice). In current version this method is equivalent to calling CreateBitmapFromSubBlock.
Returns
The bitmap (contained in this sub-block).

◆ DangerousGetRawData() [1/2]

template<class Q >
void libCZI::ISubBlock::DangerousGetRawData ( MemBlkType  type,
const Q *&  ptr,
size_t &  size 
) const
inline

A helper method used to cast the pointer to a specific type.

Parameters
typeThe sub-block data-type.
[out]ptrThe pointer to the data is stored here.
[out]sizeThe size of the data.

◆ DangerousGetRawData() [2/2]

virtual void libCZI::ISubBlock::DangerousGetRawData ( MemBlkType  type,
const void *&  ptr,
size_t &  size 
) const
pure virtual

Get a pointer to the raw data. Note that the pointer returned is only valid during the lifetime of the sub-block-object.

Parameters
typeThe sub-block data-type.
[out]ptrThe pointer to the data is stored here.
[out]sizeThe size of the data.

◆ GetRawData()

virtual std::shared_ptr<const void> libCZI::ISubBlock::GetRawData ( MemBlkType  type,
size_t *  ptrSize 
)
pure virtual

Gets raw data.

Parameters
typeThe type.
[out]ptrSizeIf non-null, size of the data buffer is stored here.
Returns
The raw data.

◆ GetSubBlockInfo()

virtual const SubBlockInfo& libCZI::ISubBlock::GetSubBlockInfo ( ) const
pure virtual

Gets sub-block information.

Returns
The sub-block information.

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