Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
SketchData Class Template Reference#include <SketchData.h>
Inheritance diagram for SketchData:
![]() Detailed Descriptiontemplate<class T>
Holds the pixels for an individual sketch.
|
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. | |
T * | getRawPixels () |
Address of the memory area containing the actual pixel data. | |
const T * | getRawPixels () const |
Address of the memory area containing the actual pixel data. | |
unsigned int | saveBuffer (char buf[], unsigned int avail) const |
Serializes a sketch to a buffer, for transmission to the sketch viewer. | |
bool | empty () const |
Returns true if all pixels are zero. | |
template<> | |
SketchType_t | getType () const |
T & | at (size_t x) |
Indexed access, with bounds checking. | |
T & | at (size_t x, size_t y) |
Subscripted (x,y) 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. | |
T | mode () const |
Mode (most common) pixel value. | |
T | modePlus () const |
Mode (most common) non-zero pixel value. | |
Protected Member Functions | |
unsigned int | savePixels (char buf[], unsigned int avail) const |
handle copying pixels to buffer | |
Private Member Functions | |
SketchData (const SketchData &other) | |
never call this | |
Private Attributes | |
std::valarray< T > | pixels |
the valarray which actually stores the image | |
Friends | |
class | Sketch< T > |
class | SketchPool< T > |
SketchData | ( | SketchSpace * | _space | ) | [inline] |
Constructor. Don't call this. SketchData objects should only be created and managed by their SketchSpace.
Definition at line 118 of file SketchData.h.
~SketchData | ( | ) | [inline] |
Definition at line 126 of file SketchData.h.
SketchData | ( | const SketchData< T > & | other | ) | [inline, private] |
virtual SketchType_t getType | ( | ) | const [virtual] |
The type of this sketch.
Implements SketchDataRoot.
Referenced by SketchData::saveBuffer(), and SketchData::SketchData().
T* getRawPixels | ( | ) | [inline] |
Address of the memory area containing the actual pixel data.
Definition at line 52 of file SketchData.h.
const T* getRawPixels | ( | ) | const [inline] |
Address of the memory area containing the actual pixel data.
Definition at line 55 of file SketchData.h.
unsigned int saveBuffer | ( | char | buf[], | |
unsigned int | avail | |||
) | const [inline, virtual] |
Serializes a sketch to a buffer, for transmission to the sketch viewer.
Implements SketchDataRoot.
Definition at line 280 of file SketchData.h.
T & at | ( | size_t | x | ) | [inline] |
T & at | ( | size_t | x, | |
size_t | y | |||
) | [inline] |
bool empty | ( | ) | const [inline] |
T sum | ( | ) | const [inline] |
T max | ( | ) | const [inline] |
int findMax | ( | ) | const [inline] |
T min | ( | ) | const [inline] |
int findMin | ( | ) | const [inline] |
T minPlus | ( | ) | const [inline] |
int findMinPlus | ( | ) | const [inline] |
T mode | ( | ) | const [inline] |
T modePlus | ( | ) | const [inline] |
unsigned int savePixels | ( | char | buf[], | |
unsigned int | avail | |||
) | const [inline, protected] |
handle copying pixels to buffer
Definition at line 317 of file SketchData.h.
Referenced by SketchData::saveBuffer().
SketchType_t getType | ( | ) | const [inline, virtual] |
friend class Sketch< T > [friend] |
Definition at line 40 of file SketchData.h.
friend class SketchPool< T > [friend] |
Definition at line 41 of file SketchData.h.
std::valarray<T> pixels [private] |
the valarray which actually stores the image
Definition at line 38 of file SketchData.h.
Referenced by SketchData::at(), SketchData::empty(), SketchData::findMax(), SketchData::findMin(), SketchData::findMinPlus(), SketchData< uint >::getRawPixels(), SketchData::max(), SketchData::min(), SketchData::minPlus(), SketchData::mode(), SketchData::modePlus(), SketchData::savePixels(), and SketchData::sum().
DualCoding 4.0 |
Generated Thu Nov 22 00:54:06 2007 by Doxygen 1.5.4 |