Visual Servoing Platform
version 3.6.1 under development (2024-11-21)
|
Classes | |
struct | NpyArray |
Typedefs | |
using | npz_t = std::map< std::string, NpyArray > |
Functions | |
VISP_EXPORT npz_t | npz_load (std::string fname) |
VISP_EXPORT char | BigEndianTest () |
VISP_EXPORT char | map_type (const std::type_info &t) |
template<typename T > | |
std::vector< char > | create_npy_header (const std::vector< size_t > &shape) |
VISP_EXPORT void | parse_npy_header (FILE *fp, size_t &word_size, std::vector< size_t > &shape, bool &fortran_order) |
VISP_EXPORT void | parse_npy_header (unsigned char *buffer, size_t &word_size, std::vector< size_t > &shape, bool &fortran_order) |
VISP_EXPORT void | parse_zip_footer (FILE *fp, uint16_t &nrecs, size_t &global_header_size, size_t &global_header_offset) |
VISP_EXPORT NpyArray | npz_load (std::string fname, std::string varname) |
VISP_EXPORT NpyArray | npy_load (std::string fname) |
template<typename T > | |
std::vector< char > & | operator+= (std::vector< char > &lhs, const T rhs) |
template<> | |
std::vector< char > & | operator+= (std::vector< char > &lhs, const std::string rhs) |
template<> | |
std::vector< char > & | operator+= (std::vector< char > &lhs, const char *rhs) |
template<typename T > | |
void | npy_save (std::string fname, const T *data, const std::vector< size_t > shape, std::string mode="w") |
template<typename T > | |
void | npz_save (std::string zipname, std::string fname, const T *data, const std::vector< size_t > &shape, std::string mode="w") |
template<typename T > | |
void | npy_save (std::string fname, const std::vector< T > data, std::string mode="w") |
template<typename T > | |
void | npz_save (std::string zipname, std::string fname, const std::vector< T > data, std::string mode="w") |
using visp::cnpy::npz_t = typedef std::map<std::string, NpyArray> |
Definition at line 130 of file vpIoTools.h.
char visp::cnpy::BigEndianTest | ( | ) |
Definition at line 57 of file vpIoTools_npy.cpp.
Referenced by create_npy_header().
std::vector< char > visp::cnpy::create_npy_header | ( | const std::vector< size_t > & | shape | ) |
Definition at line 360 of file vpIoTools.h.
References BigEndianTest(), and map_type().
char visp::cnpy::map_type | ( | const std::type_info & | t | ) |
Definition at line 63 of file vpIoTools_npy.cpp.
Referenced by create_npy_header().
visp::cnpy::NpyArray visp::cnpy::npy_load | ( | std::string | fname | ) |
Load the specified npy fname
filepath as one array of data. This function is similar to the numpy.load function.
[in] | fname | : Path to the npy file. |
Definition at line 420 of file vpIoTools_npy.cpp.
void visp::cnpy::npy_save | ( | std::string | fname, |
const std::vector< T > | data, | ||
std::string | mode = "w" |
||
) |
Save the specified 1-D array of data (data
) into the fname
npz file. This function is similar to the numpy.save function.
[in] | fname | : Path to the npy file. |
[in] | data | : Pointer to a 1-D array of basic datatype (int, float, double, std::complex<double>, ...). |
[in] | mode | : Writing mode, i.e. overwrite (w) or append (a) to the file. |
Definition at line 336 of file vpIoTools.h.
References npy_save().
void visp::cnpy::npy_save | ( | std::string | fname, |
const T * | data, | ||
const std::vector< size_t > | shape, | ||
std::string | mode = "w" |
||
) |
Save an array of data (data
) into the fname
npy file. This function is similar to the numpy.save function.
[in] | fname | : Path to the npy file. |
[in] | data | : Pointer to an array of basic datatype (int, float, double, std::complex<double>, ...). |
[in] | shape | : Shape of the array, e.g. Nz x Ny x Nx. |
[in] | mode | : Writing mode, i.e. overwrite (w) or append (a) to the file. |
Definition at line 178 of file vpIoTools.h.
References parse_npy_header().
Referenced by npy_save().
visp::cnpy::npz_t visp::cnpy::npz_load | ( | std::string | fname | ) |
Load the specified fname
filepath as arrays of data. This function is similar to the numpy.load function.
[in] | fname | : Path to the npz file. |
Definition at line 270 of file vpIoTools_npy.cpp.
visp::cnpy::NpyArray visp::cnpy::npz_load | ( | std::string | fname, |
std::string | varname | ||
) |
Load the specified varname
array of data from the fname
npz file. This function is similar to the numpy.load function.
[in] | fname | : Path to the npz file. |
[in] | varname | : Identifier for the requested array of data. |
Definition at line 347 of file vpIoTools_npy.cpp.
void visp::cnpy::npz_save | ( | std::string | zipname, |
std::string | fname, | ||
const std::vector< T > | data, | ||
std::string | mode = "w" |
||
) |
Save the specified fname
1-D array of data (data
) into the zipname
npz file. This function is similar to the numpy.savez function.
[in] | zipname | : Path to the npz file. |
[in] | fname | : Identifier for the corresponding array of data. |
[in] | data | : Pointer to a 1-D array of basic datatype (int, float, double, std::complex<double>, ...). |
[in] | mode | : Writing mode, i.e. overwrite (w) or append (a) to the file. |
Definition at line 353 of file vpIoTools.h.
References npz_save().
void visp::cnpy::npz_save | ( | std::string | zipname, |
std::string | fname, | ||
const T * | data, | ||
const std::vector< size_t > & | shape, | ||
std::string | mode = "w" |
||
) |
Save the specified fname
array of data (data
) into the zipname
npz file. This function is similar to the numpy.savez function.
[in] | zipname | : Path to the npz file. |
[in] | fname | : Identifier for the corresponding array of data. |
[in] | data | : Pointer to an array of basic datatype (int, float, double, std::complex<double>, ...). |
[in] | shape | : Shape of the array, e.g. Nz x Ny x Nx. |
[in] | mode | : Writing mode, i.e. overwrite (w) or append (a) to the file. |
Definition at line 235 of file vpIoTools.h.
References parse_zip_footer().
Referenced by npz_save().
|
inline |
Definition at line 157 of file vpIoTools.h.
|
inline |
Definition at line 151 of file vpIoTools.h.
std::vector<char>& visp::cnpy::operator+= | ( | std::vector< char > & | lhs, |
const T | rhs | ||
) |
Definition at line 141 of file vpIoTools.h.
void visp::cnpy::parse_npy_header | ( | FILE * | fp, |
size_t & | word_size, | ||
std::vector< size_t > & | shape, | ||
bool & | fortran_order | ||
) |
Definition at line 125 of file vpIoTools_npy.cpp.
Referenced by npy_save().
void visp::cnpy::parse_npy_header | ( | unsigned char * | buffer, |
size_t & | word_size, | ||
std::vector< size_t > & | shape, | ||
bool & | fortran_order | ||
) |
Definition at line 90 of file vpIoTools_npy.cpp.
void visp::cnpy::parse_zip_footer | ( | FILE * | fp, |
uint16_t & | nrecs, | ||
size_t & | global_header_size, | ||
size_t & | global_header_offset | ||
) |
Definition at line 181 of file vpIoTools_npy.cpp.
Referenced by npz_save().