libCZI
Reading and Writing CZI documents made easy
Loading...
Searching...
No Matches
libCZI_Site.h
1// SPDX-FileCopyrightText: 2017-2022 Carl Zeiss Microscopy GmbH
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#pragma once
6
7#include <sstream>
8#include <memory>
9#include <string>
10#include "libCZI_Pixels.h"
11
12namespace libCZI
13{
17 {
19
20 ZStd0,
21
22 ZStd1
23 };
24
25 class IBitmapData;
26
29 {
30 public:
31
47 virtual std::shared_ptr<libCZI::IBitmapData> Decode(const void* ptrData, size_t size, libCZI::PixelType pixelType, std::uint32_t width, std::uint32_t height) = 0;
48
49 virtual ~IDecoder() = default;
50 };
51
53 const int LOGLEVEL_ERROR = 1;
54 const int LOGLEVEL_SEVEREWARNING = 2;
55 const int LOGLEVEL_WARNING = 3;
56 const int LOGLEVEL_INFORMATION = 4;
58
61 class ISite
62 {
63 public:
73 virtual bool IsEnabled(int logLevel) = 0;
74
81 virtual void Log(int level, const char* szMsg) = 0;
82
89 virtual std::shared_ptr<IDecoder> GetDecoder(ImageDecoderType type, const char* arguments) = 0;
90
103 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;
104
108 void Log(int level, const std::string& str)
109 {
110 this->Log(level, str.c_str());
111 }
112
116 void Log(int level, std::stringstream& ss)
117 {
118 this->Log(level, ss.str());
119 }
120 };
121}
The interface used for operating image decoder. That is the simplest possible interface at this point...
Definition libCZI_Site.h:29
virtual std::shared_ptr< libCZI::IBitmapData > Decode(const void *ptrData, size_t size, libCZI::PixelType pixelType, std::uint32_t width, std::uint32_t height)=0
Definition libCZI_Site.h:62
void Log(int level, std::stringstream &ss)
Definition libCZI_Site.h:116
virtual bool IsEnabled(int logLevel)=0
virtual void Log(int level, const char *szMsg)=0
virtual std::shared_ptr< IDecoder > GetDecoder(ImageDecoderType type, const char *arguments)=0
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
void Log(int level, const std::string &str)
Definition libCZI_Site.h:108
External interfaces, classes, functions and structs are found in the namespace "libCZI".
Definition libCZI.h:31
const int LOGLEVEL_INFORMATION
Identifies an informational output. It has no impact on the proper operation.
Definition libCZI_Site.h:56
const int LOGLEVEL_ERROR
Identifies a non-recoverable error.
Definition libCZI_Site.h:53
const int LOGLEVEL_CATASTROPHICERROR
Identifies a catastrophic error (i. e. the program cannot continue).
Definition libCZI_Site.h:52
ImageDecoderType
Definition libCZI_Site.h:17
@ ZStd0
Identifies a decoder capable of decoding a zstd compressed image (type "zstd0").
@ JPXR_JxrLib
Identifies an decoder capable of decoding a JPG-XR compressed image.
@ ZStd1
Identifies a decoder capable of decoding a zstd compressed image (type "zstd1").
const int LOGLEVEL_WARNING
Identifies that a problem has been identified. It is likely that proper operation can be kept up.
Definition libCZI_Site.h:55
PixelType
An enum representing a pixel-type.
Definition libCZI_Pixels.h:144
const int LOGLEVEL_CHATTYINFORMATION
Identifies an informational output which has no impact on proper operation. Use this for output which...
Definition libCZI_Site.h:57
const int LOGLEVEL_SEVEREWARNING
Identifies that a severe problem has occured. Proper operation of the module is not ensured.
Definition libCZI_Site.h:54