libCZI
Reading and Writing CZI documents made easy
libCZI::Compositors Class Reference

Composition operations are found in this class: multi-tile compositor and multi-channel compositor. More...

#include <libCZI_Compositor.h>

Classes

struct  ChannelInfo
 
struct  ComposeSingleTileOptions
 Options for the libCZI::Compositors::ComposeSingleChannelTiles function. More...
 
struct  TintingColor
 This structure defines the tinting color. More...
 

Static Public Member Functions

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: The destination bitmap is taken to be positioned at (xPos,yPos) - which specifies the top-left corner. The tiles (retrieved from the functor) are positioned at the coordinate as reported by the functor-call. Then the intersection area of source and destination is copied to the destination bitmap. If the intersection is empty, then nothing is copied. More...
 
static void ComposeMultiChannel_Bgr24 (libCZI::IBitmapData *dest, int channelCount, libCZI::IBitmapData *const *srcBitmaps, const ChannelInfo *channelInfos)
 
static void ComposeMultiChannel_Bgra32 (libCZI::IBitmapData *dest, std::uint8_t alphaVal, int channelCount, libCZI::IBitmapData *const *srcBitmaps, const ChannelInfo *channelInfos)
 
static std::shared_ptr< IBitmapDataComposeMultiChannel_Bgr24 (int channelCount, libCZI::IBitmapData *const *srcBitmaps, const ChannelInfo *channelInfos)
 
static std::shared_ptr< IBitmapDataComposeMultiChannel_Bgra32 (std::uint8_t alphaVal, int channelCount, libCZI::IBitmapData *const *srcBitmaps, const ChannelInfo *channelInfos)
 
static std::shared_ptr< IBitmapDataComposeMultiChannel_Bgr24 (int channelCount, std::vector< std::shared_ptr< libCZI::IBitmapData >>::iterator srcBitmapsIterator, const ChannelInfo *channelInfos)
 
static std::shared_ptr< IBitmapDataComposeMultiChannel_Bgra32 (std::uint8_t alphaVal, int channelCount, std::vector< std::shared_ptr< libCZI::IBitmapData >>::iterator srcBitmapsIterator, const ChannelInfo *channelInfos)
 

Detailed Description

Composition operations are found in this class: multi-tile compositor and multi-channel compositor.

Member Function Documentation

◆ ComposeMultiChannel_Bgr24() [1/3]

static std::shared_ptr<IBitmapData> libCZI::Compositors::ComposeMultiChannel_Bgr24 ( int  channelCount,
libCZI::IBitmapData *const *  srcBitmaps,
const ChannelInfo channelInfos 
)
static

Create the multi-channel-composite - applying tinting or gradation to the specified bitmaps and write the result to a newly allocated destination bitmap. All source bitmaps must have same width and height, and the destination bitmap will also have this same width/height. The pixeltype of the destination bitmap will be Bgr24.

Parameters
channelCountThe number of channels.
srcBitmapsAn array of source bitmaps. The array must contain as many elements as specified by channelCount.
channelInfosAn array of channelInfo for the source channels. The array must contain as many elements as specified by channelCount.
Returns
A std::shared_ptr<IBitmapData>.

◆ ComposeMultiChannel_Bgr24() [2/3]

static std::shared_ptr<IBitmapData> libCZI::Compositors::ComposeMultiChannel_Bgr24 ( int  channelCount,
std::vector< std::shared_ptr< libCZI::IBitmapData >>::iterator  srcBitmapsIterator,
const ChannelInfo channelInfos 
)
inlinestatic

Create the multi-channel-composite - applying tinting or gradation to the specified bitmaps and write the result to the specified destination bitmap. All source bitmaps must have same width and height, and the destination bitmap also has to have this same width/height. The pixeltype of the destination bitmap must be Bgr24.

Parameters
channelCountNumber of channels.
srcBitmapsIteratorSource bitmaps iterator.
channelInfosAn array of channelInfo for the source channels. The array must contain as many elements as specified by channelCount.
Returns
A std::shared_ptr<IBitmapData>.

◆ ComposeMultiChannel_Bgr24() [3/3]

static void libCZI::Compositors::ComposeMultiChannel_Bgr24 ( libCZI::IBitmapData dest,
int  channelCount,
libCZI::IBitmapData *const *  srcBitmaps,
const ChannelInfo channelInfos 
)
static

Create the multi-channel-composite - applying tinting or gradation to the specified bitmaps and write the result to the specified destination bitmap. All source bitmaps must have same width and height, and the destination bitmap also has to have this same width/height. The pixeltype of the destination bitmap must be Bgr24.

Parameters
[in]destThe destination bitmap - must have same width/height as the source bitmaps and must be Bgr24.
channelCountThe number of channels.
srcBitmapsAn array of source bitmaps. The array must contain as many elements as specified by channelCount.
channelInfosAn array of channelInfo for the source channels. The array must contain as many elements as specified by channelCount.

◆ ComposeMultiChannel_Bgra32() [1/3]

static void libCZI::Compositors::ComposeMultiChannel_Bgra32 ( libCZI::IBitmapData dest,
std::uint8_t  alphaVal,
int  channelCount,
libCZI::IBitmapData *const *  srcBitmaps,
const ChannelInfo channelInfos 
)
static

Create the multi-channel-composite - applying tinting or gradation to the specified bitmaps and write the result to the specified destination bitmap. All source bitmaps must have same width and height, and the destination bitmap also has to have this same width/height. The pixeltype of the destination bitmap must be Bgra32. The value of the parameter 'alphaVal' is written to all alpha-pixels in the destination.

Parameters
[in]destThe destination bitmap - must have same width/height as the source bitmaps and must be Bgra32.
alphaValThe alpha value.
channelCountThe number of channels.
srcBitmapsAn array of source bitmaps. The array must contain as many elements as specified by channelCount.
channelInfosAn array of channelInfo for the source channels. The array must contain as many elements as specified by channelCount.

◆ ComposeMultiChannel_Bgra32() [2/3]

static std::shared_ptr<IBitmapData> libCZI::Compositors::ComposeMultiChannel_Bgra32 ( std::uint8_t  alphaVal,
int  channelCount,
libCZI::IBitmapData *const *  srcBitmaps,
const ChannelInfo channelInfos 
)
static

Create the multi-channel-composite - applying tinting or gradation to the specified bitmaps and write the result to a newly allocated destination bitmap. All source bitmaps must have same width and height, and the destination bitmap will also have this same width/height. The pixeltype of the destination bitmap will be Bgra32, and each alpha-pixel-value will be set to 'alphaVal'.

Parameters
alphaValThe alpha value.
channelCountThe number of channels.
srcBitmapsAn array of source bitmaps. The array must contain as many elements as specified by channelCount.
channelInfosAn array of channelInfo for the source channels. The array must contain as many elements as specified by channelCount.
Returns
A std::shared_ptr<IBitmapData>.

◆ ComposeMultiChannel_Bgra32() [3/3]

static std::shared_ptr<IBitmapData> libCZI::Compositors::ComposeMultiChannel_Bgra32 ( std::uint8_t  alphaVal,
int  channelCount,
std::vector< std::shared_ptr< libCZI::IBitmapData >>::iterator  srcBitmapsIterator,
const ChannelInfo channelInfos 
)
inlinestatic

Create the multi-channel-composite - applying tinting or gradation to the specified bitmaps and write the result to the specified destination bitmap. All source bitmaps must have same width and height, and the destination bitmap also has to have this same width/height. The pixeltype of the destination bitmap must be Bgra32.

Parameters
alphaValThe alpha value.
channelCountNumber of channels.
srcBitmapsIteratorSource bitmaps iterator.
channelInfosAn array of channelInfo for the source channels. The array must contain as many elements as specified by channelCount.
Returns
A std::shared_ptr<IBitmapData>.

◆ ComposeSingleChannelTiles()

static void libCZI::Compositors::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

Composes a set of tiles (which are retrieved by calling the getTiles-functor) in the following way: The destination bitmap is taken to be positioned at (xPos,yPos) - which specifies the top-left corner. The tiles (retrieved from the functor) are positioned at the coordinate as reported by the functor-call. Then the intersection area of source and destination is copied to the destination bitmap. If the intersection is empty, then nothing is copied.

Parameters
getTiles[in] The functor which is called in order to retrieve the tiles to compose. The second and the third parameter specify the x- and y-position of this tile. We address a tile with the parameter index. If the index is out-of-range, then this functor is expected to return false.
dest[in,out] The destination bitmap.
xPosThe x-coordinate of the top-left of the destination bitmap.
yPosThe y-coordinate of the top-left of the destination bitmap.
pOptionsOptions for controlling the operation. This argument is optional (may be nullptr).

The documentation for this class was generated from the following file: