7#include "ImportExport.h"
12#include "libCZI_Pixels.h"
13#include "libCZI_Metadata.h"
84 std::uint64_t maxMemoryUsage{ (std::numeric_limits<
decltype(
maxMemoryUsage)>::max)() };
88 std::uint32_t maxSubBlockCount{ (std::numeric_limits<
decltype(
maxSubBlockCount)>::max)() };
113 virtual std::shared_ptr<IBitmapData>
Get(
int subblock_index) = 0;
118 virtual void Add(
int subblock_index, std::shared_ptr<IBitmapData> pBitmap) = 0;
213 this->backGroundColor.
r = this->backGroundColor.
g = this->backGroundColor.
b = std::numeric_limits<float>::quiet_NaN();
214 this->sortByM =
true;
215 this->useVisibilityCheckOptimization =
false;
216 this->drawTileBorder =
false;
217 this->sceneFilter.reset();
218 this->subBlockCache.reset();
219 this->onlyUseSubBlockCacheForCompressedData =
true;
265 std::shared_ptr<libCZI::IBitmapData>
Get(
int xPos,
int yPos,
int width,
int height,
const IDimCoordinate* planeCoordinate,
const Options* pOptions)
267 return this->Get(
libCZI::IntRect{ xPos,yPos,width,height }, planeCoordinate, pOptions);
281 return this->Get(pixeltype,
libCZI::IntRect{ xPos,yPos,width,height }, planeCoordinate, pOptions);
365 this->drawTileBorder =
false;
366 this->sortByM =
true;
367 this->backGroundColor.
r = this->backGroundColor.
g = this->backGroundColor.
b = std::numeric_limits<float>::quiet_NaN();
368 this->sceneFilter.reset();
369 this->subBlockCache.reset();
370 this->onlyUseSubBlockCacheForCompressedData =
true;
498 this->drawTileBorder =
false;
499 this->sortByM =
true;
500 this->backGroundColor.
r = this->backGroundColor.
g = this->backGroundColor.
b = std::numeric_limits<float>::quiet_NaN();
501 this->sceneFilter.reset();
502 this->useVisibilityCheckOptimization =
false;
503 this->subBlockCache.reset();
504 this->onlyUseSubBlockCacheForCompressedData =
true;
598 void Clear() { this->drawTileBorder =
false; }
616 const std::function<
bool(
int index, std::shared_ptr<libCZI::IBitmapData>& src,
int& x,
int& y)>& getTiles,
672 void Clear() { std::memset(
this, 0,
sizeof(*
this)); }
705 std::uint8_t alphaVal,
739 std::uint8_t alphaVal,
756 std::vector<std::shared_ptr<libCZI::IBitmapData>>::iterator srcBitmapsIterator,
759 std::vector<IBitmapData*> vecBm; vecBm.reserve(channelCount);
760 for (
int i = 0; i < channelCount; ++i)
762 vecBm.emplace_back((*srcBitmapsIterator).get());
763 ++srcBitmapsIterator;
766 return ComposeMultiChannel_Bgr24(channelCount, &vecBm[0], channelInfos);
781 std::uint8_t alphaVal,
783 std::vector<std::shared_ptr<libCZI::IBitmapData>>::iterator srcBitmapsIterator,
786 std::vector<IBitmapData*> vecBm; vecBm.reserve(channelCount);
787 for (
int i = 0; i < channelCount; ++i)
789 vecBm.emplace_back((*srcBitmapsIterator).get());
790 ++srcBitmapsIterator;
793 return ComposeMultiChannel_Bgra32(alphaVal, channelCount, &vecBm[0], channelInfos);
Composition operations are found in this class: multi-tile compositor and multi-channel compositor.
Definition libCZI_Compositor.h:588
static void ComposeMultiChannel_Bgra32(libCZI::IBitmapData *dest, std::uint8_t alphaVal, int channelCount, libCZI::IBitmapData *const *srcBitmaps, const ChannelInfo *channelInfos)
static std::shared_ptr< IBitmapData > ComposeMultiChannel_Bgr24(int channelCount, libCZI::IBitmapData *const *srcBitmaps, const ChannelInfo *channelInfos)
static std::shared_ptr< IBitmapData > ComposeMultiChannel_Bgra32(std::uint8_t alphaVal, int channelCount, libCZI::IBitmapData *const *srcBitmaps, const ChannelInfo *channelInfos)
static std::shared_ptr< IBitmapData > ComposeMultiChannel_Bgra32(std::uint8_t alphaVal, int channelCount, std::vector< std::shared_ptr< libCZI::IBitmapData > >::iterator srcBitmapsIterator, const ChannelInfo *channelInfos)
Definition libCZI_Compositor.h:780
static void ComposeSingleChannelTiles(const std::function< bool(int index, std::shared_ptr< libCZI::IBitmapData > &src, int &x, int &y)> &getTiles, libCZI::IBitmapData *dest, int xPos, int yPos, const ComposeSingleTileOptions *pOptions)
static std::shared_ptr< IBitmapData > ComposeMultiChannel_Bgr24(int channelCount, std::vector< std::shared_ptr< libCZI::IBitmapData > >::iterator srcBitmapsIterator, const ChannelInfo *channelInfos)
Definition libCZI_Compositor.h:754
static void ComposeMultiChannel_Bgr24(libCZI::IBitmapData *dest, int channelCount, libCZI::IBitmapData *const *srcBitmaps, const ChannelInfo *channelInfos)
The base interface (all accessor-interface must derive from this).
Definition libCZI_Compositor.h:151
Definition libCZI_Pixels.h:197
Interface used to represent a coordinate (in the space of the dimensions identified by DimensionIndex...
Definition libCZI_DimCoordinate.h:37
Definition libCZI_Compositor.h:332
void Get(libCZI::IBitmapData *pDest, int xPos, int yPos, const IDimCoordinate *planeCoordinate, const PyramidLayerInfo &pyramidInfo, const Options *pOptions)
Definition libCZI_Compositor.h:446
std::shared_ptr< libCZI::IBitmapData > Get(libCZI::PixelType pixeltype, const libCZI::IntRect &roi, const libCZI::IDimCoordinate *planeCoordinate, const PyramidLayerInfo &pyramidInfo, const libCZI::ISingleChannelPyramidLayerTileAccessor::Options *pOptions)
Definition libCZI_Compositor.h:434
virtual void Get(libCZI::IBitmapData *pDest, const libCZI::IntPointAndFrameOfReference &position, const IDimCoordinate *planeCoordinate, const PyramidLayerInfo &pyramidInfo, const Options *pOptions)=0
virtual std::shared_ptr< libCZI::IBitmapData > Get(const libCZI::IntRectAndFrameOfReference &roi, const libCZI::IDimCoordinate *planeCoordinate, const PyramidLayerInfo &pyramidInfo, const libCZI::ISingleChannelPyramidLayerTileAccessor::Options *pOptions)=0
virtual std::shared_ptr< libCZI::IBitmapData > Get(libCZI::PixelType pixeltype, const libCZI::IntRectAndFrameOfReference &roi, const libCZI::IDimCoordinate *planeCoordinate, const PyramidLayerInfo &pyramidInfo, const libCZI::ISingleChannelPyramidLayerTileAccessor::Options *pOptions)=0
std::shared_ptr< libCZI::IBitmapData > Get(const libCZI::IntRect &roi, const libCZI::IDimCoordinate *planeCoordinate, const PyramidLayerInfo &pyramidInfo, const libCZI::ISingleChannelPyramidLayerTileAccessor::Options *pOptions)
Definition libCZI_Compositor.h:422
Definition libCZI_Compositor.h:458
std::shared_ptr< libCZI::IBitmapData > Get(const libCZI::IntRect &roi, const libCZI::IDimCoordinate *planeCoordinate, float zoom, const libCZI::ISingleChannelScalingTileAccessor::Options *pOptions)
Definition libCZI_Compositor.h:555
std::shared_ptr< libCZI::IBitmapData > Get(libCZI::PixelType pixeltype, const libCZI::IntRect &roi, const libCZI::IDimCoordinate *planeCoordinate, float zoom, const libCZI::ISingleChannelScalingTileAccessor::Options *pOptions)
Definition libCZI_Compositor.h:567
virtual std::shared_ptr< libCZI::IBitmapData > Get(libCZI::PixelType pixeltype, const libCZI::IntRectAndFrameOfReference &roi, const libCZI::IDimCoordinate *planeCoordinate, float zoom, const libCZI::ISingleChannelScalingTileAccessor::Options *pOptions)=0
virtual void Get(libCZI::IBitmapData *pDest, const libCZI::IntRectAndFrameOfReference &roi, const libCZI::IDimCoordinate *planeCoordinate, float zoom, const libCZI::ISingleChannelScalingTileAccessor::Options *pOptions)=0
virtual libCZI::IntSize CalcSize(const libCZI::IntRect &roi, float zoom) const =0
virtual std::shared_ptr< libCZI::IBitmapData > Get(const libCZI::IntRectAndFrameOfReference &roi, const libCZI::IDimCoordinate *planeCoordinate, float zoom, const libCZI::ISingleChannelScalingTileAccessor::Options *pOptions)=0
void Get(libCZI::IBitmapData *pDest, const libCZI::IntRect &roi, const libCZI::IDimCoordinate *planeCoordinate, float zoom, const libCZI::ISingleChannelScalingTileAccessor::Options *pOptions)
Definition libCZI_Compositor.h:580
Definition libCZI_Compositor.h:172
virtual std::shared_ptr< libCZI::IBitmapData > Get(libCZI::PixelType pixeltype, const libCZI::IntRectAndFrameOfReference &roi, const IDimCoordinate *planeCoordinate, const Options *pOptions)=0
std::shared_ptr< libCZI::IBitmapData > Get(int xPos, int yPos, int width, int height, const IDimCoordinate *planeCoordinate, const Options *pOptions)
Definition libCZI_Compositor.h:265
std::shared_ptr< libCZI::IBitmapData > Get(libCZI::PixelType pixeltype, const libCZI::IntRect &roi, const IDimCoordinate *planeCoordinate, const Options *pOptions)
Definition libCZI_Compositor.h:306
virtual std::shared_ptr< libCZI::IBitmapData > Get(const libCZI::IntRectAndFrameOfReference &roi, const IDimCoordinate *planeCoordinate, const Options *pOptions)=0
std::shared_ptr< libCZI::IBitmapData > Get(const libCZI::IntRect &roi, const IDimCoordinate *planeCoordinate, const Options *pOptions)
Definition libCZI_Compositor.h:293
virtual void Get(libCZI::IBitmapData *pDest, const IntPointAndFrameOfReference &position, const IDimCoordinate *planeCoordinate, const Options *pOptions)=0
void Get(libCZI::IBitmapData *pDest, int xPos, int yPos, const IDimCoordinate *planeCoordinate, const Options *pOptions)
Definition libCZI_Compositor.h:319
std::shared_ptr< libCZI::IBitmapData > Get(libCZI::PixelType pixeltype, int xPos, int yPos, int width, int height, const IDimCoordinate *planeCoordinate, const Options *pOptions)
Definition libCZI_Compositor.h:279
This interface defines the global operations on the cache. It is used to control the memory usage of ...
Definition libCZI_Compositor.h:70
virtual void Prune(const PruneOptions &options)=0
Definition libCZI_Compositor.h:138
This interface defines the operations of adding and querying an element to/from the cache.
Definition libCZI_Compositor.h:108
virtual void Add(int subblock_index, std::shared_ptr< IBitmapData > pBitmap)=0
virtual std::shared_ptr< IBitmapData > Get(int subblock_index)=0
This interface defines how status information about the cache-state can be queried.
Definition libCZI_Compositor.h:30
virtual Statistics GetStatistics(std::uint8_t mask) const =0
static constexpr std::uint8_t kElementsCount
Bit-mask identifying the elements-count field in the statistics struct.
Definition libCZI_Compositor.h:33
static constexpr std::uint8_t kMemoryUsage
Bit-mask identifying the memory-usage field in the statistics struct.
Definition libCZI_Compositor.h:32
External interfaces, classes, functions and structs are found in the namespace "libCZI".
Definition libCZI.h:31
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-pyramid-layer-tile accessor (associated interface: ISingleChannelPyramidLayerTileA...
@ SingleChannelScalingTileAccessor
The scaling-single-channel-tile accessor (associated interface: ISingleChannelScalingTileAccessor).
@ RawSubBlockCoordinateSystem
The raw sub-block coordinate system.
PixelType
An enum representing a pixel-type.
Definition libCZI_Pixels.h:144
Definition libCZI_Compositor.h:638
float blackPoint
Definition libCZI_Compositor.h:652
float weight
The weight of the channel.
Definition libCZI_Compositor.h:640
int lookUpTableElementCount
Definition libCZI_Compositor.h:665
bool enableTinting
Definition libCZI_Compositor.h:644
TintingColor tinting
The tinting color (only examined if enableTinting is true).
Definition libCZI_Compositor.h:647
void Clear()
All members are set to zero.
Definition libCZI_Compositor.h:672
float whitePoint
Definition libCZI_Compositor.h:657
const std::uint8_t * ptrLookUpTable
Definition libCZI_Compositor.h:669
Options for the libCZI::Compositors::ComposeSingleChannelTiles function.
Definition libCZI_Compositor.h:592
bool drawTileBorder
Definition libCZI_Compositor.h:595
void Clear()
Clears this object to its blank/initial state.
Definition libCZI_Compositor.h:598
This structure defines the tinting color.
Definition libCZI_Compositor.h:624
Rgb8Color color
The tinting color to be used given as RGB24.
Definition libCZI_Compositor.h:626
Options used for this accessor.
Definition libCZI_Compositor.h:336
bool drawTileBorder
Definition libCZI_Compositor.h:349
RgbFloatColor backGroundColor
Definition libCZI_Compositor.h:341
bool sortByM
Definition libCZI_Compositor.h:345
bool onlyUseSubBlockCacheForCompressedData
If true, then only bitmaps from sub-blocks with compressed data are added to the cache.
Definition libCZI_Compositor.h:360
std::shared_ptr< libCZI::IIndexSet > sceneFilter
If specified, only subblocks with a scene-index contained in the set will be considered.
Definition libCZI_Compositor.h:352
void Clear()
Clears this object to its blank state.
Definition libCZI_Compositor.h:363
std::shared_ptr< libCZI::ISubBlockCacheOperation > subBlockCache
Definition libCZI_Compositor.h:357
Definition libCZI_Compositor.h:380
std::uint8_t minificationFactor
Factor by which adjacent pyramid-layers are shrunk. Commonly used in CZI are 2 or 3.
Definition libCZI_Compositor.h:381
std::uint8_t pyramidLayerNo
The pyramid layer number.
Definition libCZI_Compositor.h:382
Options used for this accessor.
Definition libCZI_Compositor.h:462
RgbFloatColor backGroundColor
Definition libCZI_Compositor.h:467
std::shared_ptr< libCZI::ISubBlockCacheOperation > subBlockCache
Definition libCZI_Compositor.h:490
bool onlyUseSubBlockCacheForCompressedData
If true, then only bitmaps from sub-blocks with compressed data are added to the cache.
Definition libCZI_Compositor.h:493
void Clear()
Clears this object to its blank state.
Definition libCZI_Compositor.h:496
bool sortByM
Definition libCZI_Compositor.h:471
bool useVisibilityCheckOptimization
Definition libCZI_Compositor.h:485
std::shared_ptr< libCZI::IIndexSet > sceneFilter
Definition libCZI_Compositor.h:479
bool drawTileBorder
Definition libCZI_Compositor.h:475
Options for controlling the composition operation.
Definition libCZI_Compositor.h:176
bool useVisibilityCheckOptimization
Definition libCZI_Compositor.h:191
bool onlyUseSubBlockCacheForCompressedData
Definition libCZI_Compositor.h:208
RgbFloatColor backGroundColor
Definition libCZI_Compositor.h:181
bool sortByM
Definition libCZI_Compositor.h:185
std::shared_ptr< libCZI::IIndexSet > sceneFilter
If specified, only subblocks with a scene-index contained in the set will be considered.
Definition libCZI_Compositor.h:198
void Clear()
Clears this object to its blank state.
Definition libCZI_Compositor.h:211
bool drawTileBorder
Definition libCZI_Compositor.h:195
std::shared_ptr< libCZI::ISubBlockCacheOperation > subBlockCache
Definition libCZI_Compositor.h:203
Definition libCZI_Compositor.h:81
std::uint32_t maxSubBlockCount
Definition libCZI_Compositor.h:88
std::uint64_t maxMemoryUsage
Definition libCZI_Compositor.h:84
Definition libCZI_Compositor.h:38
std::uint32_t elementsCount
The number of elements in the cache. This field is only valid if the bit kElementsCount is set in the...
Definition libCZI_Compositor.h:46
std::uint64_t memoryUsage
The memory usage of all elements in the cache. This field is only valid if the bit kMemoryUsage is se...
Definition libCZI_Compositor.h:43
std::uint8_t validityMask
A bit mask which indicates which members are valid. C.f. the constants kMemoryUsage and kElementsCoun...
Definition libCZI_Compositor.h:40
This structure combines a point with a specification of the frame of reference.
Definition libCZI_Pixels.h:102
This structure combines a rectangle with a specification of the frame of reference.
Definition libCZI_Pixels.h:95
A rectangle (with integer coordinates).
Definition libCZI_Pixels.h:17
A structure representing a size (width and height) in integers.
Definition libCZI_Pixels.h:121
A structure representing an R-G-B-color triple (as bytes).
Definition libCZI_Pixels.h:128
A structure representing an R-G-B-color triple (as floats).
Definition libCZI_Pixels.h:136
float r
The red component.
Definition libCZI_Pixels.h:137
float b
The blue component.
Definition libCZI_Pixels.h:139
float g
The green component.
Definition libCZI_Pixels.h:138