49 std::move(spacing), std::move(centrePosition), std::move(addressModes)};
76 {index.X() + 1, index.Y() + 1});
92 At({index.X() + 1, index.Y() + 1}) -
At({index.X(), index.Y() + 1})));
107 At({index.X() + 1, index.Y() + 1}) -
At({index.X() + 1, index.Y()})));
124 At({index.X() + 1, index.Y() + 1}) -
At({index.X(), index.Y() + 1}))),
126 At({index.X() + 1, index.Y() + 1}) -
At({index.X() + 1, index.Y()})))};
#define __host__
Definition Global.h:17
#define __device__
Definition Global.h:22
A 2D texture stored for access by the CPU.
Definition Texture2DCPU.h:15
Texture2DCPU & operator=(const Texture2DCPU &)=default
static Texture2DCPU FromTensor(const at::Tensor &image, VectorType spacing, VectorType centrePosition=VectorType::Full(0), AddressModeType addressModes=AddressModeType::Full(TextureAddressMode::ZERO))
Definition Texture2DCPU.h:45
__host__ __device__ float At(const SizeType &index) const
Definition Texture2DCPU.h:56
__host__ __device__ float DSampleDY(VectorType texCoord) const
Definition Texture2DCPU.h:100
Texture2DCPU & operator=(Texture2DCPU &&)=default
__host__ __device__ float DSampleDX(VectorType texCoord) const
Definition Texture2DCPU.h:85
__host__ __device__ float Sample(VectorType texCoord) const
Definition Texture2DCPU.h:69
Texture2DCPU(const float *_ptr, SizeType _size, VectorType _spacing, VectorType _centrePosition=VectorType::Full(0), AddressModeType _addressModes=AddressModeType::Full(TextureAddressMode::ZERO))
Definition Texture2DCPU.h:21
Texture2DCPU(const Texture2DCPU &)=default
Texture2DCPU(Texture2DCPU &&)=default
__host__ __device__ VectorType DSampleDTexCoord(VectorType texCoord) const
Definition Texture2DCPU.h:115
A parent texture class containing template data and functionality.
Definition Texture.h:71
__host__ __device__ const SizeType & Size() const
Definition Texture.h:82
Vec< TextureAddressMode, dimensionality > AddressModeType
Definition Texture.h:78
__host__ __device__ constexpr Vec< newT, N > StaticCast() const
Construct a Vec with the elements form this one cast to a new type.
Definition Vec.h:237
__host__ __device__ constexpr Vec< newT, N > Apply(const std::function< newT(T)> &f) const
Map all elements with a common std::function mapping function.
Definition Vec.h:285
__host__ __device__ constexpr const T & X() const
Get a constant reference to the first element.
Definition Vec.h:417
__host__ __device__ constexpr const T & Y() const
Get a constant reference to the second element.
Definition Vec.h:427
__host__ static __device__ constexpr Vec Full(const double &value)
Construct a Vec, copying the given value into every element.
Definition Vec.h:64
Vec< TextureAddressMode, DIMENSIONALITY > StringsToAddressModes(const std::array< std::string_view, DIMENSIONALITY > &strings)
Definition Texture.h:44
@ ZERO
Sampling locations outside texture coordinate range will be read as 0.
Definition GridSample3DCPU.cpp:6