pandore::Img2d< T > Class Template Reference

#include <image.h>

Inheritance diagram for pandore::Img2d< T >:

pandore::Imx2d< T > pandore::Imx3d< T > List of all members.

Detailed Description

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

The 2D gray level image.

A Img2d < /code> is a gray level 2D image. A 2D gray level image is implemented as one 2D array of pixels, where a pixel is of T type.
For the use of Img2d images see The Images.


Public Types

typedef T ValueType

Public Member Functions

Typobj Type () const
std::string Name () const
 Img2d ()
 Img2d (Long h, Long w, T *data=0, bool isOwner=false)
 Img2d (const Dimension2d &d, T *data=0, bool isOwner=false)
 Img2d (const PobjectProps &p, T *data=0, bool isOwner=false)
void New (Long h, Long w, T *data=0, bool isOwner=false)
void New (const Dimension2d &d, T *data=0, bool isOwner=false)
void New (const PobjectProps &p, T *data=0, bool isOwner=false)
Pobject * Clone () const
Img2d< T > & operator= (const T val)
template<typename U>
Img2d< T > & operator= (const Img2d< U > &src)
Img2d< T > & operator= (const Img2d< T > &src)
ValueTypeVector () const
Imx3d< T >::Band1d operator[] (Long row)
const Imx3d< T >::Band1d operator[] (Long row) const
ValueTypeoperator() (Long y, Long x)
const ValueTypeoperator() (Long y, Long x) const
ValueTypeoperator[] (const Point2d &p)
const ValueTypeoperator[] (const Point2d &p) const
ValueTypeoperator() (int, const Point2d &p)
const ValueTypeoperator() (int, const Point2d &p) const
ValueTypeoperator() (const Point2d &p)
const ValueTypeoperator() (const Point2d &p) const
 Img2d (const Img2d &ims)


Member Typedef Documentation

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

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

Reimplemented from pandore::Imx2d< T >.

Reimplemented in pandore::Reg2d.


Constructor & Destructor Documentation

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

Creates a new image with no size and no data.

template<typename T>
pandore::Img2d< T >::Img2d 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:
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::Img2d< T >::Img2d const Dimension2d d,
T *  data = 0,
bool  isOwner = false
[inline]
 

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

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

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

Creates a new image with the specified properties. Allocates therefrom the related data. If data = 0 then data are allocated and freed by the image else data are allocated and freed externally.

Warning:
the pixel values are not initialized with 0.
Parameters:
p the properties.
data the vector of data.
isOwner is the image responsible for deleting the data.

template<typename T>
pandore::Img2d< T >::Img2d const Img2d< 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::Img2d< T >::Clone  )  const [inline, virtual]
 

Creates and returns a distinct copy of this object.

Returns:
a new image.

Reimplemented from pandore::Imx2d< T >.

Reimplemented in pandore::Reg2d.

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

Returns the type name (for instance Img2duc or Img2dsl or Img2dsf).

Reimplemented from pandore::Imx2d< T >.

Reimplemented in pandore::Reg2d.

template<typename T>
void pandore::Img2d< 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 image data vector.
isOwner is the image responsible for deleting the data.

Reimplemented from pandore::Imx2d< T >.

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

Sets the image data with the specified vector of data If data = 0 then data are allocated and freed by the image else data are allocated and freed externally.

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

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

Sets the image data with the specified vector of data If data = 0 then data are allocated and freed by the image else data are allocated and freed externally.

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

template<typename T>
const ValueType& pandore::Img2d< T >::operator() const Point2d p  )  const [inline]
 

Returns the pixel at the specified coordinates.

Parameters:
p the coordinate.

template<typename T>
ValueType& pandore::Img2d< T >::operator() const Point2d p  )  [inline]
 

Returns the pixel at the specified coordinates.

Parameters:
p the coordinate.

template<typename T>
const ValueType& pandore::Img2d< T >::operator() int  ,
const Point2d p
const [inline]
 

Returns the pixel at the specified coordinates.

Parameters:
p the coordinate.

template<typename T>
ValueType& pandore::Img2d< T >::operator() int  ,
const Point2d p
[inline]
 

Returns the pixel at the specified coordinates.

Parameters:
p the coordinate.

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

Returns the pixel value at the specified coordinates.

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

Reimplemented in pandore::Reg2d.

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

Returns the pixel value at the specified coordinates.

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

Reimplemented in pandore::Reg2d.

template<typename T>
Img2d< T >& pandore::Img2d< T >::operator= const Img2d< 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>
Img2d< T >& pandore::Img2d< T >::operator= const Img2d< 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>
Img2d< T >& pandore::Img2d< 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::Imx2d< T >.

template<typename T>
const ValueType& pandore::Img2d< T >::operator[] const Point2d p  )  const [inline]
 

Returns the pixel at the specified coordinates.

Parameters:
p the coordinate.

Reimplemented in pandore::Reg2d.

template<typename T>
ValueType& pandore::Img2d< T >::operator[] const Point2d p  )  [inline]
 

Returns the pixel at the specified coordinates.

Parameters:
p the coordinate.

Reimplemented in pandore::Reg2d.

template<typename T>
const Imx3d< T>::Band1d pandore::Img2d< T >::operator[] Long  row  )  const [inline]
 

Returns the line at the specified row.

Parameters:
row the row number.

Reimplemented from pandore::Imx2d< T >.

Reimplemented in pandore::Reg2d.

template<typename T>
Imx3d< T>::Band1d pandore::Img2d< T >::operator[] Long  row  )  [inline]
 

Returns the line at the specified row.

Parameters:
row the row number.

Reimplemented from pandore::Imx2d< T >.

Reimplemented in pandore::Reg2d.

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

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

Reimplemented from pandore::Imx2d< T >.

Reimplemented in pandore::Reg2d.

template<typename T>
ValueType* pandore::Img2d< T >::Vector  )  const [inline]
 

Returns the image data as a unique vector.

Reimplemented in pandore::Reg2d.


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