7 #include "PixelTraits.h" 57 Image(
int w,
int h) : Base(w,h) {}
64 Image(
int w,
int h,
int d) : Base(w,h,d) {}
76 Image(T* ptr,
const Coords<dim>& sz,
bool handleDelete=
false) : Base(ptr,sz,handleDelete) {}
88 Image(T* ptr,
int w,
int h,
bool handleDelete=
false) : Base(ptr,w,h,handleDelete) {}
99 Image(T* ptr,
int w,
int h,
int d,
bool handleDelete=
false) : Base(ptr,w,h,d,handleDelete) {}
198 template <
typename V>
typename PixelTraits<T>::template CastPixel<V>::value_type
interpolate(
const FVector<V,dim>& c)
const {
return Imagine::interpolate(*
this,c); }
200 template <
typename V>
typename PixelTraits<T>::template CastPixel<V>::value_type
interpolate(V x, V y)
const {
return Imagine::interpolate(*
this,
FVector<V,2>(x,y)); }
202 template <
typename V>
typename PixelTraits<T>::template CastPixel<V>::value_type
interpolate(V x, V y, V z)
const {
return Imagine::interpolate(*
this,
FVector<V,3>(x,y,z)); }
214 T
neumann(
int x,
int y,
int z)
const {
return NeumannBorder<T,3>()(*
this,
Coords<3>(x,y,z)); }
225 T
dirichlet(
int x,
int y, T out= T(0))
const {
return DirichletBorder<T,2>(out)(*
this,
Coords<2>(x,y)); }
227 T
dirichlet(
int x,
int y,
int z, T out= T(0))
const {
return DirichletBorder<T,3>(out)(*
this,
Coords<3>(x,y,z)); }
239 T
mirror(
int x,
int y,
int z)
const {
return MirrorBorder<T,3>()(*
this,
Coords<3>(x,y,z)); }
275 for (const_iterator it = I.
begin() ; it != I.
end() ; ++it) {
288 assert( !std::numeric_limits<T>::is_integer );
289 return ::sqrt(
norm2(I));
299 iterator it3 = C.
begin();
300 for (const_iterator it1 = this->
begin() ; it1 != this->
end() ; ++it1, ++it3)
314 iterator it3 = C.begin();
315 for (const_iterator it1 = this->
begin(), it2 = B.
begin() ; it1 != this->
end() ; ++it1, ++it2, ++it3)
328 iterator it1 = this->
begin();
329 for (const_iterator it2 = B.
begin() ; it2 != B.
end() ; ++it1, ++it2)
343 iterator it3 = C.begin();
344 for (const_iterator it1 = this->
begin(), it2 = B.
begin() ; it1 != this->
end() ; ++it1, ++it2, ++it3)
357 iterator it1 = this->
begin();
358 for (const_iterator it2 = B.
begin() ; it2 != B.
end() ; ++it1, ++it2)
371 iterator it3 = C.
begin();
372 for (const_iterator it1 = this->
begin() ; it1 != this->
end() ; ++it1, ++it3)
393 for (iterator it = this->
begin() ; it != this->
end() ; ++it)
406 iterator it3 = C.
begin();
407 for (const_iterator it1 = this->
begin() ; it1 != this->
end() ; ++it1, ++it3)
428 for (iterator it = this->
begin() ; it != this->
end() ; ++it)
441 iterator it3 = C.
begin();
442 for (const_iterator it1 = this->
begin() ; it1 != this->
end() ; ++it1, ++it3)
463 for (iterator it = this->
begin() ; it != this->
end() ; ++it)
476 iterator it3 = C.
begin();
477 for (const_iterator it1 = this->
begin() ; it1 != this->
end() ; ++it1, ++it3)
489 for (iterator it = this->
begin() ; it != this->
end() ; ++it)
503 iterator it3 = C.begin();
505 for (const_iterator it1 = this->
begin() ; it1 != this->
end() ; ++it1, ++it2, ++it3)
518 iterator it1 = this->
begin();
533 iterator it3 = C.begin();
535 for (const_iterator it1 = this->
begin() ; it1 != this->
end() ; ++it1, ++it2, ++it3)
548 iterator it1 = this->
begin();
T mirror(const Coords< dim > &c) const
Mirror access.
Definition: Image.h:235
Coordinates.
Definition: Coords.h:16
Image operator*(scalar_type s) const
Scalar multiplication.
Definition: Image.h:439
Image & operator/=(scalar_type s)
In place scalar division.
Definition: Image.h:488
Vector of fixed size.
Definition: FVector.h:17
Image(const Coords< dim > &sz)
Constructor (known size).
Definition: Image.h:50
Image operator-(T v) const
Constant substraction.
Definition: Image.h:404
Image(int w, int h, int d)
Constructor (known size, 3D).
Definition: Image.h:64
Image operator+(const Image &B) const
Addition.
Definition: Image.h:311
PixelTraits< T >::scalar_type scalar_type
Scalar type.
Definition: Image.h:32
T mirror(int x, int y, int z) const
Mirror access (3D alias).
Definition: Image.h:239
Image operator-(const Image &B) const
Substraction.
Definition: Image.h:340
Base::const_iterator const_iterator
Const iterator type.
Definition: Image.h:36
PixelTraits< T >::template CastPixel< V >::value_type interpolate(V x, V y, V z) const
Interpolation with automated return type, 3D alias.
Definition: Image.h:202
Image & operator*=(scalar_type s)
In place scalar multiplication.
Definition: Image.h:462
Image & operator-=(const Image &B)
In place substraction.
Definition: Image.h:355
Image & operator*=(const Image< scalar_type, dim > &B)
In place pointwise scalar multiplication.
Definition: Image.h:516
T dirichlet(int x, int y, T out=T(0)) const
Dirichlet (2D alias).
Definition: Image.h:225
Image & fill(T x)
Filling.
Definition: Image.h:154
Image operator/(scalar_type s) const
Scalar division.
Definition: Image.h:474
MultiArray clone() const
Cloning.
Definition: MultiArray.h:191
Array of variable size.
Definition: Array.h:20
Image(int w, int h)
Constructor (known size, 2D).
Definition: Image.h:57
friend scalar_type norm(const Image &I)
Euclidean norm.
Definition: Image.h:287
Image & operator=(const Base &I)
Assignment.
Definition: Image.h:126
Image & operator-=(T v)
In place constant substraction.
Definition: Image.h:427
MultiArray & operator=(const MultiArray &A)
Assignment.
Definition: MultiArray.h:175
Image(T *ptr, int w, int h, int d, bool handleDelete=false)
Constructor (pre-allocated 3D).
Definition: Image.h:99
T invMirror(int x, int y, int z) const
Inversed mirror access (3D alias).
Definition: Image.h:251
Image getSubImage(int x, int y, int w, int h) const
Sub image (2D).
Definition: Image.h:175
Image()
Empty constructor.
Definition: Image.h:43
MultiArray getSubArray(const Coords< dim > &offset, const Coords< dim > &sz) const
Sub array.
Definition: MultiArray.h:269
friend T sum(const Image &I)
Sum of pixels.
Definition: Image.h:263
T dirichlet(int x, int y, int z, T out=T(0)) const
Dirichlet (3D alias).
Definition: Image.h:227
Image getSubImage(int x, int y, int z, int w, int h, int d) const
Sub image (3D).
Definition: Image.h:186
Coords< dim > sizes() const
Sizes.
Definition: MultiArray.h:211
friend Image operator-(T v, const Image &I)
Constant substraction.
Definition: Image.h:419
T invMirror(const Coords< dim > &c) const
Inversed mirror access.
Definition: Image.h:247
Image.
Definition: Image.h:24
size_t offset(const Coords< dim > &c) const
Offset.
Definition: MultiArray.h:283
Image(const Base &I)
Copy constructor.
Definition: Image.h:106
Image operator/(const Image< scalar_type, dim > &B) const
Pointwise scalar division.
Definition: Image.h:530
friend scalar_type norm2(const Image &I)
Squared Euclidean norm.
Definition: Image.h:273
friend Image operator+(T v, const Image &I)
Constant addition.
Definition: Image.h:384
Image operator+(T v) const
Constant addition.
Definition: Image.h:369
Image operator-() const
Opposite.
Definition: Image.h:297
Image getSubImage(const Coords< dim > &offset, const Coords< dim > &sz) const
Sub image.
Definition: Image.h:163
friend Image operator*(scalar_type s, const Image &I)
Scalar multiplication.
Definition: Image.h:454
Image(const MultiArray< T2, dim > &I)
Constructor (different type).
Definition: Image.h:115
Image operator*(const Image< scalar_type, dim > &B) const
Pointwise scalar multiplication.
Definition: Image.h:500
T neumann(int x, int y) const
Neumann (2D alias).
Definition: Image.h:212
nD array of variable size.
Definition: MultiArray.h:21
Image & operator+=(T v)
In place constant addition.
Definition: Image.h:392
PixelTraits< T >::template CastPixel< V >::value_type interpolate(V x, V y) const
Interpolation with automated return type, 2D alias.
Definition: Image.h:200
MultiArray & fill(T x)
Filling.
Definition: MultiArray.h:204
T mirror(int x, int y) const
Mirror access (2D alias).
Definition: Image.h:237
T neumann(int x, int y, int z) const
Neumann (3D alias).
Definition: Image.h:214
T invMirror(int x, int y) const
Inversed mirror access (2D alias).
Definition: Image.h:249
Base::iterator iterator
Iterator type.
Definition: Image.h:34
T dirichlet(const Coords< dim > &c, T out=T(0)) const
Dirichlet access.
Definition: Image.h:223
iterator begin()
Begin iterator.
Definition: Array.h:231
Imagine++ namespace.
Definition: Array.h:7
virtual ~Image()
Destructor.
Definition: Image.h:118
Image(T *ptr, const Coords< dim > &sz, bool handleDelete=false)
Constructor (pre-allocated).
Definition: Image.h:76
RED GREEN BLUE color.
Definition: Color.h:26
const T * const_iterator
Const iterator type.
Definition: Array.h:73
Image(T *ptr, int w, int h, bool handleDelete=false)
Constructor (pre-allocated 2D).
Definition: Image.h:88
iterator end()
End iterator.
Definition: Array.h:245
T neumann(const Coords< dim > &c) const
Neumann access.
Definition: Image.h:210
Image & operator+=(const Image &B)
In place Addition.
Definition: Image.h:326
Image & operator/=(const Image< scalar_type, dim > &B)
In place pointwise scalar division.
Definition: Image.h:546
Image clone() const
Cloning.
Definition: Image.h:146
PixelTraits< T >::template CastPixel< V >::value_type interpolate(const FVector< V, dim > &c) const
Interpolation.
Definition: Image.h:198