vitrio 0.1.4
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
vitrio::clipping_image_transfer_sanitizer Class Referencefinal

A sanitizer that clips every region to both of its sides. More...

#include <vitrio/clipping_image_transfer_sanitizer.hpp>

Inheritance diagram for vitrio::clipping_image_transfer_sanitizer:
Inheritance graph
[legend]
Collaboration diagram for vitrio::clipping_image_transfer_sanitizer:
Collaboration graph
[legend]

Public Member Functions

std::vector< image_transfer_plan > sanitize (const image_transfer_plan &regions, span< const std::size_t > file_extents, span< const std::size_t > array_extents) const override
 Get the plans to transfer in place of a plan.
 
- Public Member Functions inherited from vitrio::image_transfer_sanitizer
 image_transfer_sanitizer (const image_transfer_sanitizer &other)=delete
 
 image_transfer_sanitizer (image_transfer_sanitizer &&other)=delete
 
image_transfer_sanitizer & operator= (const image_transfer_sanitizer &other)=delete
 
image_transfer_sanitizer & operator= (image_transfer_sanitizer &&other)=delete
 

Static Public Member Functions

static const std::shared_ptr< const clipping_image_transfer_sanitizer > & get_shared ()
 Get the instance every use shares.
 

Detailed Description

A sanitizer that clips every region to both of its sides.

A region is cut down to the intersection of what the file holds at its file offset with what the array holds at its array offset, up to the extents of the plan. The intersection begins where the region begins on either side, so clipping only ever shortens the extents and never moves an offset. A region reaching past both sides is shortened by whichever runs out first.

Member Function Documentation

◆ get_shared()

static const std::shared_ptr< const clipping_image_transfer_sanitizer > & vitrio::clipping_image_transfer_sanitizer::get_shared ( )
static

Get the instance every use shares.

Returns
const std::shared_ptr<const clipping_image_transfer_sanitizer>& The instance, never null.

◆ sanitize()

std::vector< image_transfer_plan > vitrio::clipping_image_transfer_sanitizer::sanitize ( const image_transfer_plan &  regions,
span< const std::size_t >  file_extents,
span< const std::size_t >  array_extents 
) const
overridevirtual

Get the plans to transfer in place of a plan.

Every region of every plan returned fits both sides. The plans have the file rank and the array rank of regions. Their extents may differ from those of regions and from one another, which is why more than one may be returned.

Parameters
regionsThe regions asked for.
file_extentsExtents of the file. Must have the file rank of regions.
array_extentsExtents of the array. Must have the array rank of regions.
Returns
std::vector<image_transfer_plan> The plans to transfer. Empty when nothing is to be transferred.
Exceptions
std::invalid_argumentIf either extents do not have the rank of the side they describe.
std::out_of_rangeIf a region that does not fit is refused.

Implements vitrio::image_transfer_sanitizer.


The documentation for this class was generated from the following file: