ChimeraTK-DeviceAccess  03.18.00
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. More...
 
size_t lengthForShape (unsigned width, unsigned height, ImgFormat fmt)
 
unsigned char * imgBody ()
 returns pointer to image payload data More...
 
template<typename UserType , ImgOptions OPTIONS = ImgOptions::RowMajor>
ImgView< UserType, OPTIONS > interpretedView ()
 returns an ImgView object which can be used like a matrix. More...
 
- 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. More...
 
unsigned char * data ()
 returns pointer to data for header and struct content. More...
 
size_t capacity () const
 capacity of used container More...
 
size_t size () const
 currently used size More...
 
ImgHeaderheader ()
 returns header, e.g. for setting meta data More...
 
void initData ()
 default initialize header and zero out data that follows More...
 

Protected Member Functions

void formatsDefinition (ImgFormat fmt, unsigned &channels, unsigned &bytesPerPixel)
 

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

◆ formatsDefinition()

void ChimeraTK::MappedImage::formatsDefinition ( ImgFormat  fmt,
unsigned &  channels,
unsigned &  bytesPerPixel 
)
inlineprotected

Definition at line 215 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.

+ Here is the call graph for this function:

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lengthForShape()

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

Definition at line 253 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 260 of file MappedImage.h.

+ Here is the caller graph for this function:

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