pandore::Imx2d< T > Class Template Reference

#include <image.h>

Inheritance diagram for pandore::Imx2d< T >:

pandore::Imx3d< T > pandore::Imc2d< T > pandore::Img2d< T > List of all members.

Detailed Description

template<typename T>
class pandore::Imx2d< T >

The 2D multispectral image.

A Imx2d < /code> is a multispectral 2D image. A 2D multispectral image is implemented as n 2D arrays of pixels, where a pixel is of T type and n is the number of bands.
For the use of Imx2d images see The Images.


Public Types

typedef T ValueType

Public Member Functions

Typobj Type () const
std::string Name () const
Dimension2d Size () const
 Imx2d ()
 Imx2d (Long b, Long h, Long w, T *data=0, bool isOwner=false)
 Imx2d (Long b, const Dimension2d &d, T *data=0, bool isOwner=false)
 Imx2d (const PobjectProps &p, T *data=0, bool isOwner=false)
void New (Long b, Long h, Long w, T *data=0, bool isOwner=false)
void New (Long b, const Dimension2d &d, T *data=0, bool isOwner=false)
void New (const PobjectProps &p, T *data=0, bool isOwner=false)
Pobject * Clone () const
Imx2d< T > & operator= (const T val)
template<typename U>
Imx2d< T > & operator= (const Imx2d< U > &src)
Imx2d< T > & operator= (const Imx2d< T > &src)
T * Vector (Long band=0) const
Imx3d< T >::Band2d operator[] (Long band)
const Imx3d< T >::Band2d operator[] (Long band) const
T & operator() (Long b, Long y, Long x)
const T & operator() (Long b, Long y, Long x) const
const T & operator() (Long b, Point2d &p) const
T & operator() (Long b, Point2d &p)
Errc LoadAttributes (FILE *file)
Errc SaveAttributes (FILE *file) const
Pobject * Mask (const Pobject *mask)
Pobject * UnMask (const Pobject *mask, const Pobject *reference)
bool Hold (Long y, Long x) const
bool Hold (const Point2d &pt) const
Errc Frame (ValueType val, Long h)
Errc Frame (ValueType val, Long h, Long l)
template<typename U>
Errc Frame (const Imx2d< U > &ims, Long h)
template<typename U>
Errc Frame (const Imx2d< U > &ims, Long h, Long l)
 Imx2d (const Imx2d &ims)


Member Typedef Documentation

template<typename T>
typedef T pandore::Imx2d< T >::ValueType
 

The type of the data (Uchar, Long or Float).

Reimplemented from pandore::Imx3d< T >.

Reimplemented in pandore::Img2d< T >, pandore::Imc2d< T >, pandore::Reg2d, and pandore::Img2d< Long >.


Constructor & Destructor Documentation

template<typename T>
pandore::Imx2d< T >::Imx2d  )  [inline]
 

Creates a new image with no size and no data.

template<typename T>
pandore::Imx2d< T >::Imx2d Long  b,
Long  h,
Long  w,
T *  data = 0,
bool  isOwner = false
[inline]
 

Creates a new image with the specified dimensions, and the specified data. If data=0 then data are allocated and freed by the image else data are allocated and freed externally.

Parameters:
b the number of bands of the image.
h the height of the image.
w the width of the image.
data the vector of data.
isOwner is the image responsible for deleting the data.

template<typename T>
pandore::Imx2d< T >::Imx2d Long  b,
const Dimension2d d,
T *  data = 0,
bool  isOwner = false
[inline]
 

Creates a new image with the specified dimensions, and the specified data. If data=0 then data are allocated and freed by the image else data are allocated and freed externally.

Parameters:
b the number of bands of the image.
d the dimension of the image.
data the vector of data.
isOwner is the image responsible for deleting the data.

template<typename T>
pandore::Imx2d< T >::Imx2d const PobjectProps &  p,
T *  data = 0,
bool  isOwner = false
[inline]
 

Allocates the image data from the specified properties. If data=0 then data are allocated and freed by the image else data are allocated and freed externally.

Parameters:
p the properties of the image.
data the vector of data.
isOwner is the image responsible for deleting the data.

template<typename T>
pandore::Imx2d< T >::Imx2d const Imx2d< T > &  ims  )  [inline]
 

Creates the image content by copy. Allocates the related data and sets the values with the ims values. If needed casts the values by using the C casting.

Parameters:
ims the specified image.


Member Function Documentation

template<typename T>
Pobject* pandore::Imx2d< T >::Clone  )  const [inline, virtual]
 

Creates and returns a distinct copy of this object.

Returns:
a new image.

Reimplemented from pandore::Imx3d< T >.

Reimplemented in pandore::Img2d< T >, pandore::Imc2d< T >, pandore::Reg2d, and pandore::Img2d< Long >.

template<typename T>
template<typename U>
Errc pandore::Imx2d< T >::Frame const Imx2d< U > &  ims,
Long  h,
Long  l
[inline]
 

Fills the specified border of the image with the related value of the specified image.

Parameters:
ims the reference image.
h the height of the border.
l the width of the border.

template<typename T>
template<typename U>
Errc pandore::Imx2d< T >::Frame const Imx2d< U > &  ims,
Long  h
[inline]
 

Fills the specified border of the image with the related value of the specified image.

Parameters:
ims the reference image.
h the height and width of the border.

template<typename T>
Errc pandore::Imx2d< T >::Frame ValueType  val,
Long  h,
Long  l
[inline]
 

Fills the specified border of the image with the specified value.

Parameters:
val the value.
h the height of the border.
l the width of the border.

template<typename T>
Errc pandore::Imx2d< T >::Frame ValueType  val,
Long  h
[inline]
 

Fills the specified border of the image with the specified value.

Parameters:
val the value.
h the height and width of the border.

Reimplemented from pandore::Imx3d< T >.

template<typename T>
bool pandore::Imx2d< T >::Hold const Point2d pt  )  const [inline]
 

Checks if the image contains the point.

Parameters:
pt the point.
Returns:
true if the point is in the image boundary.

template<typename T>
bool pandore::Imx2d< T >::Hold Long  y,
Long  x
const [inline]
 

Checks if the image contains the point at the specified location (x, y).

Parameters:
x the column coordinate.
y the row coordinate.
Returns:
true if the coordinate are in the image boundary.

template<typename T>
Errc pandore::Imx2d< T >::LoadAttributes FILE *  file  )  [inline, virtual]
 

Loads attribute values from the given file. Allocates therefrom the related data.

Warning:
the pixel values are not initialized with 0.
Parameters:
file the file where to read attributes values.
Returns:
SUCCESS or FAILURE in case of IO errors.

Reimplemented from pandore::Imx3d< T >.

Reimplemented in pandore::Imc2d< T >, and pandore::Reg2d.

template<typename T>
Pobject* pandore::Imx2d< T >::Mask const Pobject *  mask  )  [inline, virtual]
 

Masks the data from the given mask. It means that pixels are set to 0 when the related label in the mask is 0.

Parameters:
mask the region map that is used as a mask.
Returns:
a new image.

Reimplemented from pandore::Imx3d< T >.

Reimplemented in pandore::Reg2d.

template<typename T>
std::string pandore::Imx2d< T >::Name  )  const [inline]
 

Returns the type name (for instance Imx2duc or Imx2dsl or Imx2dsf).

Reimplemented from pandore::Imx3d< T >.

Reimplemented in pandore::Img2d< T >, pandore::Imc2d< T >, pandore::Reg2d, and pandore::Img2d< Long >.

template<typename T>
void pandore::Imx2d< T >::New const PobjectProps &  p,
T *  data = 0,
bool  isOwner = false
[inline, virtual]
 

Allocates the image data from the specified properties. If data=0 then data are allocated and freed by the image else data are allocated and freed externally.

Parameters:
p the properties of the image.
data the vector of data.
isOwner is the image responsible for deleting the data.

Reimplemented from pandore::Imx3d< T >.

Reimplemented in pandore::Img2d< T >, pandore::Imc2d< T >, and pandore::Img2d< Long >.

template<typename T>
void pandore::Imx2d< T >::New Long  b,
const Dimension2d d,
T *  data = 0,
bool  isOwner = false
[inline]
 

Allocates the image data from the specified band number and dimensions and the specified data. If data=0 then data are allocated and freed by the image else data are allocated and freed externally.

Parameters:
b the number of bands of the image.
d the dimension of the image.
data the vector of data.
isOwner is the image responsible for deleting the data.

Reimplemented in pandore::Imc2d< T >.

template<typename T>
void pandore::Imx2d< T >::New Long  b,
Long  h,
Long  w,
T *  data = 0,
bool  isOwner = false
[inline]
 

Allocates the image data from the specified band number, depth, height and width values and the specified data. If data=0 then data are allocated and freed by the image else data are allocated and freed externally.

Parameters:
b the number of bands of the image.
h the heigth of the image.
w the width of the image.
data the vector of data.
isOwner is the image responsible for deleting the data.

Reimplemented in pandore::Imc2d< T >.

template<typename T>
T& pandore::Imx2d< T >::operator() Long  b,
Point2d p
[inline]
 

Returns the pixel value at the specified coordinates.

Parameters:
b the band.
p point2d.

template<typename T>
const T& pandore::Imx2d< T >::operator() Long  b,
Point2d p
const [inline]
 

Returns the pixel value at the specified coordinates.

Parameters:
b the band.
p point2d.

template<typename T>
const T& pandore::Imx2d< T >::operator() Long  b,
Long  y,
Long  x
const [inline]
 

Returns the pixel value at the specified coordinates.

Parameters:
b the band.
y the y-coordinate.
x the x-coordinate.

template<typename T>
T& pandore::Imx2d< T >::operator() Long  b,
Long  y,
Long  x
[inline]
 

Returns the pixel value at the specified coordinates.

Parameters:
b the band.
y the y-coordinate.
x the x-coordinate.

template<typename T>
Imx2d< T >& pandore::Imx2d< T >::operator= const Imx2d< T > &  src  )  [inline]
 

Sets the pixel values with the pixel values of the given image. This supposes that images have the same dimensions.

Parameters:
src the given image.
Returns:
the image itself.

template<typename T>
template<typename U>
Imx2d< T >& pandore::Imx2d< T >::operator= const Imx2d< U > &  src  )  [inline]
 

Sets the pixel values with the pixel values of the given image. This supposes that images have the same dimensions.

Parameters:
src the given image.
Returns:
the image itself.

template<typename T>
Imx2d< T >& pandore::Imx2d< T >::operator= const T  val  )  [inline]
 

Sets all pixels with the given value.

Parameters:
val the given value.
Returns:
the image itself.

Reimplemented from pandore::Imx3d< T >.

Reimplemented in pandore::Img2d< T >, pandore::Imc2d< T >, and pandore::Img2d< Long >.

template<typename T>
const Imx3d< T>::Band2d pandore::Imx2d< T >::operator[] Long  band  )  const [inline]
 

Returns the specified band of the image data as a unique vector.

Parameters:
band the band number.

Reimplemented from pandore::Imx3d< T >.

Reimplemented in pandore::Img2d< T >, pandore::Reg2d, and pandore::Img2d< Long >.

template<typename T>
Imx3d< T>::Band2d pandore::Imx2d< T >::operator[] Long  band  )  [inline]
 

Returns the specified band of the image data as a unique vector.

Parameters:
band the band number.

Reimplemented from pandore::Imx3d< T >.

Reimplemented in pandore::Img2d< T >, pandore::Reg2d, and pandore::Img2d< Long >.

template<typename T>
Errc pandore::Imx2d< T >::SaveAttributes FILE *  file  )  const [inline, virtual]
 

Saves the current attribute values in the specified file.

Parameters:
file the file.
Returns:
SUCCESS or FAILURE in case of IO errors.

Reimplemented from pandore::Imx3d< T >.

Reimplemented in pandore::Imc2d< T >, and pandore::Reg2d.

template<typename T>
Dimension2d pandore::Imx2d< T >::Size  )  const [inline]
 

Returns the dimension of the image.

Reimplemented from pandore::Imx3d< T >.

template<typename T>
Typobj pandore::Imx2d< T >::Type  )  const [inline]
 

Returns the identifier of the object (ie. the magic number).

Reimplemented from pandore::Imx3d< T >.

Reimplemented in pandore::Img2d< T >, pandore::Imc2d< T >, pandore::Reg2d, and pandore::Img2d< Long >.

template<typename T>
Pobject* pandore::Imx2d< T >::UnMask const Pobject *  mask,
const Pobject *  reference
[inline, virtual]
 

Unmasks the data from the given mask. It means that pixels are set to the pixel value of the reference image when the related label in the mask is 0.

Parameters:
mask the region map that is used as a mask.
reference the image that is used as a reference.
Returns:
a new image.

Reimplemented from pandore::Imx3d< T >.

Reimplemented in pandore::Reg2d.

template<typename T>
T* pandore::Imx2d< T >::Vector Long  band = 0  )  const [inline]
 

Returns the specified band of the image data as a unique vector.

Parameters:
band the band number.

Reimplemented from pandore::Imx3d< T >.


The documentation for this class was generated from the following file:

The Pantheon project
Image Team GREYC Laboratory
UMR CNRS 6072 - ENSICAEN - University of Caen, France
This page was last modified on 19 June 2015