25 #ifndef IMAGE_STATE_IMPL_HH
26 #define IMAGE_STATE_IMPL_HH
29 #include <boost/shared_ptr.hpp>
39 namespace ost {
namespace img {
43 namespace image_state {
58 template <
typename T,
class D>
59 class TEMPLATE_EXPORT ImageStateImpl:
public ImageStateBase
84 virtual std::size_t MemSize()
const;
90 virtual void SetSpatialOrigin(
const Point& o);
92 virtual void CenterSpatialOrigin();
94 virtual Point GetSpatialOrigin()
const;
96 virtual Extent GetExtent()
const;
98 virtual Extent GetLogicalExtent()
const;
100 virtual Real GetReal(
const Point &p)
const;
102 virtual void SetReal(
const Point &p,
const Real& r);
106 virtual void SetComplex(
const Point &p,
const Complex& c);
108 virtual Real GetIntpolReal(
const Vec3 &v)
const;
109 virtual Real GetIntpolReal(
const Vec2 &v)
const;
110 virtual Real GetIntpolReal(
const Real &d)
const;
112 virtual Complex GetIntpolComplex(
const Vec3 &v)
const;
113 virtual Complex GetIntpolComplex(
const Vec2 &v)
const;
114 virtual Complex GetIntpolComplex(
const Real &d)
const;
122 virtual Vec3 GetAbsoluteOrigin()
const;
124 virtual void SetAbsoluteOrigin(
const Vec3& c);
126 virtual Vec3 IndexToCoord(
const Point &p)
const;
128 virtual Vec3 CoordToIndex(
const Vec3& c)
const;
130 virtual Vec3 FractionalIndexToCoord(
const Vec3 &p)
const;
132 void AdjustPhaseOrigin(
const Point& p);
147 assert(domain_.GetExtent().Contains(p));
148 return data_.Value(domain_.Point2Index(p));
154 assert(domain_.GetExtent().Contains(p));
155 return data_.Value(domain_.Point2Index(p));
159 T GetCheckedValue(
const Point& p)
const;
162 void SetCheckedValue(
const Point& p,
const T& v);
168 T CalcIntpolValue(
const Vec3& v)
const;
169 T CalcIntpolValue(
const Vec2& v)
const;
170 T CalcIntpolValue(
const Real& v)
const;
173 T& Value(
const Index& i);
176 const T& Value(
const Index& i)
const;
179 T& Value(std::size_t i);
182 const T& Value(std::size_t i)
const;
190 Size GetSize()
const;
224 template <
typename U>
void add_scalar(
const U& v);
225 template <
typename U>
void mul_scalar(
const U& v);
out-of-place modifying image state const visitor base class
in-place modifying image state const visitor base class
T & Value(const Point &p)
DataDomain
underlying data type
boost::shared_ptr< ImageStateImpl< T, D > > SharedPtrType
morphing image state visitor base class
std::complex< Real > Complex
Abstract base class for data.
Helper class to handle pixel sampling.
class encapsulating 1D to 3D size
Defines lower and upper valid indices.
non-modifying image state visitor base class
in-place modifying image state visitor base class
Three dimensional vector class, using Real precision.
out-of-place modifying image state visitor base class
const T & Value(const Point &p) const
ImageStateImpl< T, D > StateType
boost::shared_ptr< ImageStateBase > ImageStateBasePtr
class encapsulating 1D to 3D point