2 //////////////////////////////////////////////////////////////////////////////////
3 // This program is free software: you can redistribute it and/or modify //
4 // it under the terms of the version 3 of the GNU General Public License //
5 // as published by the Free Software Foundation. //
7 // This program is distributed in the hope that it will be useful, but //
8 // WITHOUT ANY WARRANTY; without even the implied warranty of //
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU //
10 // General Public License for more details. //
12 // You should have received a copy of the GNU General Public License //
13 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
15 // Written by Francois Fleuret //
16 // (C) Ecole Polytechnique Federale de Lausanne //
17 // Contact <pom@epfl.ch> for comments & bug reports //
18 //////////////////////////////////////////////////////////////////////////////////
23 #include "rectangle.h"
24 #include "proba_view.h"
31 int _nb_cameras, _nb_positions;
32 int _view_width, _view_height;
34 Rectangle *_rectangles;
38 Room(int view_width, int view_height, int nb_cameras, int nb_positions);
41 inline int nb_positions() const { return _nb_positions; }
42 inline int nb_cameras() const { return _nb_cameras; }
43 inline int view_width() const { return _view_width; }
44 inline int view_height() const { return _view_height; }
46 inline Rectangle *avatar(int n_camera, int n_position) const {
47 ASSERT(n_camera >= 0 && n_camera < _nb_cameras &&
48 n_position >= 0 && n_position < _nb_positions,
49 "Index out of bounds");
50 return _rectangles + n_camera * _nb_positions + n_position;
53 void save_stochastic_view(char *name, int ncam, const ProbaView *view,
54 const Vector<scalar_t> *proba_presence) const;