5#include <vitrio/array/array.hpp>
6#include <vitrio/byte.hpp>
7#include <vitrio/export.hpp>
8#include <vitrio/image_transfer_plan.hpp>
9#include <vitrio/span.hpp>
40class VITRIO_API image_scratch_storage
43 image_scratch_storage()
noexcept;
44 image_scratch_storage(
const image_scratch_storage &other) =
delete;
45 image_scratch_storage(image_scratch_storage &&other) =
delete;
46 virtual ~image_scratch_storage();
48 image_scratch_storage&
49 operator=(
const image_scratch_storage &other) =
delete;
50 image_scratch_storage& operator=(image_scratch_storage &&other) =
delete;
57 virtual std::size_t
get_size() const noexcept = 0;
67 virtual
void read(std::
size_t offset,
span<
byte> bytes) const = 0;
77 virtual
void write(std::
size_t offset,
span<const
byte> bytes) = 0;
91 span<const
byte> bytes,
How a block of memory is read as a multidimensional array.
Definition array_descriptor.hpp:31
A multidimensional array of numbers in host memory.
Definition array.hpp:37
Where a finished unit of work is reported.
Definition completion_notifier.hpp:20
Abstract read-only view of one image file.
Definition image_reader.hpp:38
virtual void serve_async(const array_descriptor &values, array destination, image_transfer_plan regions, std::shared_ptr< completion_notifier > done) const =0
Start reading regions of values the block holds into an array.
virtual std::size_t get_size() const noexcept=0
Get the size of the block.
virtual void write(std::size_t offset, span< const byte > bytes)=0
Write bytes of the block, before this returns.
virtual void read(std::size_t offset, span< byte > bytes) const =0
Read bytes of the block, before this returns.
virtual void load_async(std::shared_ptr< const image_reader > file, const array_descriptor &values, image_transfer_plan regions, std::shared_ptr< completion_notifier > done)=0
Start taking regions of a file into values the block holds.
virtual void write_async(std::size_t offset, span< const byte > bytes, std::shared_ptr< completion_notifier > done)=0
Start writing bytes of the block, as a transfer.
The regions to transfer between one file and one array.
Definition image_transfer_plan.hpp:34
A view of a contiguous sequence of elements.
Definition span.hpp:29