1#ifndef ISCE_IO_GDAL_BUFFER_ICC
2#error "Buffer.icc is an implementation detail of Buffer.h"
5#include <isce3/except/Error.h>
7namespace isce3 {
namespace io {
namespace gdal {
12 const std::array<int, 2> &
shape)
20 const std::array<int, 2> &
shape,
29 const std::array<int, 2> &
shape,
30 const std::array<std::size_t, 2> &
strides)
32 _data(const_cast<void *>(
data)),
39 throw isce3::except::InvalidArgument(ISCE_SRCINFO(),
"shape[n] must be >= 0");
46 const std::array<int, 2> &
shape,
47 const std::array<std::size_t, 2> &
strides,
57 throw isce3::except::InvalidArgument(ISCE_SRCINFO(),
"shape[n] must be >= 0");
65 if (detail::Type2GDALDataType<T>::datatype !=
datatype()) {
66 throw isce3::except::RuntimeError(ISCE_SRCINFO(),
"requested type must match the underlying data type");
69 return TypedBuffer<T>(
static_cast<T *
>(_data), _shape, _strides, _access);
75 const std::array<int, 2> &
shape)
83 const std::array<int, 2> &
shape,
92 const std::array<int, 2> &
shape,
93 const std::array<std::size_t, 2> &
strides)
95 _data(const_cast<T *>(
data)),
101 throw isce3::except::InvalidArgument(ISCE_SRCINFO(),
"shape[n] must be >= 0");
108 const std::array<int, 2> &
shape,
109 const std::array<std::size_t, 2> &
strides,
118 throw isce3::except::InvalidArgument(ISCE_SRCINFO(),
"shape[n] must be >= 0");
constexpr GDALAccess access() const
Access mode.
Definition Buffer.h:114
constexpr Buffer(const void *data, GDALDataType datatype, const std::array< int, 2 > &shape)
Create a buffer object describing a read-only row-major, contiguous data buffer.
Definition Buffer.icc:10
constexpr TypedBuffer< T > cast() const
Cast to typed buffer.
Definition Buffer.icc:63
constexpr const std::array< std::size_t, 2 > & strides() const
Stride in bytes between the start of adjacent elements along each dimension.
Definition Buffer.h:102
constexpr GDALDataType datatype() const
Datatype identifier.
Definition Buffer.h:82
constexpr void * data()
Pointer to the start of the data buffer.
Definition Buffer.h:74
constexpr const std::array< int, 2 > & shape() const
Buffer dims (nrows, ncols)
Definition Buffer.h:90
Buffer with static type information.
Definition Buffer.h:136
constexpr const std::array< std::size_t, 2 > & strides() const
Stride in bytes between the start of adjacent elements along each dimension.
Definition Buffer.h:218
constexpr GDALAccess access() const
Access mode.
Definition Buffer.h:230
constexpr const std::array< int, 2 > & shape() const
Buffer dims (nrows, ncols)
Definition Buffer.h:206
constexpr T * data()
Pointer to the start of the data buffer.
Definition Buffer.h:190
constexpr TypedBuffer(const T *data, const std::array< int, 2 > &shape)
Create a buffer object describing a read-only row-major, contiguous data buffer.
Definition Buffer.icc:74
The isce3::io namespace.
Definition Constants.h:14
base interpolator is an abstract base class
Definition BinarySearchFunc.cpp:5