CVD::Image< T > Class Template Reference
[Image storage and manipulation]

#include <image.h>

Inheritance diagram for CVD::Image< T >:
Inheritance graph
[legend]

List of all members.

Classes

struct  CopyPlaceHolder

Public Member Functions

void copy_from (const SubImage< T > &copy)
void copy_from (const BasicImage< T > &copy)
CopyPlaceHolder copy_from_me () const
 Image (const std::pair< ImageRef, T > &p)
 Image (const ImageRef &size, const T &val)
 Image (const ImageRef &size)
 Image ()
 Default constructor.
template<class C >
 Image (Internal::ImagePromise< C > p)
 Image (const CopyPlaceHolder &c)
 Image (const Image &copy)
void make_unique ()
 Make this image independent of any copies (i.e. force a copy of the image data).
template<class C >
const Imageoperator= (Internal::ImagePromise< C > p)
const Imageoperator= (const Image &copyof)
void resize (const ImageRef &size, const T &val)
void resize (const ImageRef &size)
 ~Image ()
 The destructor removes the image data.

Private Member Functions

void dup_from (const Image *copyof)
void remove ()

Private Attributes

int * num_copies

Detailed Description

template<class T>
class CVD::Image< T >

A full image which manages its own data.

Parameters:
T The pixel type for this image. Typically either CVD::byte or CVD::Rgb<CVD::byte> > are used, but images could be constructed of any available type.

Images do reference counting on the data, so multiple images can point to one block of data. This means that copying an image is like copying a pointer (so use the same care); to further the analogy, operator[]() dereferences images. Copy constructing is quite fast (a 16-byte copy and an increment), so images can be efficiently passed back in functions or used in containers like std::vector

Loading and saving, format conversion and some copying functionality is provided by external functions rather than as part of this class. See the Image loading and saving, and format conversion module for documentation of these functions.

Definition at line 621 of file image.h.


Constructor & Destructor Documentation

template<class T>
CVD::Image< T >::Image ( const Image< T > &  copy  )  [inline]

Copy constructor. This does not copy the data, it just creates a new reference to the image data

Parameters:
copy The image to copy

Definition at line 633 of file image.h.

template<class T>
CVD::Image< T >::Image ( const CopyPlaceHolder c  )  [inline]

CopyFrom" constructor. If constructed from this, it creates a new copy of the data. This provides symmetry with copy_from_me

Parameters:
c The (placeholder) image to copy from.

Definition at line 645 of file image.h.

template<class T>
template<class C >
CVD::Image< T >::Image ( Internal::ImagePromise< C >  p  )  [inline]

Definition at line 708 of file image.h.

template<class T>
CVD::Image< T >::Image (  )  [inline]

Default constructor.

Definition at line 716 of file image.h.

template<class T>
CVD::Image< T >::Image ( const ImageRef size  )  [inline]

Create an empty image of a given size.

Parameters:
size The size of image to create

Definition at line 723 of file image.h.

template<class T>
CVD::Image< T >::Image ( const ImageRef size,
const T &  val 
) [inline]

Create a filled image of a given size

Parameters:
size The size of image to create
val The value to fill the image with

Definition at line 735 of file image.h.

template<class T>
CVD::Image< T >::Image ( const std::pair< ImageRef, T > &  p  )  [inline]

Create a filled image of a given size

Parameters:
p std::pair<ImageRef, T> containing the size and fill value. Useful for creating containers of images with ImageCreationIterator

Definition at line 745 of file image.h.

template<class T>
CVD::Image< T >::~Image (  )  [inline]

The destructor removes the image data.

Definition at line 780 of file image.h.


Member Function Documentation

template<class T>
void CVD::Image< T >::copy_from ( const SubImage< T > &  copy  )  [inline]

Make a (new) copy of the image, also making a copy of the data

Parameters:
copy The image to copy

Reimplemented from CVD::SubImage< T >.

Definition at line 673 of file image.h.

template<class T>
void CVD::Image< T >::copy_from ( const BasicImage< T > &  copy  )  [inline]

Make a (new) copy of the image, also making a copy of the data

Parameters:
copy The image to copy

Definition at line 662 of file image.h.

template<class T>
CopyPlaceHolder CVD::Image< T >::copy_from_me (  )  const [inline]

This returns a place holder from which an image can be constructed. On construction, a new copy of the data is made.

Definition at line 653 of file image.h.

template<class T>
void CVD::Image< T >::dup_from ( const Image< T > *  copyof  )  [inline, private]

Definition at line 802 of file image.h.

template<class T>
void CVD::Image< T >::make_unique (  )  [inline]

Make this image independent of any copies (i.e. force a copy of the image data).

Definition at line 682 of file image.h.

template<class T>
template<class C >
const Image& CVD::Image< T >::operator= ( Internal::ImagePromise< C >  p  )  [inline]

Definition at line 702 of file image.h.

template<class T>
const Image& CVD::Image< T >::operator= ( const Image< T > &  copyof  )  [inline]

Assign this image to another one. This does not copy the data, it just creates a new reference to the image data

Parameters:
copyof The image to copy

Definition at line 694 of file image.h.

template<class T>
void CVD::Image< T >::remove (  )  [inline, private]

Definition at line 791 of file image.h.

template<class T>
void CVD::Image< T >::resize ( const ImageRef size,
const T &  val 
) [inline]

Resize the image (destroying the data). This does not affect any other images pointing to this data.

Parameters:
size The new size of the image
val The value to fill the image with

Definition at line 769 of file image.h.

template<class T>
void CVD::Image< T >::resize ( const ImageRef size  )  [inline]

Resize the image (destroying the data). This does not affect any other images pointing to this data.

Parameters:
size The new size of the image

Definition at line 755 of file image.h.


Member Data Documentation

template<class T>
int* CVD::Image< T >::num_copies [private]

Definition at line 789 of file image.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


libcvd
Author(s): Edward Rosten, Paul Smith, Tom Drummond, Gerhard Reitmayr, Ethan Eade, Timothy Gan, Chris Kemp, Georg Klein
autogenerated on Fri Jan 11 09:13:51 2013