| Homepage | Demos | Overview | Downloads | Tutorials | 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 | ) |
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 | ( | ) |
Definition at line 126 of file SketchData.h.
| SketchData | ( | const SketchData< T > & | other | ) | [private] |
never call this
| T & at | ( | size_t | x, | |
| size_t | y | |||
| ) |
| T & at | ( | size_t | x | ) |
| bool empty | ( | ) | const |
| int findMax | ( | ) | const |
| int findMin | ( | ) | const |
| int findMinPlus | ( | ) | const |
| const T* getRawPixels | ( | ) | const [inline] |
Address of the memory area containing the actual pixel data.
Definition at line 55 of file SketchData.h.
| T* getRawPixels | ( | ) | [inline] |
Address of the memory area containing the actual pixel data.
Definition at line 52 of file SketchData.h.
| SketchType_t getType | ( | ) | const [inline, virtual] |
| virtual SketchType_t getType | ( | ) | const [virtual] |
The type of this sketch.
Implements SketchDataRoot.
Referenced by SketchData::saveBuffer(), and SketchData::SketchData().
| T max | ( | ) | const |
| T min | ( | ) | const |
| T minPlus | ( | ) | const |
| T mode | ( | ) | const |
| T modePlus | ( | ) | const |
| unsigned int saveBuffer | ( | char | buf[], | |
| unsigned int | avail | |||
| ) | const [virtual] |
Serializes a sketch to a buffer, for transmission to the sketch viewer.
Implements SketchDataRoot.
Definition at line 280 of file SketchData.h.
| unsigned int savePixels | ( | char | buf[], | |
| unsigned int | avail | |||
| ) | const [protected] |
handle copying pixels to buffer
Definition at line 317 of file SketchData.h.
Referenced by SketchData::saveBuffer().
| T sum | ( | ) | const |
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< unsigned short int >::getRawPixels(), SketchData::max(), SketchData::min(), SketchData::minPlus(), SketchData::mode(), SketchData::modePlus(), SketchData::savePixels(), and SketchData::sum().
|
DualCoding 3.0beta |
Generated Wed Oct 4 00:02:31 2006 by Doxygen 1.4.7 |