This is a basic accessor class, which allows for accessing array data in the type specified by the template.
More...
#include <accessors.h>
Inherited by npl::BSplineView< T >, npl::Pixel3DView< T >, and npl::Vector3DView< T >.
|
| NDView (std::shared_ptr< NDArray > in) |
|
| NDView () |
|
void | setArray (ptr< NDArray > in) |
|
T | operator[] (int64_t index) |
| Gets value linear position in array, then casts to T. More...
|
|
T | get (const std::vector< int64_t > &index) |
| Gets value at array index and then casts to T. More...
|
|
T | get (size_t len, int64_t *index) |
| Gets value at array index and then casts to T. More...
|
|
T | operator[] (const std::vector< int64_t > &index) |
| Gets value at array index and then casts to T. More...
|
|
void | set (size_t len, const int64_t *index, T v) |
| Casts to the appropriate type then sets array at given index. More...
|
|
void | set (const std::vector< int64_t > &index, T v) |
| Casts to the appropriate type then sets array at given index. More...
|
|
void | set (int64_t index, T v) |
| Casts to the appropriate type then sets array at given index. More...
|
|
int64_t | tlen () |
|
|
template<typename U > |
static T | castgetStatic (void *ptr) |
| This is a wrapper function that will be called to safely cast from the underlying type. More...
|
|
template<typename U > |
static void | castsetStatic (void *ptr, const T &val) |
| This is a wrapper function that will be called to safely cast to the underlying type. More...
|
|
|
std::shared_ptr< NDArray > | parent |
| Where to get the dat a from. Also the shared_ptr prevents dealloc. More...
|
|
T(* | castget )(void *ptr) |
| Function pointer to the correct function for casting from the underlying type. More...
|
|
void(* | castset )(void *ptr, const T &v) |
| Function pointer to the correct function for casting to the underlying type. This should be set during construction. More...
|
|
template<typename T>
class npl::NDView< T >
This is a basic accessor class, which allows for accessing array data in the type specified by the template.
- Template Parameters
-
T | Value to return on access |
Definition at line 63 of file accessors.h.
template<typename T >
template<typename U >
This is a wrapper function that will be called to safely cast from the underlying type.
- Template Parameters
-
U | Underlying type of pixel, figured out in the constructor |
- Parameters
-
ptr | Pointer to memory where the pixel is. |
- Returns
- Correctly cast value
Definition at line 272 of file accessors.h.
template<typename T >
template<typename U >
static void npl::NDView< T >::castsetStatic |
( |
void * |
ptr, |
|
|
const T & |
val |
|
) |
| |
|
inlinestaticprotected |
This is a wrapper function that will be called to safely cast to the underlying type.
- Template Parameters
-
U | Underlying type of pixel, figured out in the constructor |
- Parameters
-
ptr | Pointer to memory where the pixel is. |
val | new value to write |
Definition at line 287 of file accessors.h.
template<typename T >
T npl::NDView< T >::get |
( |
const std::vector< int64_t > & |
index | ) |
|
|
inline |
Gets value at array index and then casts to T.
- Parameters
-
- Returns
- value
Definition at line 170 of file accessors.h.
template<typename T >
T npl::NDView< T >::get |
( |
size_t |
len, |
|
|
int64_t * |
index |
|
) |
| |
|
inline |
Gets value at array index and then casts to T.
- Parameters
-
len | length of index array |
index | n-d index to access |
- Returns
- value
Definition at line 186 of file accessors.h.
Gets value linear position in array, then casts to T.
- Returns
- value
Definition at line 155 of file accessors.h.
template<typename T >
T npl::NDView< T >::operator[] |
( |
const std::vector< int64_t > & |
index | ) |
|
|
inline |
Gets value at array index and then casts to T.
- Parameters
-
- Returns
- value
Definition at line 201 of file accessors.h.
template<typename T >
void npl::NDView< T >::set |
( |
size_t |
len, |
|
|
const int64_t * |
index, |
|
|
T |
v |
|
) |
| |
|
inline |
Casts to the appropriate type then sets array at given index.
- Parameters
-
len | length of index array |
index | n-d index to access |
v | value to set at index |
- Returns
- current value
Definition at line 218 of file accessors.h.
template<typename T >
void npl::NDView< T >::set |
( |
const std::vector< int64_t > & |
index, |
|
|
T |
v |
|
) |
| |
|
inline |
Casts to the appropriate type then sets array at given index.
- Parameters
-
v | value to set at index |
index | n-d index to access |
- Returns
- current value
Definition at line 234 of file accessors.h.
Casts to the appropriate type then sets array at given index.
- Parameters
-
v | value to set at index |
index | n-d index to access |
- Returns
- current value
Definition at line 250 of file accessors.h.
Function pointer to the correct function for casting from the underlying type.
- Parameters
-
ptr | location in memory where the pixel is stored |
Definition at line 303 of file accessors.h.
Function pointer to the correct function for casting to the underlying type. This should be set during construction.
- Parameters
-
ptr | pointer to memory |
v | value to cast and write |
Definition at line 313 of file accessors.h.
Where to get the dat a from. Also the shared_ptr prevents dealloc.
Definition at line 290 of file accessors.h.
The documentation for this class was generated from the following file: