Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

Sketch Class Template Reference

#include <Sketch.h>

Inheritance diagram for Sketch:

List of all members.


Detailed Description

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

Smart pointers for referencing.

 SketchData<T> 
instances

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< uint > &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< bool > () const
 operator for implicitly or explicitly converting to Sketch<bool>
 operator Sketch< uchar > () const
 operator for implicity or explicitly converting to Sketch<uchar>
 operator Sketch< uint > () const
 operator for implicity or explicitly converting to Sketch<uint>
 operator Sketch< float > () 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)" 
) [inline]

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 
) [inline]

Constructor. Inherits parent and color information from parent sketch.

Definition at line 158 of file Sketch.h.

Sketch (  )  [inline]

Dummy constructor, for use in vector construction.

Definition at line 181 of file Sketch.h.

Sketch ( const Sketch< T > &  other  )  [inline]

Copy constructor, used in something like.

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

Definition at line 199 of file Sketch.h.

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

Shallow copy constructor used by NEW_SKETCH and NEW_SKETCH_N.

Definition at line 218 of file Sketch.h.

~Sketch (  )  [inline, virtual]

Destructor. Cleans up and decrements SketchData reference count.

Definition at line 233 of file Sketch.h.

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

Retrieve an existing sketch by name.

Definition at line 186 of file Sketch.h.


Member Function Documentation

bool isValid (  )  const [inline]

True if this Sketch actually points to a SketchData.

Definition at line 59 of file Sketch.h.

Referenced by Sketch::bind(), Sketch::checkValid(), Sketch::operator=(), Sketch::Sketch(), and Sketch::~Sketch().

void checkValid (  )  const [inline]

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

Definition at line 64 of file Sketch.h.

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

Definition at line 65 of file Sketch.h.

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

Definition at line 67 of file Sketch.h.

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

Definition at line 68 of file Sketch.h.

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

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

Definition at line 258 of file Sketch.h.

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

Definition at line 72 of file Sketch.h.

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

Definition at line 73 of file Sketch.h.

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

Definition at line 269 of file Sketch.h.

Referenced by visops::bdist().

void bind ( const Sketch< T > &  other  )  [inline]

Make this sketch point to another sketch's SketchData.

Definition at line 277 of file Sketch.h.

Referenced by visops::fillin(), visops::labelcc(), Sketch::operator=(), and Lookout::processPointAtEvent().

Sketch< T > & operator= ( const Sketch< T > &  other  )  [inline]

Assignment operator: copies the pixels.

Definition at line 289 of file Sketch.h.

Sketch< T > & operator= ( const T &  value  )  [inline]

Sets all pixels in the Sketch to the specified value.

Definition at line 309 of file Sketch.h.

Sketch<bool> operator! (  )  const

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

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

Definition at line 382 of file Sketch.h.

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

Definition at line 383 of file Sketch.h.

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

Definition at line 384 of file Sketch.h.

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

Definition at line 386 of file Sketch.h.

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

Definition at line 387 of file Sketch.h.

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

Definition at line 388 of file Sketch.h.

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

Definition at line 389 of file Sketch.h.

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

Definition at line 391 of file Sketch.h.

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

Definition at line 392 of file Sketch.h.

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

Definition at line 393 of file Sketch.h.

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

Definition at line 394 of file Sketch.h.

void printVals (  )  const [inline]

Definition at line 450 of file Sketch.h.

operator Sketch< bool > (  )  const [inline]

operator for implicitly or explicitly converting to Sketch<bool>

Definition at line 463 of file Sketch.h.

operator Sketch< uchar > (  )  const [inline]

operator for implicity or explicitly converting to Sketch<uchar>

Definition at line 470 of file Sketch.h.

operator Sketch< uint > (  )  const [inline]

operator for implicity or explicitly converting to Sketch<uint>

Definition at line 488 of file Sketch.h.

operator Sketch< float > (  )  const [inline]

operator for implicity or explicitly converting to Sketch<float>

Definition at line 500 of file Sketch.h.


Member Data Documentation


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

DualCoding 4.0
Generated Thu Nov 22 00:54:06 2007 by Doxygen 1.5.4