22struct is_opencv: std::false_type {};
 
   24struct is_opencv<cv::Mat_<T>>: std::true_type {};
 
   27struct io_impl<T, typename std::enable_if<is_opencv<T>::value>::type> {
 
   28    inline static std::vector<size_t> shape(
const T& data) {
 
   29        return std::vector<size_t>{
static_cast<size_t>(data.rows), 
static_cast<size_t>(data.cols)};
 
   32    inline static std::vector<int> shape(
const File& file,
 
   33                                         const std::string& path,
 
   34                                         std::vector<size_t> dims) {
 
   35        if (dims.size() == 1) {
 
   36            return std::vector<int>{
static_cast<int>(dims[0]), 1ul};
 
   38        if (dims.size() == 2) {
 
   39            return std::vector<int>{
static_cast<int>(dims[0]), 
static_cast<int>(dims[1])};
 
   42        throw detail::error(file, path, 
"H5Easy::load: Inconsistent rank");
 
   45    inline static DataSet 
dump(File& file,
 
   46                               const std::string& path,
 
   48                               const DumpOptions& options) {
 
   49        using value_type = 
typename T::value_type;
 
   50        DataSet dataset = initDataset<value_type>(file, path, shape(data), options);
 
   51        std::vector<value_type> v(data.begin(), data.end());
 
   52        dataset.write_raw(v.data());
 
   53        if (options.flush()) {
 
   59    inline static T 
load(
const File& file, 
const std::string& path) {
 
   60        using value_type = 
typename T::value_type;
 
   61        DataSet dataset = file.getDataSet(path);
 
   62        std::vector<int> dims = shape(file, path, dataset.getDimensions());
 
   63        T data(dims[0], dims[1]);
 
   64        dataset.read_raw(
reinterpret_cast<value_type*
>(data.data));
 
   69                                          const std::string& path,
 
   70                                          const std::string& key,
 
   72                                          const DumpOptions& options) {
 
   73        using value_type = 
typename T::value_type;
 
   74        Attribute attribute = initAttribute<value_type>(file, path, key, shape(data), options);
 
   75        std::vector<value_type> v(data.begin(), data.end());
 
   76        attribute.write_raw(v.data());
 
   77        if (options.flush()) {
 
   84                                  const std::string& path,
 
   85                                  const std::string& key) {
 
   86        using value_type = 
typename T::value_type;
 
   87        DataSet dataset = file.getDataSet(path);
 
   88        Attribute attribute = dataset.getAttribute(key);
 
   89        DataSpace dataspace = attribute.getSpace();
 
   90        std::vector<int> dims = shape(file, path, dataspace.getDimensions());
 
   91        T data(dims[0], dims[1]);
 
   92        attribute.read_raw(
reinterpret_cast<value_type*
>(data.data));
 
Definition H5Easy_Eigen.hpp:17
 
T loadAttribute(const File &file, const std::string &path, const std::string &key)
Definition H5Easy_public.hpp:166
 
DataSet dump(File &file, const std::string &path, const T &data, const DumpOptions &options)
Definition H5Easy_public.hpp:91
 
T load(const File &file, const std::string &path, const std::vector< size_t > &idx)
Definition H5Easy_public.hpp:138
 
Attribute dumpAttribute(File &file, const std::string &path, const std::string &key, const T &data, DumpMode mode)
Definition H5Easy_public.hpp:148