Mercurial > hg > svcore
comparison base/ZoomConstraint.h @ 1528:a7485c1bdba5
Tests and a couple of minor fixes for zoom constraints
author | Chris Cannam |
---|---|
date | Tue, 18 Sep 2018 15:04:46 +0100 |
parents | 48e9f538e6e9 |
children | c1c45c5146bb |
comparison
equal
deleted
inserted
replaced
1526:8988b27ebf38 | 1528:a7485c1bdba5 |
---|---|
11 published by the Free Software Foundation; either version 2 of the | 11 published by the Free Software Foundation; either version 2 of the |
12 License, or (at your option) any later version. See the file | 12 License, or (at your option) any later version. See the file |
13 COPYING included with this distribution for more information. | 13 COPYING included with this distribution for more information. |
14 */ | 14 */ |
15 | 15 |
16 #ifndef _ZOOM_CONSTRAINT_H_ | 16 #ifndef SV_ZOOM_CONSTRAINT_H |
17 #define _ZOOM_CONSTRAINT_H_ | 17 #define SV_ZOOM_CONSTRAINT_H |
18 | 18 |
19 #include <stdlib.h> | 19 #include <stdlib.h> |
20 | 20 |
21 /** | 21 /** |
22 * ZoomConstraint is a simple interface that describes a limitation on | 22 * ZoomConstraint is a simple interface that describes a limitation on |
47 * requested but the underlying model only supports value | 47 * requested but the underlying model only supports value |
48 * summaries at powers-of-two block sizes, return 1024 or 2048 | 48 * summaries at powers-of-two block sizes, return 1024 or 2048 |
49 * depending on the rounding direction supplied. | 49 * depending on the rounding direction supplied. |
50 */ | 50 */ |
51 virtual int getNearestBlockSize(int requestedBlockSize, | 51 virtual int getNearestBlockSize(int requestedBlockSize, |
52 RoundingDirection = RoundNearest) | 52 RoundingDirection = RoundNearest) |
53 const | 53 const |
54 { | 54 { |
55 if (requestedBlockSize > getMaxZoomLevel()) return getMaxZoomLevel(); | 55 if (requestedBlockSize > getMaxZoomLevel()) return getMaxZoomLevel(); |
56 else return requestedBlockSize; | 56 else return requestedBlockSize; |
57 } | 57 } |