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;
270 inline std::shared_ptr<libCZI::IBitmapData>
Get(
int xPos,
int yPos,
int width,
int height,
const IDimCoordinate* planeCoordinate,
const Options* pOptions) {
return this->
Get(
libCZI::IntRect{ xPos,yPos,width,height }, planeCoordinate, pOptions); }
281 inline std::shared_ptr<libCZI::IBitmapData>
Get(
libCZI::PixelType pixeltype,
int xPos,
int yPos,
int width,
int height,
const IDimCoordinate* planeCoordinate,
const Options* pOptions) {
return this->
Get(pixeltype,
libCZI::IntRect{ xPos,yPos,width,height }, planeCoordinate, pOptions); }
323 this->drawTileBorder =
false;
324 this->sortByM =
true;
325 this->backGroundColor.
r = this->backGroundColor.
g = this->backGroundColor.
b = std::numeric_limits<float>::quiet_NaN();
326 this->sceneFilter.reset();
327 this->subBlockCache.reset();
328 this->onlyUseSubBlockCacheForCompressedData =
true;
419 this->drawTileBorder =
false;
420 this->sortByM =
true;
421 this->backGroundColor.
r = this->backGroundColor.
g = this->backGroundColor.
b = std::numeric_limits<float>::quiet_NaN();
422 this->sceneFilter.reset();
423 this->useVisibilityCheckOptimization =
false;
424 this->subBlockCache.reset();
425 this->onlyUseSubBlockCacheForCompressedData =
true;
480 void Clear() { this->drawTileBorder =
false; }
502 const std::function<
bool(
int index, std::shared_ptr<libCZI::IBitmapData>& src,
int& x,
int& y)>& getTiles,
558 void Clear() { std::memset(
this, 0,
sizeof(*
this)); }
591 std::uint8_t alphaVal,
625 std::uint8_t alphaVal,
642 std::vector<std::shared_ptr<libCZI::IBitmapData>>::iterator srcBitmapsIterator,
645 std::vector<IBitmapData*> vecBm; vecBm.reserve(channelCount);
646 for (
int i = 0; i < channelCount; ++i)
648 vecBm.emplace_back((*srcBitmapsIterator).get());
649 ++srcBitmapsIterator;
652 return ComposeMultiChannel_Bgr24(channelCount, &vecBm[0], channelInfos);
667 std::uint8_t alphaVal,
669 std::vector<std::shared_ptr<libCZI::IBitmapData>>::iterator srcBitmapsIterator,
672 std::vector<IBitmapData*> vecBm; vecBm.reserve(channelCount);
673 for (
int i = 0; i < channelCount; ++i)
675 vecBm.emplace_back((*srcBitmapsIterator).get());
676 ++srcBitmapsIterator;
679 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:470
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_Bgra32(std::uint8_t alphaVal, int channelCount, std::vector< std::shared_ptr< libCZI::IBitmapData >>::iterator srcBitmapsIterator, const ChannelInfo *channelInfos)
Definition: libCZI_Compositor.h:666
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:640
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)
Composes a set of tiles (which are retrieved by calling the getTiles-functor) in the following way: T...
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 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:167
Interface used to represent a coordinate (in the space of the dimensions identified by DimensionIndex...
Definition: libCZI_DimCoordinate.h:37
Definition: libCZI_Compositor.h:290
virtual 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)=0
virtual void Get(libCZI::IBitmapData *pDest, int xPos, int yPos, const IDimCoordinate *planeCoordinate, const PyramidLayerInfo &pyramidInfo, const Options *pOptions)=0
Copy the composite to the specified bitmap.
virtual std::shared_ptr< libCZI::IBitmapData > Get(const libCZI::IntRect &roi, const libCZI::IDimCoordinate *planeCoordinate, const PyramidLayerInfo &pyramidInfo, const libCZI::ISingleChannelPyramidLayerTileAccessor::Options *pOptions)=0
Definition: libCZI_Compositor.h:379
virtual void Get(libCZI::IBitmapData *pDest, const libCZI::IntRect &roi, const libCZI::IDimCoordinate *planeCoordinate, float zoom, const libCZI::ISingleChannelScalingTileAccessor::Options *pOptions)=0
Copy the composite to the specified bitmap.
virtual std::shared_ptr< libCZI::IBitmapData > Get(libCZI::PixelType pixeltype, const libCZI::IntRect &roi, const libCZI::IDimCoordinate *planeCoordinate, float zoom, const libCZI::ISingleChannelScalingTileAccessor::Options *pOptions)=0
virtual std::shared_ptr< libCZI::IBitmapData > Get(const libCZI::IntRect &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
Definition: libCZI_Compositor.h:172
virtual void Get(libCZI::IBitmapData *pDest, int xPos, int yPos, const IDimCoordinate *planeCoordinate, const Options *pOptions)=0
virtual std::shared_ptr< libCZI::IBitmapData > Get(libCZI::PixelType pixeltype, const libCZI::IntRect &roi, const IDimCoordinate *planeCoordinate, const Options *pOptions)=0
virtual std::shared_ptr< libCZI::IBitmapData > Get(const libCZI::IntRect &roi, const IDimCoordinate *planeCoordinate, const Options *pOptions)=0
Gets the tile composite of the specified plane and the specified ROI. The pixeltype is determined by ...
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:281
std::shared_ptr< libCZI::IBitmapData > Get(int xPos, int yPos, int width, int height, const IDimCoordinate *planeCoordinate, const Options *pOptions)
Definition: libCZI_Compositor.h:270
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-pyramidlayer-tile accessor (associated interface: ISingleChannelPyramidLayerTileAc...
@ SingleChannelScalingTileAccessor
The scaling-single-channel-tile accessor (associated interface: ISingleChannelScalingTileAccessor).
PixelType
An enum representing a pixel-type.
Definition: libCZI_Pixels.h:114
Definition: libCZI_Compositor.h:524
float blackPoint
Definition: libCZI_Compositor.h:538
float weight
The weight of the channel.
Definition: libCZI_Compositor.h:526
int lookUpTableElementCount
Definition: libCZI_Compositor.h:551
bool enableTinting
Definition: libCZI_Compositor.h:530
TintingColor tinting
The tinting color (only examined if enableTinting is true).
Definition: libCZI_Compositor.h:533
void Clear()
All members are set to zero.
Definition: libCZI_Compositor.h:558
float whitePoint
Definition: libCZI_Compositor.h:543
const std::uint8_t * ptrLookUpTable
Definition: libCZI_Compositor.h:555
Options for the libCZI::Compositors::ComposeSingleChannelTiles function.
Definition: libCZI_Compositor.h:474
bool drawTileBorder
Definition: libCZI_Compositor.h:477
void Clear()
Clears this object to its blank/initial state.
Definition: libCZI_Compositor.h:480
This structure defines the tinting color.
Definition: libCZI_Compositor.h:510
Rgb8Color color
The tinting color to be used given as RGB24.
Definition: libCZI_Compositor.h:512
Options used for this accessor.
Definition: libCZI_Compositor.h:294
bool drawTileBorder
Definition: libCZI_Compositor.h:307
RgbFloatColor backGroundColor
Definition: libCZI_Compositor.h:299
bool sortByM
Definition: libCZI_Compositor.h:303
bool onlyUseSubBlockCacheForCompressedData
If true, then only bitmaps from sub-blocks with compressed data are added to the cache.
Definition: libCZI_Compositor.h:318
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:310
void Clear()
Clears this object to its blank state.
Definition: libCZI_Compositor.h:321
std::shared_ptr< libCZI::ISubBlockCacheOperation > subBlockCache
Definition: libCZI_Compositor.h:315
Definition: libCZI_Compositor.h:338
std::uint8_t minificationFactor
Factor by which adjacent pyramid-layers are shrunk. Commonly used in CZI are 2 or 3.
Definition: libCZI_Compositor.h:339
std::uint8_t pyramidLayerNo
The pyramid layer number.
Definition: libCZI_Compositor.h:340
Options used for this accessor.
Definition: libCZI_Compositor.h:383
RgbFloatColor backGroundColor
Definition: libCZI_Compositor.h:388
std::shared_ptr< libCZI::ISubBlockCacheOperation > subBlockCache
Definition: libCZI_Compositor.h:411
bool onlyUseSubBlockCacheForCompressedData
If true, then only bitmaps from sub-blocks with compressed data are added to the cache.
Definition: libCZI_Compositor.h:414
void Clear()
Clears this object to its blank state.
Definition: libCZI_Compositor.h:417
bool sortByM
Definition: libCZI_Compositor.h:392
bool useVisibilityCheckOptimization
Definition: libCZI_Compositor.h:406
std::shared_ptr< libCZI::IIndexSet > sceneFilter
Definition: libCZI_Compositor.h:400
bool drawTileBorder
Definition: libCZI_Compositor.h:396
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
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
A rectangle (with integer coordinates).
Definition: libCZI_Pixels.h:17
A structure representing a size (width and height) in integers.
Definition: libCZI_Pixels.h:91
A structure representing an R-G-B-color triple (as bytes).
Definition: libCZI_Pixels.h:98
A structure representing an R-G-B-color triple (as floats).
Definition: libCZI_Pixels.h:106
float r
The red component.
Definition: libCZI_Pixels.h:107
float b
The blue component.
Definition: libCZI_Pixels.h:109
float g
The green component.
Definition: libCZI_Pixels.h:108