golib
0.5
|
Up to 3-dimensional (signal) data container. More...
#include <gosignal3d.h>
Public Member Functions | |
goSignal3D () | |
Constructor. | |
goSignal3D (goSize_t x, goSize_t y, goSize_t z, goSize_t blocksize_x=32, goSize_t blocksize_y=32, goSize_t blocksize_z=32, goSize_t border_x=0, goSize_t border_y=0, goSize_t border_z=0, goSize_t channelCount=1) | |
Constructor. More... | |
goSignal3D (goSignal3D< T > &other) | |
Copy constructor. More... | |
const goSignal3D< T > & | copy (const goSignal3DBase< T > &other) |
Copy operator. More... | |
virtual goSize_t | memoryUsage () const |
Returns the size of this object or some measure of its memory consumption. More... | |
bool | make (const goSize3D &size, const goSize3D &blockSize, const goSize3D &borderSize, goSize_t channelCount) |
Allocate memory. More... | |
bool | make (goSize_t x, goSize_t y, goSize_t z, goSize_t blocksize_x=32, goSize_t blocksize_y=32, goSize_t blocksize_z=32, goSize_t border_x=0, goSize_t border_y=0, goSize_t border_z=0, goSize_t channelCount=1) |
bool | make (const goSignal3DBase< T > *other) |
Copies only the size, NOT THE DATA! | |
virtual void | destroy () |
void | fillByte (goInt8 b) |
Works only with linear-memory blocks. No sub blocks. Uses memset(). | |
virtual void | fill (const T *element) |
Fills this signal with element . | |
virtual void | fill (goDouble v) |
![]() | |
void | setChanged () |
goCaller0< void > & | getChangedCaller () |
void | setPtr (T *p) |
const goType & | getDataType () const |
void | setChannel (goSize_t c) |
goSize_t | getChannel () const |
goPtrdiff_t | getChannelOffset (goSize_t channel) const |
Get the pointer offset from a channel 0 element to the corresponding channel channel element. More... | |
virtual void | setBorderFlags (int axes=GO_X|GO_Y|GO_Z, int borderFlag=GO_PERIODIC_BORDER) |
Sets the border behaviour. More... | |
virtual void | setBorderFlags (const goFixedArray< int > &flags) |
const goFixedArray< int > & | getBorderFlags () const |
bool | setDataType (goTypeEnum t) |
goDouble | getValue (goIndex_t x, goIndex_t y=0, goIndex_t z=0, goSize_t channel=0) const |
Convenience function to get a value. More... | |
void | setValue (goDouble value, goIndex_t x, goIndex_t y=0, goIndex_t z=0, goSize_t channel=0) |
Convenience function to set a value. More... | |
T * | getPtr () |
const T * | getPtr () const |
const T * | getRealPtr () const |
T * | getRealPtr () |
T * | getPtr (goIndex_t x, goIndex_t y, goIndex_t z) |
const T * | getPtr (goIndex_t x, goIndex_t y, goIndex_t z) const |
const goPtrdiff_t * | getXDiff () const |
const goPtrdiff_t * | getYDiff () const |
const goPtrdiff_t * | getZDiff () const |
goPtrdiff_t * | getXDiff () |
goPtrdiff_t * | getYDiff () |
goPtrdiff_t * | getZDiff () |
const goPtrdiff_t * | getXJump () const |
const goPtrdiff_t * | getYJump () const |
const goPtrdiff_t * | getZJump () const |
goPtrdiff_t * | getXJump () |
goPtrdiff_t * | getYJump () |
goPtrdiff_t * | getZJump () |
void | setSize (goSize_t x, goSize_t y, goSize_t z, goSize_t channelCount=1) |
INTERNAL – DO NOT USE. More... | |
void | setSize (const goSize3D &sz) |
INTERNAL – DO NOT USE. More... | |
void | setSizeX (goSize_t s) |
INTERNAL – DO NOT USE. More... | |
void | setSizeY (goSize_t s) |
INTERNAL – DO NOT USE. More... | |
void | setSizeZ (goSize_t s) |
INTERNAL – DO NOT USE. More... | |
const goSize3D & | getSize () const |
const goSize3D & | getBlockSize () const |
const goSize3D & | getBorderSize () const |
void | resizeBorder (const goSize3D &size) |
Resize the border and re-initialise internal data structures accordingly. More... | |
goSize_t | getSizeX () const |
goSize_t | getSizeY () const |
goSize_t | getSizeZ () const |
goIndex_t | getBorderX () const |
goIndex_t | getBorderY () const |
goIndex_t | getBorderZ () const |
goSize_t | getBlockSizeX () const |
goSize_t | getBlockSizeY () const |
goSize_t | getBlockSizeZ () const |
goSize_t | getChannelCount () const |
const goSignal3DBase< T > & | reference (goSignal3DBase< T > &other) |
bool | operator== (goSignal3DBase< T > &other) |
goDouble | getMaximum () const |
goDouble | getMinimum () const |
void | getMinMax (goDouble &minRet, goDouble &maxRet) const |
virtual void | shiftLeftDiff (int n, int axes=GO_X|GO_Y|GO_Z) |
Copies the last valid values from the block data into the borders. More... | |
virtual void | shiftRightDiff (int n, int axes=GO_X|GO_Y|GO_Z) |
virtual void | shiftLeftSize (int n, int axes=GO_X|GO_Y|GO_Z) |
virtual void | shiftRightSize (int n, int axes=GO_X|GO_Y|GO_Z) |
void | rotateAxes () |
void | swapXY () |
void | flip (int axis) |
BROKEN. Fix when there's time. More... | |
const T * | getClosest (go3Vector< goFloat > &point) const |
goFloat | sample (go3Vector< goFloat > &point) |
goDouble | sum () const |
goSignal3DBase< T > & | operator+= (const goSignal3DBase< T > &other) |
Element-wise operator. More... | |
goSignal3DBase< T > & | operator-= (const goSignal3DBase< T > &other) |
Element-wise operator. More... | |
goSignal3DBase< T > & | operator*= (const goSignal3DBase< T > &other) |
Element-wise operator. More... | |
goSignal3DBase< T > & | operator/= (const goSignal3DBase< T > &other) |
Element-wise operator. More... | |
goSignal3DBase< T > & | operator+= (goFloat scalar) |
Element-wise operator. More... | |
goSignal3DBase< T > & | operator-= (goFloat scalar) |
Element-wise operator. More... | |
goSignal3DBase< T > & | operator*= (goFloat scalar) |
Element-wise operator. More... | |
goSignal3DBase< T > & | operator/= (goFloat scalar) |
Element-wise operator. More... | |
void | applyBorderFlags (int axis) |
void | applyBorderFlags () |
template<> | |
goDouble | getValue (goIndex_t x, goIndex_t y, goIndex_t z, goSize_t channel) const |
template<> | |
void | setValue (goDouble value, goIndex_t x, goIndex_t y, goIndex_t z, goSize_t channel) |
template<> | |
goFloat | sample (go3Vector< goFloat > &point) |
template<> | |
goDouble | getMaximum () const |
template<> | |
goDouble | getMaximum () const |
template<> | |
goDouble | getMinimum () const |
template<> | |
goDouble | getMinimum () const |
template<> | |
void | fill (goDouble v) |
template<> | |
goFloat | sample (go3Vector< goFloat > &point) |
template<> | |
goSignal3DBase< void * > & | operator+= (goFloat scalar) |
template<> | |
goSignal3DBase< void * > & | operator-= (goFloat scalar) |
template<> | |
goSignal3DBase< void * > & | operator*= (goFloat scalar) |
template<> | |
goSignal3DBase< void * > & | operator/= (goFloat scalar) |
![]() | |
goObjectBase () | |
Constructor. | |
virtual | ~goObjectBase () |
Destructor. More... | |
const char * | getClassName () const |
Returns the class name. More... | |
int | getClassID () const |
void | setObjectName (const char *name) |
Set name string for an object. More... | |
void | setObjectName (const goString &name) |
Set name string for an object. More... | |
const goString & | getObjectName () const |
Get the object name. More... | |
virtual bool | writeObjectFile (FILE *) const |
Write object to a file. More... | |
virtual bool | readObjectFile (FILE *) |
Read object from a file. More... | |
void | connectObject (goObjectBase *object) |
Connects an object to this object. More... | |
void | disconnectObject (const goObjectBase *object) |
Disconnects an object from this object. | |
virtual bool | callObjectMethod (int methodID, goObjectMethodParameters *param=NULL) |
Call an object method by identifier. More... | |
virtual bool | queueObjectMethod (int methodID, goObjectMethodParameters *param=NULL, bool blocking=false) |
Enqueue a method call to an internal list of methods. More... | |
bool | callQueuedMethods () |
Call all queued methods. More... | |
Additional Inherited Members | |
![]() | |
typedef goSignal3DIterator< T > | iterator |
![]() | |
const typedef goSignal3DIterator< T > | const_iterator |
![]() | |
goSignal3DBase (goSize_t x, goSize_t y, goSize_t z, goSize_t blocksize_x=32, goSize_t blocksize_y=32, goSize_t blocksize_z=32, goSize_t border_x=16, goSize_t border_y=16, goSize_t border_z=16, goSize_t channelCount=1) | |
goSignal3DBase (goSignal3DBase< T > &other) | |
bool | initializeDataType () |
bool | initialize (T *dataptr, goSize_t x, goSize_t y, goSize_t z, goSize_t blocksize_x=32, goSize_t blocksize_y=32, goSize_t blocksize_z=32, goSize_t border_x=16, goSize_t border_y=16, goSize_t border_z=16, goSize_t channelCount=1) |
void | cleanup () |
void | setBorder (goSize_t x, goSize_t y, goSize_t z) |
INTERNAL – DO NOT USE. More... | |
void | constantBorders (int axes=GO_X|GO_Y|GO_Z) |
void | periodicBorders (int axes=GO_X|GO_Y|GO_Z) |
template<> | |
bool | initializeDataType () INITIALIZE_DATATYPE_METHOD(GO_INT8) |
template<> | |
bool | initializeDataType () INITIALIZE_DATATYPE_METHOD(GO_INT16) |
template<> | |
bool | initializeDataType () INITIALIZE_DATATYPE_METHOD(GO_INT32) |
template<> | |
bool | initializeDataType () INITIALIZE_DATATYPE_METHOD(GO_UINT8) |
template<> | |
bool | initializeDataType () INITIALIZE_DATATYPE_METHOD(GO_UINT16) |
template<> | |
bool | initializeDataType () INITIALIZE_DATATYPE_METHOD(GO_UINT32) |
template<> | |
bool | initializeDataType () INITIALIZE_DATATYPE_METHOD(GO_FLOAT) |
template<> | |
bool | initializeDataType () INITIALIZE_DATATYPE_METHOD(GO_DOUBLE) |
template<> | |
bool | initializeDataType () INITIALIZE_DATATYPE_METHOD(GO_VOID_POINTER) |
template<> | |
bool | initializeDataType () INITIALIZE_DATATYPE_METHOD(GO_COMPLEX_SINGLE) |
![]() | |
void | setClassID (int id) |
Sets the class name. | |
void | printClassMessage (const char *msg) |
Sets the class name. More... | |
void | printClassMessage (goString &msg) |
Prints an informational message to the calling console. More... | |
void | sendObjectMessage (int messageID, void *data=NULL) |
Sends a message to all connected objects. | |
void | sendObjectMessage (goObjectBase *object, int messageID, void *data=NULL) |
Sends a message to a specific object. | |
virtual void | receiveObjectMessage (const goObjectMessage &message) |
Receive a message. More... | |
![]() | |
T * | ptr |
T * | real_ptr |
goPtrdiff_t * | xDiff |
goPtrdiff_t * | yDiff |
goPtrdiff_t * | zDiff |
goPtrdiff_t * | real_xDiff |
goPtrdiff_t * | real_yDiff |
goPtrdiff_t * | real_zDiff |
goPtrdiff_t * | myXJump |
goPtrdiff_t * | myYJump |
goPtrdiff_t * | myZJump |
goPtrdiff_t * | real_myXJump |
goPtrdiff_t * | real_myYJump |
goPtrdiff_t * | real_myZJump |
goPtrdiff_t * | myChannelOffset |
goSize3D | mySize |
goSize3D | myBorderSize |
goSize3D | myBlockSize |
goSize3D | myBlocks |
goType | myDataType |
goSize_t | myChannelCount |
goSize_t | myChannel |
goFixedArray< int > | myBorderFlags |
Up to 3-dimensional (signal) data container.
The memory layout is sort of optimized to get some data locality when accessing the data locally in all dimensions.
goSignal3D< T >::goSignal3D | ( | goSize_t | x, |
goSize_t | y, | ||
goSize_t | z, | ||
goSize_t | blocksize_x = 32 , |
||
goSize_t | blocksize_y = 32 , |
||
goSize_t | blocksize_z = 32 , |
||
goSize_t | border_x = 0 , |
||
goSize_t | border_y = 0 , |
||
goSize_t | border_z = 0 , |
||
goSize_t | channelCount = 1 |
||
) |
Constructor.
x | Size in x direction |
y | Size in y direction |
z | Size in z direction |
blocksize_x | Block size in x direction |
blocksize_y | Block size in y direction |
blocksize_z | Block size in z direction |
border_x | Border size in x direction |
border_y | Border size in y direction |
border_z | Border size in z direction |
goSignal3D< T >::goSignal3D | ( | goSignal3D< T > & | other | ) |
Copy constructor.
Creates a signal of the same size as other
and copies the content.
const goSignal3D< T > & goSignal3D< T >::copy | ( | const goSignal3DBase< T > & | other | ) |
Copy operator.
Resizes this signal to the size of other
and copies the content.
|
virtual |
Deletes the memory used by the block data.
Reimplemented from goSignal3DBase< T >.
bool goSignal3D< T >::make | ( | const goSize3D & | size, |
const goSize3D & | blockSize, | ||
const goSize3D & | borderSize, | ||
goSize_t | channelCount | ||
) |
Allocate memory.
size | Signal size |
blockSize | Block size |
borderSize | Borde size |
channelCount | Number of channels |
bool goSignal3D< T >::make | ( | goSize_t | x, |
goSize_t | y, | ||
goSize_t | z, | ||
goSize_t | blockSizeX = 32 , |
||
goSize_t | blockSizeY = 32 , |
||
goSize_t | blockSizeZ = 32 , |
||
goSize_t | border_x = 0 , |
||
goSize_t | border_y = 0 , |
||
goSize_t | border_z = 0 , |
||
goSize_t | channelCount = 1 |
||
) |
Allocates memory of appropriate size for the whole signal. Sets diffs and size. The data is uninitialized. If make is called, destroy()
should be called when the data is not referenced anymore. destroy() is NOT called automagically when the destructor is called. To destroy the actual data, destroy() needs to be called BEFORE deleting the object.
x | Size in x direction of the signal |
y | Size in y direction of the signal |
z | Size in z direction of the signal |
border_x | Size of the border in x direction |
border_y | Size of the border in y direction |
border_z | Size of the border in z direction |
channelCount | Number of channels (defaults to 1). If you want to store, say, RGBA data, you would set this to 4. |
|
virtual |
Returns the size of this object or some measure of its memory consumption.
Overload this function as you please and as it makes sense.
Reimplemented from goSignal3DBase< T >.