25 #ifndef IMAGE_STATE_HALF_FREQUENCY_DOMAIN_HH
26 #define IMAGE_STATE_HALF_FREQUENCY_DOMAIN_HH
37 #define CONJPOINT(a) ((a)[2]==0 ?((a)[1]==0?(a)[0]>0:(a)[1]>0):(a)[2]>0) ? (a) : -(a)
39 namespace ost {
namespace img {
namespace image_state {
45 return (d&0x1) ? (d-1)/2 : d/2;
50 return (d&0x1) ? -((d-1)/2) : -(d/2-1);
107 logical_extent_(ExtractLogicalExtent(e)),
108 physical_extent_(ExtractPhysicalExtent(e)),
112 assert(dim_>=1 && dim_<=3);
128 template <
typename V>
130 if(logical_extent_.Contains(p)) {
136 template <
typename V>
138 if(logical_extent_.Contains(p)) {
141 data.
Value(Point2Index(cp))=Val2Val<Real,V>(r);
146 template <
typename V>
148 if(logical_extent_.Contains(p)) {
151 return Val2Val<V,Complex>(data.
Value(Point2Index(cp)));
153 return conj(Val2Val<V,Complex>(data.
Value(Point2Index(cp))));
159 template <
typename V>
161 if(logical_extent_.Contains(p)) {
164 data.
Value(Point2Index(cp))=Val2Val<Complex,V>(c);
170 const Size& size=physical_extent_.GetSize();
171 return Index(p[0]>=0?p[0]:size[0]+p[0],
172 p[1]>=0?p[1]:size[1]+p[1],
184 }
else if(e.
GetDim()==2) {
197 }
else if(e.
GetDim()==2) {
Defines lower and upper valid indices.
int GetDim() const
Return dimension.
class encapsulating 1D to 3D point
class encapsulating 1D to 3D size
DataDomain GetDomain() const
Extent GetLogicalExtent() const
Extent ExtractPhysicalExtent(const Extent &e) const
void SetReal(const Point &p, const Real &r, ValueHolder< V > &data)
Point GetSpatialOrigin() const
Extent GetPhysicalExtent() const
Complex GetComplex(const Point &p, const ValueHolder< V > &data) const
HalfFrequencyDomain(const Extent &e)
Real GetReal(const Point &p, const ValueHolder< V > &data) const
void SetComplex(const Point &p, const Complex &c, ValueHolder< V > &data)
void SetSpatialOrigin(const Point &o)
Index Point2Index(const Point &p) const
Extent ExtractLogicalExtent(const Extent &e) const
V & Value(const Index &i)
return direct r/w access to the value without boundary check
#define DLLEXPORT_OST_IMG_BASE
std::complex< Real > Complex
DataDomain
underlying data type