| IOLink 1.11.0

Loading...
Searching...
No Matches
Public Member Functions | List of all members
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.
| 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.
| 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.
| RegionCopier (const RegionCopier &other)
| Copy constructor.
RegionCopier & | operator= (const RegionCopier &other)
| Assignation operator.
| ~RegionCopier ()
| Destructor.
void | copy (const uint8_t *src, uint8_t *dst)
| Copy data from memory, to memory.
void | copy (std::shared_ptr< RandomAccess > src, uint8_t *dst)
| Copy data from a storage to memory.
void | copy (const uint8_t *src, std::shared_ptr< RandomAccess > dst)
| Copy data from memory to a storage.

## 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.

If one or both of the input indexers have an unknown data type, a fallback mechanism will be trigerred, using an equivalent version with the data type set to the one given in parameter.

Parameters

  srcIndexer | An indexer used to access source
  dstIndexer | An indexer used to access destination
  srcOrigin | Position where the first sample will be read
  dstOrigin | Position where the first sample will be written
  regionSize | The size of the region to copy
  dataType | The type of data stored in the source and the destination

Exceptions

  InvalidArgument | If the indexers data type is not the same as dataType.

## ◆ 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.

If the input indexer has an unknown data type, a fallback mecanism will be triggered, using an equivalent version with the data type set to the one given in parameter.

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

Parameters

  srcindexer | An indexer used to access source
  srcRegion | region to copy from the source
  dataType | datatype of source data

Exceptions

  InvalidArgument | If the srcIndexer data type is not the same as dataType.

## ◆ 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.

If the input indexer has an unknown data type, a fallback mecanism will be triggered, using an equivalent version with the data type set to the one given in parameter.

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

Parameters

  dstRegion | region destination to fill
  dstIndexer | An indexer used to access destination
  dataType | datatype of data

Exceptions

  InvalidArgument | If the dstIndexer data type is not the same as dataType.

## ◆ RegionCopier() [4/4]

iolink::RegionCopier::RegionCopier | ( | const RegionCopier & | other | ) |

Copy constructor.

Parameters

  other | RegionCopier 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

  src | A pointer to the data to copy
  dst | A 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

  src | A pointer to the data to copy
  dst | A 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

  src | A RandomAccess used to read data
  dst | A pointer where to copy the data

## ◆ operator=()

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

Assignation operator.

Parameters

  other | RegionCopier to use for assignment

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

- iolink/public/include/iolink/RegionCopier.h