14 #include "ImportExport.h"
16 #include "libCZI_exceptions.h"
17 #include "libCZI_DimCoordinate.h"
18 #include "libCZI_Pixels.h"
19 #include "libCZI_Metadata.h"
20 #include "libCZI_Metadata2.h"
21 #include "libCZI_Utilities.h"
22 #include "libCZI_Compositor.h"
23 #include "libCZI_Site.h"
24 #include "libCZI_compress.h"
25 #include "libCZI_StreamsLib.h"
93 LIBCZI_API
void GetLibCZIVersion(
int* pMajor,
int* pMinor =
nullptr,
int* pPatch =
nullptr,
int* pTweak =
nullptr);
205 virtual void Read(std::uint64_t offset,
void* pv, std::uint64_t size, std::uint64_t* ptrBytesRead) = 0;
224 virtual void Write(std::uint64_t offset,
const void* pv, std::uint64_t size, std::uint64_t* ptrBytesWritten) = 0;
266 if (this->physicalSize.
w > this->physicalSize.h)
268 return static_cast<double>(this->physicalSize.
w) / this->logicalRect.
w;
271 return static_cast<double>(this->physicalSize.
h) / this->logicalRect.
h;
349 ptr =
static_cast<const Q*
>(p);
378 virtual std::shared_ptr<const void>
GetRawData(
size_t* ptrSize) = 0;
390 ptr =
static_cast<Q*
>(p);
474 return this->minMindex <= this->maxMindex ? true :
false;
480 this->subBlockCount = -1;
483 this->dimBounds.
Clear();
484 this->sceneBoundingBoxes.clear();
485 this->minMindex = (std::numeric_limits<int>::max)();
486 this->maxMindex = (std::numeric_limits<int>::min)();
510 bool IsLayer0()
const {
return this->minificationFactor == 0 && this->pyramidLayerNo == 0; }
624 virtual void EnumerateSubset(
const char* contentFileType,
const char* name,
const std::function<
bool(
int index,
const AttachmentInfo& info)>& funcEnum) = 0;
660 bool lax_subblock_coordinate_checks{
true };
668 bool ignore_sizem_for_pyramid_subblocks{
false };
673 this->lax_subblock_coordinate_checks =
true;
687 virtual void Open(
const std::shared_ptr<IStream>& stream,
const OpenOptions* options =
nullptr) = 0;
741 #include "libCZI_Helpers.h"
742 #include "libCZI_Write.h"
743 #include "libCZI_ReadWrite.h"
Implementation of a class representing an interval (and implementing the libCZI::IDimBounds-interface...
Definition: libCZI_DimCoordinate.h:288
void Clear(libCZI::DimensionIndex dimension)
Definition: libCZI_DimCoordinate.h:356
Implementation of a class representing a coordinate (and implementing the IDimCoordinate-interface).
Definition: libCZI_DimCoordinate.h:149
Representation of an attachment. An attachment is a binary blob, its inner structure is opaque.
Definition: libCZI.h:363
virtual std::shared_ptr< const void > GetRawData(size_t *ptrSize)=0
void DangerousGetRawData(const Q *&ptr, size_t &size) const
Definition: libCZI.h:386
virtual void DangerousGetRawData(const void *&ptr, size_t &size) const =0
virtual const AttachmentInfo & GetAttachmentInfo() const =0
Interface for the attachment repository. This interface is used to access the attachments in a CZI-fi...
Definition: libCZI.h:607
virtual std::shared_ptr< IAttachment > ReadAttachment(int index)=0
virtual void EnumerateAttachments(const std::function< bool(int index, const AttachmentInfo &info)> &funcEnum)=0
virtual void EnumerateSubset(const char *contentFileType, const char *name, const std::function< bool(int index, const AttachmentInfo &info)> &funcEnum)=0
virtual std::shared_ptr< IAccessor > CreateAccessor(AccessorType accessorType)=0
std::shared_ptr< ISingleChannelTileAccessor > CreateSingleChannelTileAccessor()
Definition: libCZI.h:720
std::shared_ptr< ISingleChannelScalingTileAccessor > CreateSingleChannelScalingTileAccessor()
Definition: libCZI.h:734
virtual std::shared_ptr< IMetadataSegment > ReadMetadataSegment()=0
virtual FileHeaderInfo GetFileHeaderInfo()=0
std::shared_ptr< ISingleChannelPyramidLayerTileAccessor > CreateSingleChannelPyramidLayerTileAccessor()
Definition: libCZI.h:727
virtual void Open(const std::shared_ptr< IStream > &stream, const OpenOptions *options=nullptr)=0
Definition: libCZI_ReadWrite.h:40
Definition: libCZI_Write.h:408
Interface used to represent a coordinate (in the space of the dimensions identified by DimensionIndex...
Definition: libCZI_DimCoordinate.h:37
virtual void Write(std::uint64_t offset, const void *pv, std::uint64_t size, std::uint64_t *ptrBytesWritten)=0
Definition: libCZI_Site.h:62
virtual void Read(std::uint64_t offset, void *pv, std::uint64_t size, std::uint64_t *ptrBytesRead)=0
Definition: libCZI_Compositor.h:138
MemBlkType
Values that represent the three different data types found in a sub-block.
Definition: libCZI.h:304
@ Attachment
An enum constant representing the attachment (of a sub-block).
Definition: libCZI.h:307
@ Data
An enum constant representing the bitmap-data.
Definition: libCZI.h:306
@ Metadata
An enum constant representing the metadata.
Definition: libCZI.h:305
virtual const SubBlockInfo & GetSubBlockInfo() const =0
virtual std::shared_ptr< const void > GetRawData(MemBlkType type, size_t *ptrSize)=0
virtual void DangerousGetRawData(MemBlkType type, const void *&ptr, size_t &size) const =0
void DangerousGetRawData(MemBlkType type, const Q *&ptr, size_t &size) const
Definition: libCZI.h:345
virtual std::shared_ptr< IBitmapData > CreateBitmap()=0
Additional functionality for the subblock-repository, providing some specialized and not commonly use...
Definition: libCZI.h:593
virtual void EnumerateSubBlocksEx(const std::function< bool(int index, const DirectorySubBlockInfo &info)> &funcEnum)=0
Interface for sub-block repository. This interface is used to access the sub-blocks in a CZI-file.
Definition: libCZI.h:532
virtual void EnumerateSubBlocks(const std::function< bool(int index, const SubBlockInfo &info)> &funcEnum)=0
virtual SubBlockStatistics GetStatistics()=0
virtual bool TryGetSubBlockInfo(int index, SubBlockInfo *info) const =0
virtual PyramidStatistics GetPyramidStatistics()=0
virtual void EnumSubset(const IDimCoordinate *planeCoordinate, const IntRect *roi, bool onlyLayer0, const std::function< bool(int index, const SubBlockInfo &info)> &funcEnum)=0
virtual bool TryGetSubBlockInfoOfArbitrarySubBlockInChannel(int channelIndex, SubBlockInfo &info)=0
virtual std::shared_ptr< ISubBlock > ReadSubBlock(int index)=0
static bool IsValidMindex(int mIndex)
Definition: libCZI_Utilities.h:347
static libCZI::CompressionMode CompressionModeFromRawCompressionIdentifier(std::int32_t m)
External interfaces, classes, functions and structs are found in the namespace "libCZI".
Definition: libCZI.h:31
LIBCZI_API std::shared_ptr< IAccessor > CreateAccesor(std::shared_ptr< ISubBlockRepository > repository, AccessorType accessorType)
LIBCZI_API std::shared_ptr< IOutputStream > CreateOutputStreamForFile(const wchar_t *szFilename, bool overwriteExisting)
LIBCZI_API ISite * GetDefaultSiteObject(libCZI::SiteObjectType type)
LIBCZI_API void SetSiteObject(libCZI::ISite *pSite)
LIBCZI_API std::shared_ptr< ICziMetadataBuilder > CreateMetadataBuilder()
CompressionMode
An enum specifying the compression method.
Definition: libCZI_Pixels.h:131
LIBCZI_API std::shared_ptr< ICziMetadata > CreateMetaFromMetadataSegment(IMetadataSegment *metadataSegment)
LIBCZI_API std::shared_ptr< IInputOutputStream > CreateInputOutputStreamForFile(const wchar_t *szFilename)
SubBlockPyramidType
Definition: libCZI_Pixels.h:144
SiteObjectType
Definition: libCZI.h:36
@ WithJxrDecoder
An enum constant representing a Site-object using the internal JXRLib.
@ Default
An enum constant representing the default option (which is JXRLib)
@ WithWICDecoder
An enum constant representing a Site-object using the Windows WIC-codec. Note that this option is onl...
LIBCZI_API std::shared_ptr< IStream > CreateStreamFromFile(const wchar_t *szFilename)
LIBCZI_API std::shared_ptr< ICziMetadataBuilder > CreateMetadataBuilderFromXml(const std::string &xml)
AccessorType
Values that represent the accessor types.
Definition: libCZI_Compositor.h:22
@ SingleChannelTileAccessor
The single-channel-tile accessor (associated interface: ISingleChannelTileAccessor).
@ SingleChannelPyramidLayerTileAccessor
The single-channel-pyramidlayer-tile accessor (associated interface: ISingleChannelPyramidLayerTileAc...
@ SingleChannelScalingTileAccessor
The scaling-single-channel-tile accessor (associated interface: ISingleChannelScalingTileAccessor).
LIBCZI_API void GetLibCZIBuildInformation(BuildInformation &info)
LIBCZI_API std::shared_ptr< ICZIReader > CreateCZIReader()
PixelType
An enum representing a pixel-type.
Definition: libCZI_Pixels.h:114
LIBCZI_API std::shared_ptr< ICziWriter > CreateCZIWriter(const CZIWriterOptions *options=nullptr)
LIBCZI_API std::shared_ptr< IBitmapData > CreateBitmapFromSubBlock(ISubBlock *subBlk)
LIBCZI_API void GetLibCZIVersion(int *pMajor, int *pMinor=nullptr, int *pPatch=nullptr, int *pTweak=nullptr)
LIBCZI_API std::shared_ptr< ISubBlockCache > CreateSubBlockCache()
LIBCZI_API std::shared_ptr< ICziReaderWriter > CreateCZIReaderWriter()
LIBCZI_API std::shared_ptr< IStream > CreateStreamFromMemory(std::shared_ptr< const void > ptr, size_t dataSize)
Information about an attachment.
Definition: libCZI.h:355
char contentFileType[9]
A null-terminated character array identifying the content of the attachment.
Definition: libCZI.h:357
std::string name
A string identifying the content of the attachment.
Definition: libCZI.h:358
libCZI::GUID contentGuid
A Guid identifying the content of the attachment.
Definition: libCZI.h:356
This structure gathers the bounding-boxes determined from all sub-blocks and only be those on pyramid...
Definition: libCZI.h:427
IntRect boundingBoxLayer0
The bounding-boxes determined only from sub-blocks of pyramid-layer 0.
Definition: libCZI.h:432
IntRect boundingBox
The bounding-box determined from all sub-blocks.
Definition: libCZI.h:429
bool allow_duplicate_subblocks
Definition: libCZI.h:109
std::uint64_t filePosition
The file position of the subblock.
Definition: libCZI.h:294
Represents a globally unique identifier (GUID) consisting of four unsigned 32-bit integers.
Definition: libCZI_Utilities.h:25
This structure gathers the settings for controlling the 'Open' operation of the CZIReader-class.
Definition: libCZI.h:653
void SetDefault()
Sets the the default.
Definition: libCZI.h:671
A rectangle (with integer coordinates).
Definition: libCZI_Pixels.h:17
int h
The height of the rectangle.
Definition: libCZI_Pixels.h:21
int w
The width of the rectangle.
Definition: libCZI_Pixels.h:20
void Invalidate()
Invalidates this object.
Definition: libCZI_Pixels.h:24
A structure representing a size (width and height) in integers.
Definition: libCZI_Pixels.h:91
std::uint32_t h
The height.
Definition: libCZI_Pixels.h:93
std::uint32_t w
The width.
Definition: libCZI_Pixels.h:92
std::uint8_t minificationFactor
Factor by which adjacent pyramid-layers are shrunk. Commonly used in CZI are 2 or 3.
Definition: libCZI.h:504
bool IsLayer0() const
Definition: libCZI.h:510
std::uint8_t pyramidLayerNo
The pyramid layer number.
Definition: libCZI.h:505
bool IsNotIdentifiedAsPyramidLayer() const
Definition: libCZI.h:515
Information about a pyramid-layer.
Definition: libCZI.h:520
int count
The number of sub-blocks which are present in the pyramid-layer.
Definition: libCZI.h:522
PyramidLayerInfo layerInfo
This identifies the pyramid-layer.
Definition: libCZI.h:521
Statistics about the pyramid-layers.
Definition: libCZI.h:492
std::map< int, std::vector< PyramidLayerStatistics > > scenePyramidStatistics
Definition: libCZI.h:527
Information about a sub-block.
Definition: libCZI.h:235
CompressionMode GetCompressionMode() const
Definition: libCZI.h:277
PixelType pixelType
The pixel type of the sub-block.
Definition: libCZI.h:242
int mIndex
The M-index of the sub-block (if available). If not available, it has the value std::numeric_limits<i...
Definition: libCZI.h:254
std::int32_t compressionModeRaw
Definition: libCZI.h:239
bool IsMindexValid() const
Definition: libCZI.h:284
SubBlockPyramidType pyramidType
Definition: libCZI.h:258
libCZI::IntSize physicalSize
The physical size of the bitmap (which may be different to the size of logicalRect).
Definition: libCZI.h:251
libCZI::IntRect logicalRect
The rectangle where the bitmap (in this sub-block) is located.
Definition: libCZI.h:248
double GetZoom() const
Definition: libCZI.h:264
libCZI::CDimCoordinate coordinate
The coordinate of the sub-block.
Definition: libCZI.h:245
Statistics about all sub-blocks found in a CZI-document.
Definition: libCZI.h:437
CDimBounds dimBounds
Definition: libCZI.h:460
int subBlockCount
Definition: libCZI.h:440
int minMindex
Definition: libCZI.h:444
void Invalidate()
Invalidates this object.
Definition: libCZI.h:478
IntRect boundingBoxLayer0Only
Definition: libCZI.h:456
bool IsMIndexValid() const
Definition: libCZI.h:472
IntRect boundingBox
Definition: libCZI.h:452
std::map< int, BoundingBoxes > sceneBoundingBoxes
Definition: libCZI.h:466
int maxMindex
Definition: libCZI.h:448