Homepage Demos Overview Downloads Tutorials Reference
Credits

Sketch Class Template Reference

#include <Sketch.h>

Inheritance diagram for Sketch:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<typename T>
class DualCoding::Sketch< T >

Smart pointers for referencing.

This is the structure that provides safe user-level access to sketches. It's a smart pointer that does reference counting, and overloads operator-> so it can do validity checking. If the validity check succeeds, operator-> dereferences to a SketchData<T> object.

Definition at line 26 of file Sketch.h.

Public Member Functions

 Sketch (SketchSpace &_space, const std::string &_name="(no name)")
 Constructor. Allocates a new SketchData<T> to hold the data.
 Sketch (const std::string &_name, const SketchRoot &parent)
 Constructor. Inherits parent and color information from parent sketch.
 Sketch ()
 Dummy constructor, for use in vector construction.
 Sketch (const Sketch &other)
 Copy constructor, used in something like.
 Sketch (const Sketch &other, const std::string &name, bool viewable)
 Shallow copy constructor used by NEW_SKETCH and NEW_SKETCH_N.
virtual ~Sketch ()
 Destructor. Cleans up and decrements SketchData reference count.
 Sketch (const std::string &name, SketchSpace &space)
 Retrieve an existing sketch by name.
bool isValid () const
 True if this Sketch actually points to a SketchData.
void checkValid () const
 Print error message if Sketch fails isValid() test.
SketchData< T > * operator-> ()
const SketchData< T > * operator-> () const
T & operator[] (size_t idx)
const T & operator[] (size_t idx) const
const Sketch< T > operator[] (const Sketch< usint > &indirection) const
 when passed indirection matrix (e.g. idx_left) returns resampled Sketch
T & operator() (size_t x, size_t y)
const T & operator() (size_t x, size_t y) const
SketchsetIndices (const SketchIndices &indices, const T &value)
void bind (const Sketch &other)
 Make this sketch point to another sketch's SketchData.
Sketchoperator= (const Sketch &other)
 Assignment operator: copies the pixels.
Sketchoperator= (const T &value)
 Sets all pixels in the Sketch to the specified value.
Sketch< booloperator! () const
Sketch< T > & operator+= (const Sketch< T > &other)
void printVals () const
 operator Sketch () const
 operator for implicitly or explicitly converting to Sketch<bool>
 operator Sketch () const
 operator for implicity or explicitly converting to Sketch<uchar>
 operator Sketch () const
 operator for implicity or explicitly converting to Sketch<usint>
 operator Sketch () const
 operator for implicity or explicitly converting to Sketch<float>
Sketch< T > & operator-= (const Sketch< T > &other)
Sketch< T > & operator *= (const Sketch< T > &other)
Sketch< T > & operator/= (const Sketch< T > &other)
Sketch< T > & operator+= (const T value)
Sketch< T > & operator-= (const T value)
Sketch< T > & operator *= (const T value)
Sketch< T > & operator/= (const T value)
Sketchoperator+= (const int value)
Sketchoperator-= (const int value)
Sketchoperator *= (const int value)
Sketchoperator/= (const int value)

Public Attributes

int width
int height
SketchData< T > * data
 The SketchData object referenced by this Sketch.
std::valarray< T > * pixels
 The image resource for the Sketch, owned by the SketchData object.


Constructor & Destructor Documentation

Sketch ( SketchSpace _space,
const std::string &  _name = "(no name)" 
)

Constructor. Allocates a new SketchData<T> to hold the data.

Definition at line 136 of file Sketch.h.

Sketch ( const std::string &  _name,
const SketchRoot parent 
)

Constructor. Inherits parent and color information from parent sketch.

Definition at line 158 of file Sketch.h.

Sketch (  ) 

Dummy constructor, for use in vector construction.

Definition at line 181 of file Sketch.h.

Sketch ( const Sketch< T > &  other  ) 

Copy constructor, used in something like.

 Sketch<bool> image = original; 
This is a shallow copy: it does not copy the underlying pixels.

Sketch ( const Sketch< T > &  other,
const std::string &  name,
bool  viewable 
)

Shallow copy constructor used by NEW_SKETCH and NEW_SKETCH_N.

~Sketch (  )  [virtual]

Destructor. Cleans up and decrements SketchData reference count.

Definition at line 232 of file Sketch.h.

Sketch ( const std::string &  name,
SketchSpace space 
)

Retrieve an existing sketch by name.

Definition at line 186 of file Sketch.h.


Member Function Documentation

void bind ( const Sketch< T > &  other  ) 

Make this sketch point to another sketch's SketchData.

Referenced by visops::fillin(), and visops::labelcc().

bool isValid (  )  const [inline]

True if this Sketch actually points to a SketchData.

Definition at line 59 of file Sketch.h.

Referenced by Sketch::checkValid(), and Sketch::~Sketch().

Sketch< T > & operator *= ( const int  value  ) 

Definition at line 393 of file Sketch.h.

Sketch< T > & operator *= ( const T  value  ) 

Definition at line 388 of file Sketch.h.

Sketch< T > & operator *= ( const Sketch< T > &  other  ) 

Definition at line 383 of file Sketch.h.

operator Sketch (  )  const

operator for implicity or explicitly converting to Sketch<float>

operator Sketch (  )  const

operator for implicity or explicitly converting to Sketch<usint>

operator Sketch (  )  const

operator for implicity or explicitly converting to Sketch<uchar>

operator Sketch< float > (  )  const

operator for implicitly or explicitly converting to Sketch<bool>

Definition at line 461 of file Sketch.h.

Sketch<bool> operator! (  )  const

const T& operator() ( size_t  x,
size_t  y 
) const [inline]

Definition at line 73 of file Sketch.h.

T& operator() ( size_t  x,
size_t  y 
) [inline]

Definition at line 72 of file Sketch.h.

Sketch< T > & operator+= ( const int  value  ) 

Definition at line 391 of file Sketch.h.

Sketch< T > & operator+= ( const T  value  ) 

Definition at line 386 of file Sketch.h.

Sketch<T>& operator+= ( const Sketch< T > &  other  ) 

Sketch< T > & operator-= ( const int  value  ) 

Definition at line 392 of file Sketch.h.

Sketch< T > & operator-= ( const T  value  ) 

Definition at line 387 of file Sketch.h.

Sketch< T > & operator-= ( const Sketch< T > &  other  ) 

Definition at line 382 of file Sketch.h.

const SketchData<T>* operator-> ( void   )  const [inline]

Definition at line 65 of file Sketch.h.

SketchData<T>* operator-> ( void   )  [inline]

Definition at line 64 of file Sketch.h.

Sketch< T > & operator/= ( const int  value  ) 

Definition at line 394 of file Sketch.h.

Sketch< T > & operator/= ( const T  value  ) 

Definition at line 389 of file Sketch.h.

Sketch< T > & operator/= ( const Sketch< T > &  other  ) 

Definition at line 384 of file Sketch.h.

Sketch< T > & operator= ( const T &  value  ) 

Sets all pixels in the Sketch to the specified value.

Definition at line 309 of file Sketch.h.

Sketch& operator= ( const Sketch< T > &  other  ) 

Assignment operator: copies the pixels.

const Sketch< T > operator[] ( const Sketch< usint > &  indirection  )  const

when passed indirection matrix (e.g. idx_left) returns resampled Sketch

Definition at line 259 of file Sketch.h.

const T& operator[] ( size_t  idx  )  const [inline]

Definition at line 68 of file Sketch.h.

T& operator[] ( size_t  idx  )  [inline]

Definition at line 67 of file Sketch.h.

void printVals (  )  const

Definition at line 448 of file Sketch.h.

Sketch< T > & setIndices ( const SketchIndices indices,
const T &  value 
)

Definition at line 270 of file Sketch.h.

Referenced by visops::bdist().


Member Data Documentation


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

DualCoding 3.0beta
Generated Wed Oct 4 00:02:30 2006 by Doxygen 1.4.7