EleFits  5.0.0
A modern C++ API on top of CFITSIO

◆ makeRaster() [1/2]

Raster< typename TContainer::value_type, sizeof...(Longs), TContainer > makeRaster ( TContainer &&  data,
Longs...  shape 
)
related

Shortcut to create a raster from a shape and data without specifying the template parameters.

Template Parameters
TThe pixel type, should not be specified (automatically deduced)
LongsThe axes lengths, should not be specified (automatically deduced)
Parameters
dataThe raster values, which can be either a pointer (or C array) or a vector
shapeThe shape as a comma-separated list of longs
Example
Given:
- long width, height, depth: The axes lengths;
- float* ptr: The pixel values as a pointer;
- std::vector<float> vec: The pixel values as a vector;
auto ptrRaster2D = makeRaster(ptr, width, height);
auto ptrRaster3D = makeRaster(ptr, width, height, depth);
auto vecRaster2D = makeRaster(vec, width, height); // The vector is copied
auto vecRaster3D = makeRaster(std::move(vec), width, height, depth); // The vector is moved
std::vector< T > vector() const
Copy the container values into an std::vector.
Definition: DataContainer.h:267
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.
Definition: Raster.h:378
T move(T... args)