[ VIGRA Homepage | Class Index | Function Index | File Index | Main Page ]

details BasicImage Class Template Reference VIGRA

Fundamental class template for images. More...

#include "vigra/basicimage.hxx"


Public Types

typedef PIXELTYPE value_type
typedef PIXELTYPE PixelType
typedef PIXELTYPE & reference
typedef PIXELTYPE const & const_reference
typedef PIXELTYPE * pointer
typedef PIXELTYPE const * const_pointer
typedef PIXELTYPE * iterator
typedef PIXELTYPE * ScanOrderIterator
typedef PIXELTYPE const * const_iterator
typedef PIXELTYPE const * ConstScanOrderIterator
typedef BasicImageIterator<
PIXELTYPE, PIXELTYPE ** > 
traverser
typedef BasicImageIterator<
PIXELTYPE, PIXELTYPE ** > 
Iterator
typedef ConstBasicImageIterator<
PIXELTYPE, PIXELTYPE ** > 
const_traverser
typedef ConstBasicImageIterator<
PIXELTYPE, PIXELTYPE ** > 
ConstIterator
typedef traverser::row_iterator row_iterator
typedef const_traverser::row_iterator const_row_iterator
typedef traverser::column_iterator column_iterator
typedef const_traverser::column_iterator const_column_iterator
typedef Diff2D difference_type
typedef Size2D size_type
typedef IteratorTraits< traverser
>::DefaultAccessor 
Accessor
typedef IteratorTraits< const_traverser
>::DefaultAccessor 
ConstAccessor
typedef Alloc allocator_type

Public Methods

 BasicImage ()
 BasicImage (Alloc const &alloc)
 BasicImage (int width, int height, Alloc const &alloc=Alloc())
 BasicImage (difference_type const &size, Alloc const &alloc=Alloc())
 BasicImage (int width, int height, value_type const &d, Alloc const &alloc=Alloc())
 BasicImage (difference_type const &size, value_type const &d, Alloc const &alloc=Alloc())
 BasicImage (int width, int height, const_pointer d, Alloc const &alloc=Alloc())
 BasicImage (difference_type const &size, const_pointer d, Alloc const &alloc=Alloc())
 BasicImage (const BasicImage &rhs)
 ~BasicImage ()
BasicImage & operator= (const BasicImage &rhs)
BasicImage & operator= (value_type pixel)
BasicImage & init (value_type const &pixel)
void resize (int width, int height)
void resize (difference_type const &size)
void resize (int width, int height, value_type const &d)
void resizeCopy (int width, int height, const_pointer data)
void resizeCopy (const BasicImage &rhs)
void swap (BasicImage &rhs)
int width () const
int height () const
size_type size () const
bool isInside (difference_type const &d) const
reference operator[] (difference_type const &d)
const_reference operator[] (difference_type const &d) const
reference operator() (int dx, int dy)
const_reference operator() (int dx, int dy) const
pointer operator[] (int dy)
const_pointer operator[] (int dy) const
traverser upperLeft ()
traverser lowerRight ()
const_traverser upperLeft () const
const_traverser lowerRight () const
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
row_iterator rowBegin (int y)
row_iterator rowEnd (int y)
const_row_iterator rowBegin (int y) const
const_row_iterator rowEnd (int y) const
column_iterator columnBegin (int x)
column_iterator columnEnd (int x)
const_column_iterator columnBegin (int x) const
const_column_iterator columnEnd (int x) const
const_pointer data () const
Accessor accessor ()
ConstAccessor accessor () const


Detailed Description


template<class PIXELTYPE, class Alloc = std::allocator<PIXELTYPE>>
class vigra::BasicImage< PIXELTYPE, Alloc >

Fundamental class template for images.

A customized memory allocator can be specified as a templated argument and passed in the constructor.

#include "vigra/basicimage.hxx"

Namespace: vigra

Examples:

pyramid.cxx, and watershed.cxx.


Member Typedef Documentation


typedef IteratorTraits<traverser>::DefaultAccessor Accessor

 

the BasicImage's default accessor


typedef Alloc allocator_type

 

the BasicImage's allocator (default: std::allocator<value_type>)


typedef traverser::column_iterator column_iterator

 

the column iterator associated with the traverser


typedef const_traverser::column_iterator const_column_iterator

 

the const column iterator associated with the const_traverser


typedef PIXELTYPE const* const_iterator

 

the BasicImage's 1D random access const iterator (note: lower case 'const_iterator' is a STL compatible 1D random access const iterator)


typedef PIXELTYPE const* const_pointer

 

the BasicImage's const pointer type


typedef PIXELTYPE const& const_reference

 

the BasicImage's const reference type (i.e. the return type of image[diff] and image(dx,dy) when image is const)


typedef const_traverser::row_iterator const_row_iterator

 

the const row iterator associated with the const_traverser


typedef ConstBasicImageIterator<PIXELTYPE, PIXELTYPE **> const_traverser

 

the BasicImage's 2D random access const iterator ('const traverser')


typedef IteratorTraits<const_traverser>::DefaultAccessor ConstAccessor

 

the BasicImage's default const accessor


typedef ConstBasicImageIterator<PIXELTYPE, PIXELTYPE **> ConstIterator

 

deprecated, use const_traverser instead


typedef PIXELTYPE const* ConstScanOrderIterator

 

deprecated, use const_iterator instead


typedef Diff2D difference_type

 

the BasicImage's difference type (argument type of image[diff])


typedef BasicImageIterator<PIXELTYPE, PIXELTYPE **> Iterator

 

deprecated, use traverser instead


typedef PIXELTYPE* iterator

 

the BasicImage's 1D random access iterator (note: lower case 'iterator' is a STL compatible 1D random access iterator, don't confuse with capitalized Iterator)


typedef PIXELTYPE PixelType

 

the BasicImage's pixel type


typedef PIXELTYPE* pointer

 

the BasicImage's pointer type


typedef PIXELTYPE& reference

 

the BasicImage's reference type (i.e. the return type of image[diff] and image(dx,dy))


typedef traverser::row_iterator row_iterator

 

the row iterator associated with the traverser


typedef PIXELTYPE* ScanOrderIterator

 

deprecated, use iterator instead


typedef Size2D size_type

 

the BasicImage's size type (result type of image.size())


typedef BasicImageIterator<PIXELTYPE, PIXELTYPE **> traverser

 

the BasicImage's 2D random access iterator ('traverser')


typedef PIXELTYPE value_type

 

the BasicImage's pixel type


Constructor & Destructor Documentation


BasicImage (    )  [inline]

 

construct image of size 0x0


BasicImage (  Alloc const &    alloc )  [inline, explicit]

 

construct image of size 0x0, use the specified allocator.


BasicImage (  int    width,
int    height,
Alloc const &    alloc = Alloc()
)  [inline]

 

construct image of size width x height, use the specified allocator.


BasicImage (  difference_type const &    size,
Alloc const &    alloc = Alloc()
)  [inline, explicit]

 

construct image of size size.x x size.y, use the specified allocator.


BasicImage (  int    width,
int    height,
value_type const &    d,
Alloc const &    alloc = Alloc()
)  [inline]

 

construct image of size width*height and initialize every pixel with the value d (use this constructor, if value_type doesn't have a default constructor). Use the specified allocator.


BasicImage (  difference_type const &    size,
value_type const &    d,
Alloc const &    alloc = Alloc()
)  [inline, explicit]

 

construct image of size size.x x size.y and initialize every pixel with given data (use this constructor, if value_type doesn't have a default constructor). Use the specified allocator.


BasicImage (  int    width,
int    height,
const_pointer    d,
Alloc const &    alloc = Alloc()
)  [inline]

 

construct image of size width*height and copy the data from the given C-style array d. Use the specified allocator.


BasicImage (  difference_type const &    size,
const_pointer    d,
Alloc const &    alloc = Alloc()
)  [inline, explicit]

 

construct image of size size.x x size.y and copy the data from the given C-style array. Use the specified allocator.


BasicImage (  const BasicImage< PIXELTYPE, Alloc > &    rhs )  [inline]

 

copy rhs image


~BasicImage (    )  [inline]

 

destructor


Member Function Documentation


ConstAccessor accessor (    )  const [inline]

 

return default const accessor


Accessor accessor (    )  [inline]

 

return default accessor


const_iterator begin (    )  const [inline]

 

init 1D random access const iterator pointing to first pixel


iterator begin (    )  [inline]

 

init 1D random access iterator pointing to first pixel


const_column_iterator columnBegin (  int    x )  const [inline]

 

init 1D random access const iterator pointing to first pixel of column x


column_iterator columnBegin (  int    x )  [inline]

 

init 1D random access iterator pointing to first pixel of column x


const_column_iterator columnEnd (  int    x )  const [inline]

 

init 1D random access const iterator pointing past the end of column x


column_iterator columnEnd (  int    x )  [inline]

 

init 1D random access iterator pointing past the end of column x


const_pointer data (    )  const [inline]

 

get a pointer to the internal data


const_iterator end (    )  const [inline]

 

init 1D random access const iterator pointing past the end


iterator end (    )  [inline]

 

init 1D random access iterator pointing past the end


int height (    )  const [inline]

 

height of Image


BasicImage< PIXELTYPE, Alloc > & init (  value_type const &    pixel ) 

 

set Image with const value


bool isInside (  difference_type const &    d )  const [inline]

 

test whether a given coordinate is inside the image


const_traverser lowerRight (    )  const [inline]

 

init 2D random access const iterator poining to pixel(width, height), i.e. one pixel right and below lower right corner of the image as is common in C/C++.


traverser lowerRight (    )  [inline]

 

init 2D random access iterator poining to pixel(width, height), i.e. one pixel right and below lower right corner of the image as is common in C/C++.


const_reference operator() (  int    dx,
int    dy
)  const [inline]

 

read pixel at given location.
usage: value_type value = image(1,2)


reference operator() (  int    dx,
int    dy
)  [inline]

 

access pixel at given location.
usage: value_type value = image(1,2)


BasicImage< PIXELTYPE, Alloc > & operator= (  value_type    pixel ) 

 

Deprecated:
set Image with const value


BasicImage< PIXELTYPE, Alloc > & operator= (  const BasicImage< PIXELTYPE, Alloc > &    rhs ) 

 

copy rhs image (image is resized if necessary)


const_pointer operator[] (  int    dy )  const [inline]

 

read pixel at given location. Note that the 'x' index is the trailing index.
usage: value_type value = image[2][1]


pointer operator[] (  int    dy )  [inline]

 

access pixel at given location. Note that the 'x' index is the trailing index.
usage: value_type value = image[2][1]


const_reference operator[] (  difference_type const &    d )  const [inline]

 

read pixel at given location.
usage: value_type value = image[Diff2D(1,2)]


reference operator[] (  difference_type const &    d )  [inline]

 

access pixel at given location.
usage: value_type value = image[Diff2D(1,2)]


void resize (  int    width,
int    height,
value_type const &    d
) 

 

reset image to specified size and initialize it with given data (use this if value_type doesn't have a default constructor, dimensions must not be negative, old data are kept if new size matches old size)


void resize (  difference_type const &    size )  [inline]

 

reset image to specified size (dimensions must not be negative) (old data are kept if new size matches old size)


void resize (  int    width,
int    height
)  [inline]

 

reset image to specified size (dimensions must not be negative) (old data are kept if new size matches old size)


void resizeCopy (  const BasicImage< PIXELTYPE, Alloc > &    rhs )  [inline]

 

resize image to size of other image and copy it's data


void resizeCopy (  int    width,
int    height,
const_pointer    data
) 

 

resize image to given size and initialize by copying data from the C-style arra data.


const_row_iterator rowBegin (  int    y )  const [inline]

 

init 1D random access const iterator pointing to first pixel of row y


row_iterator rowBegin (  int    y )  [inline]

 

init 1D random access iterator pointing to first pixel of row y


const_row_iterator rowEnd (  int    y )  const [inline]

 

init 1D random access const iterator pointing past the end of row y


row_iterator rowEnd (  int    y )  [inline]

 

init 1D random access iterator pointing past the end of row y


size_type size (    )  const [inline]

 

size of Image


void swap (  BasicImage< PIXELTYPE, Alloc > &    rhs ) 

 

swap the internal data with the rhs image in constant time


const_traverser upperLeft (    )  const [inline]

 

init 2D random access const iterator poining to upper left pixel


traverser upperLeft (    )  [inline]

 

init 2D random access iterator poining to upper left pixel


int width (    )  const [inline]

 

width of Image


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

© Ullrich Köthe (koethe@informatik.uni-hamburg.de)
Cognitive Systems Group, University of Hamburg, Germany

html generated using doxygen and Python
VIGRA 1.5.0 (7 Dec 2006)