Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

SketchData< T > Class Template Reference

Holds the pixels for an individual sketch. More...

#include <SketchData.h>

Inheritance diagram for SketchData< T >:

Detailed Description

template<class T>
class DualCoding::SketchData< T >

Holds the pixels for an individual sketch.

SketchData<T> holds the pixels for an individual sketch of type T, using a valarray<T>. A collection of SketchData<T> objects is maintained in a SketchPool<T>. Basic functions such as indexed access and empty test that are not implemented as Sketch operators are implemented as SketchData<T> member functions. Sketch<T> overrides the -> operator to provide "smart pointer" access to these SketchData<T> functions.

Definition at line 32 of file SketchData.h.

List of all members.

Public Member Functions

 SketchData (SketchSpace *_space)
 Constructor. Don't call this. SketchData objects should only be created and managed by their SketchSpace.
 ~SketchData ()
virtual SketchType_t getType () const
 The type of this sketch.
TgetRawPixels ()
 Address of the memory area containing the actual pixel data.
const TgetRawPixels () const
 Address of the memory area containing the actual pixel data.
bool empty () const
 Returns true if all pixels are zero.
virtual size_t savePixels (char buf[], size_t avail) const
 handle copying pixels to buffer
template<>
SketchType_t getType () const
 Return the type of data stored in this sketch. Virtual function overridden by each SketchData<T> class.
template<>
SketchType_t getType () const
 Return the type of data stored in this sketch. Virtual function overridden by each SketchData<T> class.
template<>
SketchType_t getType () const
 Return the type of data stored in this sketch. Virtual function overridden by each SketchData<T> class.
template<>
SketchType_t getType () const
 Return the type of data stored in this sketch. Virtual function overridden by each SketchData<T> class.
template<>
SketchType_t getType () const
 Return the type of data stored in this sketch. Virtual function overridden by each SketchData<T> class.
template<>
SketchType_t getType () const
 Return the type of data stored in this sketch. Virtual function overridden by each SketchData<T> class.
template<>
size_t savePixels (char buf[], size_t avail) const
 handle copying pixels to buffer

Tat (size_t x)
 Indexed access, with bounds checking.
Tat (size_t x, size_t y)
 Subscripted (x,y) access, with bounds checking.
Toperator[] (size_t idx)
 Indexed access, with bounds checking.
const Toperator[] (size_t idx) const
 Indexed access, with bounds checking.
Toperator() (size_t x, size_t y)
 Indexed access, with bounds checking.
const Toperator() (size_t x, size_t y) const
 Indexed access, with bounds checking.
Sum/Max/Min

T sum () const
 Sum of pixels.
T max () const
 Max of pixel values.
int findMax () const
 Index of first maximum-value pixel.
T min () const
 Min of pixel values.
int findMin () const
 Index of first minimum-value pixel.
T minPlus () const
 Min of non-zero pixel values.
int findMinPlus () const
 Index of first minimum non-zero pixel, or -1 if none.
int findTrue () const
 Index of first non-zero pixel, or -1 if none.
T mode () const
 Mode (most common) pixel value.
T modePlus () const
 Mode (most common) non-zero pixel value.

Private Member Functions

 SketchData (const SketchData &other)
 never call this

Private Attributes

std::valarray< Tpixels
 the valarray which actually stores the image

Friends

class Sketch< T >
class SketchPool< T >

Constructor & Destructor Documentation

SketchData ( SketchSpace _space  ) 

Constructor. Don't call this. SketchData objects should only be created and managed by their SketchSpace.

Definition at line 113 of file SketchData.h.

~SketchData (  ) 

Definition at line 121 of file SketchData.h.

SketchData ( const SketchData< T > &  other  )  [private]

never call this


Member Function Documentation

T & at ( size_t  x,
size_t  y 
)

Subscripted (x,y) access, with bounds checking.

Definition at line 149 of file SketchData.h.

T & at ( size_t  x  ) 

Indexed access, with bounds checking.

Definition at line 141 of file SketchData.h.

bool empty (  )  const

Returns true if all pixels are zero.

Definition at line 157 of file SketchData.h.

int findMax (  )  const

Index of first maximum-value pixel.

Definition at line 175 of file SketchData.h.

int findMin (  )  const

Index of first minimum-value pixel.

Definition at line 193 of file SketchData.h.

int findMinPlus (  )  const

Index of first minimum non-zero pixel, or -1 if none.

Definition at line 225 of file SketchData.h.

int findTrue (  )  const

Index of first non-zero pixel, or -1 if none.

Definition at line 241 of file SketchData.h.

const T* getRawPixels (  )  const

Address of the memory area containing the actual pixel data.

Definition at line 51 of file SketchData.h.

T* getRawPixels (  ) 

Address of the memory area containing the actual pixel data.

Definition at line 48 of file SketchData.h.

SketchType_t getType (  )  const [virtual]

Return the type of data stored in this sketch. Virtual function overridden by each SketchData<T> class.

Implements SketchDataRoot.

Definition at line 138 of file SketchData.h.

SketchType_t getType (  )  const [virtual]

Return the type of data stored in this sketch. Virtual function overridden by each SketchData<T> class.

Implements SketchDataRoot.

Definition at line 136 of file SketchData.h.

SketchType_t getType (  )  const [virtual]

Return the type of data stored in this sketch. Virtual function overridden by each SketchData<T> class.

Implements SketchDataRoot.

Definition at line 134 of file SketchData.h.

SketchType_t getType (  )  const [virtual]

Return the type of data stored in this sketch. Virtual function overridden by each SketchData<T> class.

Implements SketchDataRoot.

Definition at line 132 of file SketchData.h.

SketchType_t getType (  )  const [virtual]

Return the type of data stored in this sketch. Virtual function overridden by each SketchData<T> class.

Implements SketchDataRoot.

Definition at line 130 of file SketchData.h.

SketchType_t getType (  )  const [virtual]

Return the type of data stored in this sketch. Virtual function overridden by each SketchData<T> class.

Implements SketchDataRoot.

Definition at line 128 of file SketchData.h.

virtual SketchType_t getType (  )  const [virtual]

The type of this sketch.

Implements SketchDataRoot.

Referenced by SketchData< T >::SketchData().

T max (  )  const

Max of pixel values.

Definition at line 170 of file SketchData.h.

Referenced by SketchData< T >::findMinPlus().

T min (  )  const

Min of pixel values.

Definition at line 188 of file SketchData.h.

T minPlus (  )  const

Min of non-zero pixel values.

Definition at line 206 of file SketchData.h.

T mode (  )  const

Mode (most common) pixel value.

Definition at line 250 of file SketchData.h.

T modePlus (  )  const

Mode (most common) non-zero pixel value.

Definition at line 267 of file SketchData.h.

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

Indexed access, with bounds checking.

Definition at line 64 of file SketchData.h.

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

Indexed access, with bounds checking.

Definition at line 63 of file SketchData.h.

const T& operator[] ( size_t  idx  )  const

Indexed access, with bounds checking.

Definition at line 61 of file SketchData.h.

T& operator[] ( size_t  idx  ) 

Indexed access, with bounds checking.

Definition at line 60 of file SketchData.h.

size_t savePixels ( char  buf[],
size_t  avail 
) const [virtual]

handle copying pixels to buffer

Implements SketchDataRoot.

Definition at line 296 of file SketchData.h.

size_t savePixels ( char  buf[],
size_t  avail 
) const [virtual]

handle copying pixels to buffer

Implements SketchDataRoot.

Definition at line 287 of file SketchData.h.

T sum (  )  const

Sum of pixels.

Definition at line 165 of file SketchData.h.


Friends And Related Function Documentation

friend class Sketch< T > [friend]

Definition at line 36 of file SketchData.h.

friend class SketchPool< T > [friend]

Definition at line 37 of file SketchData.h.


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