EleFits  4.0.0
A modern C++ API on top of CFitsIO

◆ makeRaster() [1/2]

template<typename T , typename... Longs>
PtrRaster<T, sizeof...(Longs)> Euclid::Fits::makeRaster ( T *  data,
Longs...  shape 
)

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 usages:

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::move
T move(T... args)
std::vector
STL class.
Euclid::Fits::makeRaster
PtrRaster< T, sizeof...(Longs)> makeRaster(T *data, Longs... shape)
Shortcut to create a raster from a shape and data without specifying the template parameters.
Definition: Raster.h:534