volmetrics
diff src/volume.cc @ 4:1fbbe10c8e08
quick backup
author | Eleni Maria Stea <elene.mst@gmail.com> |
---|---|
date | Sat, 11 Jan 2014 23:49:58 +0200 |
parents | 927c29b93009 |
children | 92c163c939be |
line diff
1.1 --- a/src/volume.cc Sat Jan 11 22:55:27 2014 +0200 1.2 +++ b/src/volume.cc Sat Jan 11 23:49:58 2014 +0200 1.3 @@ -1,1 +1,30 @@ 1.4 +#include <stdio.h> 1.5 + 1.6 #include "volume.h" 1.7 + 1.8 +Volume::Volume() 1.9 +{ 1.10 + width = height = 0; 1.11 +} 1.12 + 1.13 +bool Volume::load_volume(const char *fname) 1.14 +{ 1.15 + return true; 1.16 +} 1.17 + 1.18 +bool Volume::push_slice(Image &&slice) 1.19 +{ 1.20 + if(slices.empty()) { 1.21 + width = slice.get_width(); 1.22 + height = slice.get_height(); 1.23 + } 1.24 + else { 1.25 + if(width != slice.get_width() || height != slice.get_height()) { 1.26 + fprintf(stderr, "failed to load slice no: %d\n", (int)slices.size() + 1); 1.27 + return false; 1.28 + } 1.29 + } 1.30 + 1.31 + slices.push_back(slice); 1.32 + return true; 1.33 +}