/usr/include/gamera/static_image.hpp is in python-gamera-dev 1:3.4.2+git20160808.1725654-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | /*
*
* Copyright (C) 2001-2005 Ichiro Fujinaga, Michael Droettboom, and Karl MacMillan
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef kwm01102002_static_image
#define kwm01102002_static_image
/*
This is a convenience class that encapsulates a view
and image data. KWM
*/
#include "image_view.hpp"
#include "image_data.hpp"
namespace Gamera {
template<class T>
class StaticImage : public ImageView<ImageData<T> > {
protected:
using ImageView<ImageData<T> >::calculate_iterators;
using ImageView<ImageData<T> >::range_check;
public:
using ImageView<ImageData<T> >::nrows;
using ImageView<ImageData<T> >::ncols;
typedef Rect rect_type;
typedef Size size_type;
typedef Point point_type;
typedef StaticImage self;
typedef ImageView<ImageData<T> > view_type;
/*
The only difference between this class and the standard
ImageView is that there is a member for the data. These
constructors call the base class constructor (passing false
to suppress range checking because the data is not correctly
sized when the base class is constructed - we cannot override this
order because the base class is always constructed before the members
are initialized - sigh), size the data,
do a range check, and then calculate the iterators. To resize
the data when the size of the view changes, it is only necessary
to override the dimensions_changed method (see below).
*/
StaticImage(const point_type& lower_right)
: view_type(m_data, point_type(), lower_right, false) {
m_data.dimensions(nrows(), ncols());
range_check();
calculate_iterators();
}
StaticImage(const size_type& size)
: view_type(m_data, point_type(), size, false) {
m_data.dimensions(nrows(), ncols());
range_check();
calculate_iterators();
}
StaticImage(const Dim& dim)
: view_type(m_data, point_type(), dim, false) {
m_data.dimensions(nrows(), ncols());
range_check();
calculate_iterators();
}
protected:
virtual void dimensions_change() {
m_data.dimensions(nrows(), ncols());
range_check();
calculate_iterators();
}
private:
ImageData<T> m_data;
};
};
#endif
|