Class ISite#
Defined in File libCZI_Site.h
Class Documentation#
-
class ISite#
Interface for the Site-object. It is intended for customizing the library (by injecting a custom implementation of this interface).
Public Types
Public Functions
-
virtual bool IsEnabled(int logLevel) = 0#
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:
logLevel – The logging level.
- Returns:
True if the specified logging level is enabled, false otherwise.
-
virtual void Log(int level, const char *szMsg) = 0#
Output the specified string at the specified logging level.
Remark
The text is assumed to be ASCII - not UTF8 or any other codepage. Use only plain-ASCII. This might change…
- Parameters:
level – The logging level.
szMsg – The message to be logged.
-
virtual std::shared_ptr<IDecoder> GetDecoder(ImageDecoderType type, const char *arguments) = 0#
Gets a decoder object.
- Parameters:
type – The type.
arguments – The arguments.
- Returns:
The decoder object.
-
virtual std::shared_ptr<libCZI::IBitmapData> 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) = 0#
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:
pixeltype – The pixeltype of the newly allocated bitmap.
width – The width of the newly allocated bitmap.
height – The height of the newly allocated bitmap.
stride – The 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.
extraRows – The extra rows (not currently used, will always be 0).
extraColumns – The extra columns (not currently used, will always be 0).
- Returns:
The newly allocated bitmap.
-
virtual void TerminateProgram(TerminationReason reason, const char *message) = 0#
This method is called in order to terminate the program in case of an unrecoverable error.
- Parameters:
reason – An enumeration specifying the reason for abnormal termination.
message – An informative text detailing the reason for abnormal termination.
-
inline void Log(int level, const std::string &str)#
Output the specified string at the specified logging level.
- Parameters:
level – The level.
str – The string.
-
inline void Log(int level, std::stringstream &ss)#
Output the specified stringstream object at the specified logging level.
- Parameters:
level – The level.
ss – [in] The stringstream object.
-
virtual bool IsEnabled(int logLevel) = 0#