libCZI
Reading and Writing CZI documents made easy
libCZI::ISingleChannelScalingTileAccessor Class Referenceabstract

#include <libCZI_Compositor.h>

Inheritance diagram for libCZI::ISingleChannelScalingTileAccessor:
libCZI::IAccessor

Classes

struct  Options
 Options used for this accessor. More...
 

Public Member Functions

virtual libCZI::IntSize CalcSize (const libCZI::IntRect &roi, float zoom) const =0
 
virtual std::shared_ptr< libCZI::IBitmapDataGet (const libCZI::IntRect &roi, const libCZI::IDimCoordinate *planeCoordinate, float zoom, const libCZI::ISingleChannelScalingTileAccessor::Options *pOptions)=0
 
virtual std::shared_ptr< libCZI::IBitmapDataGet (libCZI::PixelType pixeltype, const libCZI::IntRect &roi, const libCZI::IDimCoordinate *planeCoordinate, float zoom, const libCZI::ISingleChannelScalingTileAccessor::Options *pOptions)=0
 
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. More...
 

Detailed Description

Interface for single channel scaling tile accessors. This accessor creates a multi-tile composite of a single channel (and a single plane) with a given zoom-factor. It will use pyramid sub-blocks (if present) in order to create the destination bitmap. In this operation, it will use the pyramid-layer just above the specified zoom-factor and scale down to the requested size.
The scaling operation employed here is a simple nearest-neighbor algorithm.

Member Function Documentation

◆ CalcSize()

virtual libCZI::IntSize libCZI::ISingleChannelScalingTileAccessor::CalcSize ( const libCZI::IntRect roi,
float  zoom 
) const
pure virtual

Calculates the size a bitmap will have (when created by this accessor) for the specified ROI and the specified Zoom. Since the exact size if subject to rounding errors, one should always use this method if the exact size must be known beforehand. The Get-method which operates on a pre-allocated bitmap will only work if the size (of the bitmap passed in) exactly matches.

Parameters
roiThe ROI.
zoomThe zoom factor.
Returns
The size of the composite created by this accessor (for these parameters).

◆ Get() [1/3]

virtual std::shared_ptr<libCZI::IBitmapData> libCZI::ISingleChannelScalingTileAccessor::Get ( const libCZI::IntRect roi,
const libCZI::IDimCoordinate planeCoordinate,
float  zoom,
const libCZI::ISingleChannelScalingTileAccessor::Options pOptions 
)
pure virtual

Gets the scaled tile composite of the specified plane and the specified ROI with the specified zoom factor.
The pixeltype is determined by examining the first subblock found in the specified plane (which is an arbitrary subblock). A newly allocated bitmap is returned.

Parameters
roiThe ROI.
planeCoordinateThe plane coordinate.
zoomThe zoom.
pOptionsOptions for controlling the operation (may be nullptr).
Returns
A std::shared_ptr<libCZI::IBitmapData>

◆ Get() [2/3]

virtual void libCZI::ISingleChannelScalingTileAccessor::Get ( libCZI::IBitmapData pDest,
const libCZI::IntRect roi,
const libCZI::IDimCoordinate planeCoordinate,
float  zoom,
const libCZI::ISingleChannelScalingTileAccessor::Options pOptions 
)
pure virtual

Copy the composite to the specified bitmap.

The size of the bitmap must exactly match the size reported by the method "CalcSize" (for the same ROI and zoom), otherwise an invalid_argument-exception is thrown.

Parameters
pDest[in,out] The destination bitmap.
roiThe ROI.
planeCoordinateThe plane coordinate.
zoomThe zoom factor.
pOptionsOptions controlling the operation. May be nullptr.

◆ Get() [3/3]

virtual std::shared_ptr<libCZI::IBitmapData> libCZI::ISingleChannelScalingTileAccessor::Get ( libCZI::PixelType  pixeltype,
const libCZI::IntRect roi,
const libCZI::IDimCoordinate planeCoordinate,
float  zoom,
const libCZI::ISingleChannelScalingTileAccessor::Options pOptions 
)
pure virtual

Gets the scaled tile composite of the specified plane and the specified ROI with the specified zoom factor.

Parameters
pixeltypeThe pixeltype (of the destination bitmap).
roiThe ROI.
planeCoordinateThe plane coordinate.
zoomThe zoom factor.
pOptionsOptions for controlling the operation (may be nullptr).
Returns
A std::shared_ptr<libCZI::IBitmapData>

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