17#ifndef __algo_copy_h__
18#define __algo_copy_h__
26 template <
class InputImageType,
class OutputImageType>
27 void copy (InputImageType&& source, OutputImageType&& destination,
size_t from_axis = 0,
size_t to_axis = std::numeric_limits<size_t>::max())
29 for (
auto i =
Loop (source, from_axis, to_axis) (source, destination); i; ++i)
30 destination.value() = source.value();
35 template <
class InputImageType,
class OutputImageType>
36 void copy_with_progress (InputImageType&& source, OutputImageType&& destination,
size_t from_axis = 0,
size_t to_axis = std::numeric_limits<size_t>::max())
39 source, destination, from_axis, to_axis);
43 template <
class InputImageType,
class OutputImageType>
44 void copy_with_progress_message (
const std::string& message, InputImageType&& source, OutputImageType&& destination,
size_t from_axis = 0,
size_t to_axis = std::numeric_limits<size_t>::max())
46 for (
auto i =
Loop (message, source, from_axis, to_axis) (source, destination); i; ++i)
47 destination.value() = source.value();
FORCE_INLINE LoopAlongAxes Loop()
void copy_with_progress(InputImageType &&source, OutputImageType &&destination, size_t from_axis=0, size_t to_axis=std::numeric_limits< size_t >::max())
void copy(InputImageType &&source, OutputImageType &&destination, size_t from_axis=0, size_t to_axis=std::numeric_limits< size_t >::max())
std::string shorten(const std::string &text, size_t longest=40, size_t prefix=10)
convert a long string to 'beginningofstring...endofstring' for display
void copy_with_progress_message(const std::string &message, InputImageType &&source, OutputImageType &&destination, size_t from_axis=0, size_t to_axis=std::numeric_limits< size_t >::max())