|
vitrio 0.1.4
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
|
What a scratch holds of one image file. More...
#include <vitrio/image_scratch_entry.hpp>
Public Member Functions | |
| image_scratch_entry (const image_scratch_entry &other)=delete | |
| image_scratch_entry (image_scratch_entry &&other)=delete | |
| image_scratch_entry & | operator= (const image_scratch_entry &other)=delete |
| image_scratch_entry & | operator= (image_scratch_entry &&other)=delete |
| virtual image_transfer_plan | read (array_ref destination, const image_transfer_plan ®ions) const =0 |
| Read the regions of a plan that are held, and answer the rest. | |
| virtual void | store (const image_reader &file, const image_transfer_plan ®ions)=0 |
| Take in regions of the file, out of a reader over it. | |
What a scratch holds of one image file.
A copy of some of what the file holds, kept where it is faster to reach than the file. Which parts of the file an entry keeps, and how it keeps them, is implementation's own business. It is asked in regions of the file: a read is answered with the regions it did not serve, and it takes in what it has room for of the regions it is offered.
Nothing an entry has taken in is dropped, so a region it once served it serves from then on.
|
pure virtual |
Read the regions of a plan that are held, and answer the rest.
The file is the file side of the plan and destination its array side, as in image_reader::read, and a region that is held is read as that would read it: the same values land on the same elements, converted the same way.
A region is held when everything it spans is. One that is held only in part is not read at all, and neither is a plan that does not have the rank of the file.
| destination | Where the regions that are held are written. Must be initialized. |
| regions | The regions to read and where each one lands. |
regions and in the order they have in it. Empty when every region was read. | std::invalid_argument | If destination is not initialized. |
| std::out_of_range | If a region that is held does not fit in destination where it is placed. |
| unsupported_operation_error | If the data type of destination can not be produced from the one of the file. |
|
pure virtual |
Take in regions of the file, out of a reader over it.
Takes in what it has room for of what the regions span, and may take in more of the file than they span. A region none of which it has room for is passed over, and so is a plan that does not have the rank of the file. What is already held is not read again.
Only the file side of the plan plays a part.
If reading file fails, what was being taken in is not held.
| file | A reader over the file this entry is of. |
| regions | The regions to take in. |
| image_file_format_error | If the file turns out to be malformed or truncated where it is read. |