Skip to content

Commit e686349

Browse files
committed
Added some useful methods to GenInfo (size and dimension)
1 parent 4093552 commit e686349

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/data_structures/APR/GenInfo.hpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,14 @@ class GenInfo {
3737
GenInfo() {}
3838
GenInfo(const PixelDataDim &dim) { init(dim); }
3939

40-
size_t getSize() const { return (size_t)y_num[l_max] * x_num[l_max] * z_num[l_max]; }
40+
/* Returns the size of the original image at a given level */
41+
size_t getSize(int level) const { return (size_t)y_num[level] * x_num[level] * z_num[level]; }
42+
/* Returns the size of the original image at max level*/
43+
size_t getSize() const { return getSize(l_max); }
44+
/* Returns the dimensions of the original image at a given level */
45+
PixelDataDim getDimension(int level) const { return PixelDataDim(y_num[level], x_num[level], z_num[level]); }
46+
/* Returns the dimensions of the original image at max level */
47+
PixelDataDim getDimension() const { return getDimension(l_max); }
4148

4249
//initialize the information given the original dimensions
4350
void init(const PixelDataDim &dim) {

0 commit comments

Comments
 (0)