IOLink  IOL_v1.1.0_release
iolink::RegionCopier Class Referencefinal

This class contains the algorithms used to copy data beetween two regions of N dimensionnal data. More...

#include <iolink/RegionCopier.h>

Public Member Functions

 RegionCopier (const Indexer &srcIndexer, const Indexer &dstIndexer, const VectorXu64 &srcOrigin, const VectorXu64 &dstOrigin, const VectorXu64 &regionSize, DataType dataType)
 Build a copier with all the parameters. More...
 
 RegionCopier (const Indexer &srcindexer, const RegionXu64 &srcRegion, DataType dataType)
 Shortened constructor in the case if the destination has the same dimensions as the region itself. More...
 
 RegionCopier (const RegionXu64 &dstRegion, const Indexer &dstIndexer, DataType dataType)
 Shortened constructor in the case if the source has the same dimensions as the region itself. More...
 
 RegionCopier (const RegionCopier &other)
 Copy constructor. More...
 
RegionCopieroperator= (const RegionCopier &other)
 Assignation operator. More...
 
 ~RegionCopier ()
 Destructor.
 
void copy (const uint8_t *src, uint8_t *dst)
 Copy data from memory, to memory. More...
 
void copy (std::shared_ptr< RandomAccess > src, uint8_t *dst)
 Copy data from a storage to memory. More...
 
void copy (const uint8_t *src, std::shared_ptr< RandomAccess > dst)
 Copy data from memory to a storage. More...
 

Detailed Description

This class contains the algorithms used to copy data beetween two regions of N dimensionnal data.

*     SOURCE        DESTINATION
*  -------------     --------
* |      o----  |   | o----  |
* |      |  --|-|---|-|->  | |
* |      |    | |   | |    | |
* |       ----  |   |  ----  |
* |             |    --------
* |             |
*  -------------
* 

The methods of this class will copy one region in the source, to another in the destination. With some conditions: the source region and the destination one must have exactly the same size, and the source and the destination must share the same DataType.

Constructor & Destructor Documentation

◆ RegionCopier() [1/4]

iolink::RegionCopier::RegionCopier ( const Indexer srcIndexer,
const Indexer dstIndexer,
const VectorXu64 srcOrigin,
const VectorXu64 dstOrigin,
const VectorXu64 regionSize,
DataType  dataType 
)

Build a copier with all the parameters.

Parameters
srcIndexerAn indexer used to access source
dstIndexerAn indexer used to access destination
srcOriginPosition where the first sample will be read
dstOriginPosition where the first sample will be written
regionSizeThe size of the region to copy
dataTypeThe type of data stored in the source and the destination

◆ RegionCopier() [2/4]

iolink::RegionCopier::RegionCopier ( const Indexer srcindexer,
const RegionXu64 srcRegion,
DataType  dataType 
)

Shortened constructor in the case if the destination has the same dimensions as the region itself.

Used for example when reading a part of an image into a buffer.

Parameters
srcindexerAn indexer used to access source
srcRegionregion to copy from the source
dataTypedatatype of source data

◆ RegionCopier() [3/4]

iolink::RegionCopier::RegionCopier ( const RegionXu64 dstRegion,
const Indexer dstIndexer,
DataType  dataType 
)

Shortened constructor in the case if the source has the same dimensions as the region itself.

Used for example to write data stored in a buffer into a part of an image.

Parameters
dstRegionregion destination to fill
dstIndexerAn indexer used to access destination
dataTypedatatype of data

◆ RegionCopier() [4/4]

iolink::RegionCopier::RegionCopier ( const RegionCopier other)

Copy constructor.

Parameters
otherRegionCopier to use as model

Member Function Documentation

◆ copy() [1/3]

void iolink::RegionCopier::copy ( const uint8_t *  src,
std::shared_ptr< RandomAccess dst 
)

Copy data from memory to a storage.

Parameters
srcA pointer to the data to copy
dstA RandomAccess used to write data

◆ copy() [2/3]

void iolink::RegionCopier::copy ( const uint8_t *  src,
uint8_t *  dst 
)

Copy data from memory, to memory.

Parameters
srcA pointer to the data to copy
dstA pointer where to copy the data

◆ copy() [3/3]

void iolink::RegionCopier::copy ( std::shared_ptr< RandomAccess src,
uint8_t *  dst 
)

Copy data from a storage to memory.

Parameters
srcA RandomAccess used to read data
dstA pointer where to copy the data

◆ operator=()

RegionCopier& iolink::RegionCopier::operator= ( const RegionCopier other)

Assignation operator.

Parameters
otherRegionCopier to use for assignment

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