svcore  1.9
PowerOfTwoZoomConstraint Class Reference

#include <PowerOfTwoZoomConstraint.h>

Inheritance diagram for PowerOfTwoZoomConstraint:
Collaboration diagram for PowerOfTwoZoomConstraint:

Public Types

enum  RoundingDirection { RoundDown, RoundUp, RoundNearest }
 

Public Member Functions

virtual int getNearestBlockSize (int requestedBlockSize, RoundingDirection dir=RoundNearest) const
 Given the "ideal" block size (frames per pixel) for a given zoom level, return the nearest viable block size for this constraint. More...
 
virtual int getMaxZoomLevel () const
 Return the maximum zoom level within range for this constraint. More...
 

Detailed Description

Definition at line 21 of file PowerOfTwoZoomConstraint.h.

Member Enumeration Documentation

◆ RoundingDirection

Enumerator
RoundDown 
RoundUp 
RoundNearest 

Definition at line 35 of file ZoomConstraint.h.

Member Function Documentation

◆ getNearestBlockSize()

int PowerOfTwoZoomConstraint::getNearestBlockSize ( int  requestedBlockSize,
RoundingDirection  = RoundNearest 
) const
virtual

Given the "ideal" block size (frames per pixel) for a given zoom level, return the nearest viable block size for this constraint.

For example, if a block size of 1523 frames per pixel is requested but the underlying model only supports value summaries at powers-of-two block sizes, return 1024 or 2048 depending on the rounding direction supplied.

Reimplemented from ZoomConstraint.

Definition at line 19 of file PowerOfTwoZoomConstraint.cpp.

References ZoomConstraint::getMaxZoomLevel(), ZoomConstraint::RoundDown, and ZoomConstraint::RoundNearest.

◆ getMaxZoomLevel()

virtual int ZoomConstraint::getMaxZoomLevel ( ) const
inlinevirtualinherited

Return the maximum zoom level within range for this constraint.

Definition at line 62 of file ZoomConstraint.h.

Referenced by getNearestBlockSize(), PowerOfSqrtTwoZoomConstraint::getNearestBlockSize(), and ZoomConstraint::getNearestBlockSize().


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