Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

Sketch< T > Class Template Reference

Smart pointers for referencing. More...

#include <Sketch.h>

Inheritance diagram for Sketch< T >:

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.

List of all members.

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
Toperator[] (size_t idx)
const Toperator[] (size_t idx) const
const Sketch< Toperator[] (const Sketch< uint > &indirection) const
 when passed indirection matrix (e.g. idx_left) returns resampled Sketch
Toperator() (size_t x, size_t y)
const Toperator() (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< usint > () const
 operator for implicity or explicitly converting to Sketch<usint>
 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>
template<>
 operator Sketch () const
template<>
 operator Sketch () const
template<>
 operator Sketch () const

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 139 of file Sketch.h.

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

Constructor. Inherits parent and color information from parent sketch.

Definition at line 161 of file Sketch.h.

Sketch (  ) 

Dummy constructor, for use in vector construction.

Definition at line 184 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 236 of file Sketch.h.

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

Retrieve an existing sketch by name.

Definition at line 189 of file Sketch.h.


Member Function Documentation

void bind ( const Sketch< T > &  other  ) 

Make this sketch point to another sketch's SketchData.

bool isValid (  )  const

True if this Sketch actually points to a SketchData.

Definition at line 59 of file Sketch.h.

Referenced by Sketch< T >::checkValid(), and Sketch< T >::~Sketch().

operator Sketch< bool > (  )  const
operator Sketch< uchar > (  )  const
operator Sketch< bool > (  )  const

Definition at line 121 of file Sketch.cc.

operator Sketch< bool > (  )  const

operator for implicitly or explicitly converting to Sketch<bool>

Definition at line 474 of file Sketch.h.

operator Sketch< float > (  )  const

operator for implicity or explicitly converting to Sketch<float>

Definition at line 513 of file Sketch.h.

operator Sketch< uchar > (  )  const

operator for implicity or explicitly converting to Sketch<uchar>

Definition at line 481 of file Sketch.h.

operator Sketch< uint > (  )  const

operator for implicity or explicitly converting to Sketch<uint>

Definition at line 506 of file Sketch.h.

operator Sketch< usint > (  )  const

operator for implicity or explicitly converting to Sketch<usint>

Definition at line 499 of file Sketch.h.

Sketch<bool> operator! (  )  const
const T& operator() ( size_t  x,
size_t  y 
) const

Definition at line 73 of file Sketch.h.

T& operator() ( size_t  x,
size_t  y 
)

Definition at line 72 of file Sketch.h.

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

Definition at line 404 of file Sketch.h.

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

Definition at line 399 of file Sketch.h.

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

Definition at line 394 of file Sketch.h.

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

Definition at line 402 of file Sketch.h.

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

Definition at line 397 of file Sketch.h.

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

Definition at line 403 of file Sketch.h.

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

Definition at line 398 of file Sketch.h.

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

Definition at line 393 of file Sketch.h.

const SketchData<T>* operator-> ( void   )  const

Definition at line 65 of file Sketch.h.

SketchData<T>* operator-> ( void   ) 

Definition at line 64 of file Sketch.h.

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

Definition at line 405 of file Sketch.h.

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

Definition at line 400 of file Sketch.h.

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

Definition at line 395 of file Sketch.h.

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

Sets all pixels in the Sketch to the specified value.

Definition at line 314 of file Sketch.h.

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

Assignment operator: copies the pixels.

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

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

Definition at line 261 of file Sketch.h.

const T& operator[] ( size_t  idx  )  const

Definition at line 68 of file Sketch.h.

T& operator[] ( size_t  idx  ) 

Definition at line 67 of file Sketch.h.

void printVals (  )  const

Definition at line 461 of file Sketch.h.

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

Definition at line 274 of file Sketch.h.

Referenced by visops::bdist().


Member Data Documentation


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

DualCoding 5.1CVS
Generated Mon May 9 04:56:31 2016 by Doxygen 1.6.3