ChimeraTK-DeviceAccess 03.25.00
Loading...
Searching...
No Matches
ChimeraTK::MappedImage Class Reference

interface to an image that is mapped onto a 1D array of ValType More...

#include <MappedImage.h>

+ Inheritance diagram for ChimeraTK::MappedImage:
+ Collaboration diagram for ChimeraTK::MappedImage:

Public Member Functions

void setShape (unsigned width, unsigned height, ImgFormat fmt)
 needs to be called after construction.
 
unsigned char * imgBody ()
 returns pointer to image payload data
 
template<typename UserType , ImgOptions OPTIONS = ImgOptions::RowMajor>
ImgView< UserType, OPTIONS > interpretedView ()
 returns an ImgView object which can be used like a matrix.
 
- Public Member Functions inherited from ChimeraTK::MappedStruct< ImgHeader >
 MappedStruct (ChimeraTK::OneDRegisterAccessor< unsigned char > &accToData, InitData doInitData=InitData::No)
 This keeps a reference to given OneDRegisterAccessor.
 
unsigned char * data ()
 returns pointer to data for header and struct content.
 
size_t capacity () const
 capacity of used container
 
size_t size () const
 currently used size
 
ImgHeaderheader ()
 returns header, e.g. for setting meta data
 
void initData ()
 default initialize header and zero out data that follows
 

Static Public Member Functions

static size_t lengthForShape (unsigned width, unsigned height, ImgFormat fmt)
 

Static Protected Member Functions

static std::pair< uint32_t, uint32_t > getFormatDefinition (ImgFormat fmt)
 Returns a pair of nChannels and nBytesPerPixel matching to the image format.
 

Additional Inherited Members

- Public Types inherited from ChimeraTK::MappedStruct< ImgHeader >
enum  InitData
 
- Protected Attributes inherited from ChimeraTK::MappedStruct< ImgHeader >
ChimeraTK::OneDRegisterAccessor< unsigned char > & _accToData
 

Detailed Description

interface to an image that is mapped onto a 1D array of ValType

NOTE: MappedImage is based on MappedStruct concept, which is discouraged. Use DataConsistencyGroup of struct members instead if possible. MappedImage is currently in used by DoocsAdapter and DoocsBackend.

Definition at line 147 of file MappedImage.h.

Member Function Documentation

◆ getFormatDefinition()

std::pair< uint32_t, uint32_t > ChimeraTK::MappedImage::getFormatDefinition ( ImgFormat  fmt)
inlinestaticprotected

Returns a pair of nChannels and nBytesPerPixel matching to the image format.

Definition at line 216 of file MappedImage.h.

◆ imgBody()

unsigned char * ChimeraTK::MappedImage::imgBody ( )
inline

returns pointer to image payload data

Definition at line 156 of file MappedImage.h.

◆ interpretedView()

template<typename UserType , ImgOptions OPTIONS = ImgOptions::RowMajor>
ImgView< UserType, OPTIONS > ChimeraTK::MappedImage::interpretedView ( )
inline

returns an ImgView object which can be used like a matrix.

The ImgView becomes invalid at next setShape call. It also becomes invalid when memory location of underlying MappedStruct changes.

Definition at line 161 of file MappedImage.h.

◆ lengthForShape()

size_t ChimeraTK::MappedImage::lengthForShape ( unsigned  width,
unsigned  height,
ImgFormat  fmt 
)
inlinestatic

Definition at line 274 of file MappedImage.h.

◆ setShape()

void ChimeraTK::MappedImage::setShape ( unsigned  width,
unsigned  height,
ImgFormat  fmt 
)
inline

needs to be called after construction.

corrupts all data. this throws logic_error if our buffer size is too small. Try lenghtForShape() to check that in advance

Definition at line 279 of file MappedImage.h.


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