Visual Servoing Platform  version 3.6.1 under development (2024-10-09)
visp::cnpy::NpyArray Struct Reference

#include <visp3/core/vpIoTools.h>

Public Member Functions

 NpyArray (const std::vector< size_t > &_shape, size_t _word_size, bool _fortran_order)
 
 NpyArray ()
 
template<typename T >
T * data ()
 
template<typename T >
const T * data () const
 
template<typename T >
std::vector< T > as_vec () const
 
size_t num_bytes () const
 

Public Attributes

std::shared_ptr< std::vector< char > > data_holder
 
std::vector< size_t > shape
 
size_t word_size
 
bool fortran_order
 
size_t num_vals
 

Detailed Description

Constructor & Destructor Documentation

◆ NpyArray() [1/2]

visp::cnpy::NpyArray::NpyArray ( const std::vector< size_t > &  _shape,
size_t  _word_size,
bool  _fortran_order 
)
inline

Definition at line 88 of file vpIoTools.h.

References data_holder, num_vals, shape, and word_size.

◆ NpyArray() [2/2]

visp::cnpy::NpyArray::NpyArray ( )
inline

Definition at line 97 of file vpIoTools.h.

Member Function Documentation

◆ as_vec()

template<typename T >
std::vector<T> visp::cnpy::NpyArray::as_vec ( ) const
inline
Examples
catchNPZ.cpp, tutorial-mb-generic-tracker-read.cpp, and tutorial-npz.cpp.

Definition at line 112 of file vpIoTools.h.

References num_vals.

◆ data() [1/2]

template<typename T >
T* visp::cnpy::NpyArray::data ( )
inline

◆ data() [2/2]

template<typename T >
const T* visp::cnpy::NpyArray::data ( ) const
inline

Definition at line 106 of file vpIoTools.h.

◆ num_bytes()

size_t visp::cnpy::NpyArray::num_bytes ( ) const
inline

Definition at line 118 of file vpIoTools.h.

References data_holder.

Member Data Documentation

◆ data_holder

std::shared_ptr<std::vector<char> > visp::cnpy::NpyArray::data_holder
Examples
readRealSenseData.cpp.

Definition at line 123 of file vpIoTools.h.

Referenced by NpyArray(), and num_bytes().

◆ fortran_order

bool visp::cnpy::NpyArray::fortran_order

Definition at line 126 of file vpIoTools.h.

◆ num_vals

size_t visp::cnpy::NpyArray::num_vals

Definition at line 127 of file vpIoTools.h.

Referenced by as_vec(), and NpyArray().

◆ shape

std::vector<size_t> visp::cnpy::NpyArray::shape

◆ word_size

size_t visp::cnpy::NpyArray::word_size

Definition at line 125 of file vpIoTools.h.

Referenced by NpyArray().