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

#include <libCZI_Site.h>

Public Member Functions

virtual bool IsEnabled (int logLevel)=0
 
virtual void Log (int level, const char *szMsg)=0
 
virtual std::shared_ptr< IDecoderGetDecoder (ImageDecoderType type, const char *arguments)=0
 
virtual std::shared_ptr< libCZI::IBitmapDataCreateBitmap (libCZI::PixelType pixeltype, std::uint32_t width, std::uint32_t height, std::uint32_t stride=0, std::uint32_t extraRows=0, std::uint32_t extraColumns=0)=0
 
void Log (int level, const std::string &str)
 
void Log (int level, std::stringstream &ss)
 

Detailed Description

Interface for the Site-object. It is intented for customizing the library (by injecting a custom implementation of this interface).

Member Function Documentation

◆ CreateBitmap()

virtual std::shared_ptr<libCZI::IBitmapData> libCZI::ISite::CreateBitmap ( libCZI::PixelType  pixeltype,
std::uint32_t  width,
std::uint32_t  height,
std::uint32_t  stride = 0,
std::uint32_t  extraRows = 0,
std::uint32_t  extraColumns = 0 
)
pure virtual

Creates a bitmap object. All internal bitmap allocations are done with this method, and overloading this method allows to use an externally controlled memory management to be injected.

Parameters
pixeltypeThe pixeltype of the newly allocated bitmap.
widthThe width of the newly allocated bitmap.
heightThe height of the newly allocated bitmap.
strideThe stride of the newly allocated bitmap. If <= 0, then the method may choose an appropriate stride on its own. If a stride >0 is given here, then we expect that the newly created bitmap adheres to it.
extraRowsThe extra rows (not currently used, will always be 0).
extraColumnsThe extra columns (not currently used, will always be 0).
Returns
The newly allocated bitmap.

◆ GetDecoder()

virtual std::shared_ptr<IDecoder> libCZI::ISite::GetDecoder ( ImageDecoderType  type,
const char *  arguments 
)
pure virtual

Gets a decoder object.

Parameters
typeThe type.
argumentsThe arguments.
Returns
The decoder object.

◆ IsEnabled()

virtual bool libCZI::ISite::IsEnabled ( int  logLevel)
pure virtual

Query if the specified logging level is enabled. In the case that constructing the message to be logged takes a significant amount of resources (i. e. time or memory), this method should be called before in order to determine whether the output is required at all. This also means that this method may be called very frequently, so implementors should take care that it executes reasonably fast.

Parameters
logLevelThe logging level.
Returns
True if the specified logging level is enabled, false otherwise.

◆ Log() [1/3]

virtual void libCZI::ISite::Log ( int  level,
const char *  szMsg 
)
pure virtual

Output the specified string at the specified logging level.

Remarks
The text is assumed to be ASCII - not UTF8 or any other codepage. Use only plain-ASCII. This might change...
Parameters
levelThe logging level.
szMsgThe message to be logged.

◆ Log() [2/3]

void libCZI::ISite::Log ( int  level,
const std::string &  str 
)
inline

Output the specified string at the specified logging level.

Parameters
levelThe level.
strThe string.

◆ Log() [3/3]

void libCZI::ISite::Log ( int  level,
std::stringstream &  ss 
)
inline

Output the specified stringstream object at the specified logging level.

Parameters
levelThe level.
[in]ssThe stringstream object.

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