#include <TestRaster.h>
A random Raster of given type and shape.
Public Member Functions | |
RandomRaster (Position< N > rasterShape, T min=almostMin< T >(), T max=almostMax< T >()) | |
Generate a Raster with given shape. | |
virtual | ~RandomRaster ()=default |
Destructor. | |
template<typename TRaster > | |
bool | approx (const TRaster &other, double tol=0.01) const |
Shortcut for rasterApprox. | |
Public Member Functions inherited from Raster< T, N, TContainer > | |
Raster (Position< N > shape) | |
Constructor. More... | |
Raster (Position< N > shape, T *data) | |
Constructor. More... | |
template<typename... Ts> | |
Raster (Position< N > shape, Ts &&... args) | |
Constructor. More... | |
const Position< N > & | shape () const |
Get the raster shape. | |
Region< N > | domain () const |
Get the raster domain. More... | |
long | dimension () const |
Get the actual dimension. More... | |
template<long I> | |
long | length () const |
Get the length along given axis. | |
long | index (const Position< N > &pos) const |
Compute the raw index of a given position. | |
const T & | operator[] (const Position< N > &pos) const |
Access the pixel value at given position. | |
T & | operator[] (const Position< N > &pos) |
Access the pixel value at given position. | |
const T & | at (const Position< N > &pos) const |
Access the pixel value at given position. More... | |
T & | at (const Position< N > &pos) |
Access the pixel value at given position. | |
template<long M = 2> | |
bool | isContiguous (const Region< N > ®ion) const |
Check whether a region is made of contiguous values in memory. More... | |
template<long M = 2> | |
const PtrRaster< const T, M > | slice (const Region< N > ®ion) const |
Create a slice from a given region. More... | |
template<long M = 2> | |
PtrRaster< T, M > | slice (const Region< N > ®ion) |
Create a slice from a given region. | |
const PtrRaster< const T, N > | section (long front, long back) const |
Create a section between given indices. More... | |
PtrRaster< T, N > | section (long front, long back) |
Create a section between given indices. | |
const PtrRaster< const T, N==-1 ? -1 :N - 1 > | section (long index) const |
Create a section at given. | |
PtrRaster< T, N==-1 ? -1 :N - 1 > | section (long index) |
Create a section at given. | |
Public Member Functions inherited from DataContainer< T, TContainer, Raster< T, N, TContainer > > | |
T * | data () |
Inherit data holder's data() . | |
const T * | data () const |
Inherit data holder's data() . | |
const std::decay_t< TContainer > & | container () const |
Access the container in read-only mode. | |
std::vector< T > | vector () const |
Copy the container values into an std::vector . More... | |
TContainer & | moveTo (TContainer &destination) |
Move the container. More... | |
std::size_t | size () const |
Inherit data holder's size() . | |
Public Member Functions inherited from ContiguousContainerMixin< T, TDerived > | |
bool | emtpy () const |
Check whether the container is empty. More... | |
const T & | operator[] (size_type index) const |
Access the element with given index. | |
T & | operator[] (size_type index) |
Access the element with given index. | |
const_iterator | begin () const |
Iterator to the first element. | |
iterator | begin () |
Iterator to the first element. | |
const_iterator | cbegin () |
Iterator to the first element. | |
const_iterator | end () const |
Iterator to one past the last element. | |
iterator | end () |
Iterator to one past the last element. | |
const_iterator | cend () |
Iterator to one past the last element. | |
virtual bool | operator== (const TDerived &rhs) const |
Check equality. | |
bool | operator!= (const TDerived &rhs) const |
Check inequality. | |
Public Member Functions inherited from VectorArithmeticMixin< T, TDerived, Incrementable > | |
TDerived & | operator+= (const TDerived &rhs) |
V += U and W = V + U. | |
TDerived & | operator+= (const T &rhs) |
V += a, V = U + a, V = a + U. | |
TDerived & | operator-= (const TDerived &rhs) |
V -= U and W = V - U. | |
TDerived & | operator-= (const T &rhs) |
V -= a, V = U - a, V = a - U. | |
TDerived & | operator*= (const T &rhs) |
V *= a, V = U * a, V = a * U. | |
TDerived & | operator/= (const T &rhs) |
V /= a, V = U / a. | |
template<typename TFunc , typename... TContainers> | |
TDerived & | generate (TFunc &&func, const TContainers &... args) |
Generate values from a function with optional input containers. More... | |
template<typename TFunc , typename... TContainers> | |
TDerived & | apply (TFunc &&func, const TContainers &... args) |
Apply a function with optional input containers. More... | |
TDerived | operator+ () const |
Copy. | |
TDerived | operator- () const |
Compute the opposite. | |
Additional Inherited Members | |
Public Types inherited from Raster< T, N, TContainer > | |
using | Value = T |
The pixel value type. | |
Public Types inherited from DataContainer< T, TContainer, Raster< T, N, TContainer > > | |
using | Holder = DataContainerHolder< T, TContainer > |
The concrete data holder type. | |
Public Types inherited from ContiguousContainerMixin< T, TDerived > | |
using | value_type = T |
The value type. | |
using | reference = T & |
The value reference. | |
using | const_reference = const T & |
The constant value reference. | |
using | iterator = T * |
The value iterator. | |
using | const_iterator = const T * |
The constant value iterator. | |
using | difference_type = std::ptrdiff_t |
The iterator difference type. | |
using | size_type = std::size_t |
The underlying container size type. | |
Static Public Attributes inherited from Raster< T, N, TContainer > | |
static constexpr long | Dim = N |
The dimension template parameter. More... | |
Related Functions inherited from Raster< T, N, TContainer > | |
template<typename TContainer , typename... Longs> | |
Raster< typename TContainer::value_type, sizeof...(Longs), TContainer > | makeRaster (TContainer &&data, Longs... shape) |
Shortcut to create a raster from a shape and data without specifying the template parameters. More... | |
template<typename T , typename... Longs> | |
PtrRaster< T, sizeof...(Longs)> | makeRaster (T *data, Longs... shape) |
Related Functions inherited from ContiguousContainerMixin< T, TDerived > | |
template<typename T , typename TDerived > | |
std::ostream & | operator<< (std::ostream &os, const ContiguousContainerMixin< T, TDerived > &container) |
Insert a ContiguousContainerMixin into an output stream. | |