PowerOfSqrtTwoZoomConstraint Class Reference

#include <PowerOfSqrtTwoZoomConstraint.h>

Inherits ZoomConstraint.

Inherited by SpectrogramLayer.

Inheritance diagram for PowerOfSqrtTwoZoomConstraint:

Inheritance graph
[legend]
Collaboration diagram for PowerOfSqrtTwoZoomConstraint:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 21 of file PowerOfSqrtTwoZoomConstraint.h.

Public Types

enum  RoundingDirection { RoundDown, RoundUp, RoundNearest }

Public Member Functions

virtual size_t getNearestBlockSize (size_t 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.
virtual size_t getNearestBlockSize (size_t requestedBlockSize, int &type, int &power, RoundingDirection dir=RoundNearest) const
virtual size_t getMinCachePower () const
virtual size_t getMaxZoomLevel () const
 Return the maximum zoom level within range for this constraint.


Member Enumeration Documentation

enum ZoomConstraint::RoundingDirection [inherited]

Enumerator:
RoundDown 
RoundUp 
RoundNearest 

Definition at line 35 of file ZoomConstraint.h.


Member Function Documentation

size_t PowerOfSqrtTwoZoomConstraint::getNearestBlockSize ( size_t  requestedBlockSize,
RoundingDirection  dir = 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 23 of file PowerOfSqrtTwoZoomConstraint.cpp.

Referenced by WaveFileModel::getSummaries(), WaveFileModel::getSummaryBlockSize(), and View::getZoomConstraintBlockSize().

size_t PowerOfSqrtTwoZoomConstraint::getNearestBlockSize ( size_t  requestedBlockSize,
int &  type,
int &  power,
RoundingDirection  dir = RoundNearest 
) const [virtual]

Definition at line 32 of file PowerOfSqrtTwoZoomConstraint.cpp.

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

virtual size_t PowerOfSqrtTwoZoomConstraint::getMinCachePower (  )  const [inline, virtual]

Definition at line 34 of file PowerOfSqrtTwoZoomConstraint.h.

Referenced by getNearestBlockSize(), WaveFileModel::getSummaries(), WaveFileModel::getSummaryBlockSize(), and WaveFileModel::RangeCacheFillThread::run().

virtual size_t ZoomConstraint::getMaxZoomLevel (  )  const [inline, virtual, inherited]

Return the maximum zoom level within range for this constraint.

Definition at line 62 of file ZoomConstraint.h.

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


The documentation for this class was generated from the following files:
Generated on Wed Feb 20 15:45:35 2008 for SonicVisualiser by  doxygen 1.5.1