Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/source/basic_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Example : Reading images, audio and NPZ files

int main()
{
// loads png image into xarray with shape WIDTH x HEIGHT x CHANNELS
// loads png image into xarray with shape HEIGHT x WIDTH x CHANNELS
auto arr = xt::load_image("test.png");

// write xarray out to JPEG image
Expand All @@ -37,7 +37,7 @@ Example : Reading images, audio and NPZ files
// open a wav file
auto audio = xt::load_audio("files/xtensor.wav");
std::cout << "Sampling Frequency: " << std::get<0>(audio) << std::endl;
auto& arr = std::get<1>(audio); // audio contents (like scipy.io.wavfile results)
auto& arr = std::get<1>(audio); // audio contents (like scipy.io.wavfile results)

// save a sine wave sound
int freq = 2000;
Expand Down
9 changes: 6 additions & 3 deletions include/xtensor-io/xaudio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@

#include <sndfile.hh>

#include "xtensor/xarray.hpp"
#include "xtensor/xeval.hpp"
#include <xtensor/xarray.hpp>
#include <xtensor/xeval.hpp>

#include "xtensor_io_config.hpp"
#pragma cling load("sndfile")

#ifdef __CLING__
#pragma cling load("sndfile")
#endif

namespace xt
{
Expand Down
7 changes: 4 additions & 3 deletions include/xtensor-io/ximage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
#ifndef XTENSOR_IO_XIMAGE_HPP
#define XTENSOR_IO_XIMAGE_HPP

#include <cstddef>
#include <stdexcept>
#include <string>

#include "xtensor/xarray.hpp"
#include "xtensor/xeval.hpp"
#include <xtensor/xarray.hpp>
#include <xtensor/xeval.hpp>

#include "xtensor_io_config.hpp"

Expand All @@ -39,7 +40,7 @@ namespace xt
* @param filename The path of the file to load
*
* @return xarray with image contents. The shape of the xarray
* is ``WIDTH x HEIGHT x CHANNELS`` of the loaded image, where
* is ``HEIGHT x WIDTH x CHANNELS`` of the loaded image, where
* ``CHANNELS`` are ordered in standard ``R G B (A)``.
*/
template <class T = unsigned char>
Expand Down
5 changes: 4 additions & 1 deletion include/xtensor-io/xnpz.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
#include <xtensor/xnpy.hpp>

#include "xtensor_io_config.hpp"
#pragma cling load("z")

#ifdef __CLING__
#pragma cling load("z")
#endif

namespace xt
{
Expand Down