Fawkes API  Fawkes Development Version
firevision::RectificationInfoBlock Class Referenceabstract

Rectification info block. More...

#include <>>

Inheritance diagram for firevision::RectificationInfoBlock:

Public Member Functions

 RectificationInfoBlock (uint8_t block_type, uint8_t camera, size_t block_size)
 Recommended constructor. More...
 
 RectificationInfoBlock (FireVisionDataFileBlock *block)
 Copy constructor. More...
 
virtual ~RectificationInfoBlock ()
 Destructor. More...
 
uint8_t camera () const
 Get block camera identifier. More...
 
virtual void mapping (uint16_t x, uint16_t y, uint16_t *to_x, uint16_t *to_y)=0
 Get mapping (to_x, to_y) for (x, y). More...
 
- Public Member Functions inherited from firevision::FireVisionDataFileBlock
 FireVisionDataFileBlock (unsigned int type, size_t data_size, void *spec_header, size_t spec_header_size)
 Constructor. More...
 
 FireVisionDataFileBlock (unsigned int type, size_t data_size, size_t spec_header_size)
 Constructor. More...
 
 FireVisionDataFileBlock (unsigned int type, size_t data_size)
 Constructor. More...
 
 FireVisionDataFileBlock (FireVisionDataFileBlock *block)
 Shallow copy constructor. More...
 
virtual ~FireVisionDataFileBlock ()
 Destructor. More...
 
unsigned int type () const
 Get block type. More...
 
void * block_memptr () const
 Pointer to the whole block. More...
 
size_t block_size () const
 Size of blocks. More...
 
void * data_ptr () const
 Get data pointer. More...
 
size_t data_size () const
 Size of data chunk. More...
 

Protected Attributes

rectinfo_block_header_t_block_header
 Rectification block header. More...
 
- Protected Attributes inherited from firevision::FireVisionDataFileBlock
void * _data
 Pointer to the internal data segment. More...
 
size_t _data_size
 Size of _data in bytes. More...
 
void * _spec_header
 Pointer to the content specific block header. More...
 

Additional Inherited Members

- Protected Member Functions inherited from firevision::FireVisionDataFileBlock
void set_spec_header (void *spec_header, size_t spec_header_size)
 Set content-specific header. More...
 

Detailed Description

Rectification info block.

This base class defines the basic interface to interact with rectification info blocks. It manages a small memory chunk that may later be used via other recitification information classes in an easy manner. Concrete implementations of a specific block type shall be derived from this class.

Author
Tim Niemueller

Definition at line 36 of file rectinfo_block.h.

Constructor & Destructor Documentation

◆ RectificationInfoBlock() [1/2]

firevision::RectificationInfoBlock::RectificationInfoBlock ( uint8_t  block_type,
uint8_t  camera,
size_t  block_data_size 
)

Recommended constructor.

With this constructor a chunk of memory is allocated that is sufficient to hold the internal block header and the data of the given size. Note that the size you give is only meant to hold your type specific header and data. Some extra bytes are internally added for the type agnostic block header.

Parameters
block_typetype of the block as defined per rectinfo_block_type_t
cameracamera identifier
block_data_sizesize of the data block, this means only the sum of the size of the type specific header and the data itself, NOT including the type agnostic block header.

Definition at line 78 of file rectinfo_block.cpp.

References _block_header, firevision::FireVisionDataFileBlock::_data_size, firevision::FireVisionDataFileBlock::_spec_header, camera(), and firevision::_rectinfo_block_header_t::camera.

◆ RectificationInfoBlock() [2/2]

firevision::RectificationInfoBlock::RectificationInfoBlock ( FireVisionDataFileBlock block)

Copy constructor.

Copies data from the given FireVisionDataFileBlock. It is assumed that this actually is a rectification info block, check that before calling this method.

Parameters
blockFireVision data file block

Definition at line 99 of file rectinfo_block.cpp.

References _block_header, and firevision::FireVisionDataFileBlock::_spec_header.

◆ ~RectificationInfoBlock()

firevision::RectificationInfoBlock::~RectificationInfoBlock ( )
virtual

Destructor.

Destructs the chunk, if and only if _free_block_chunk is true.

Definition at line 109 of file rectinfo_block.cpp.

References _block_header.

Member Function Documentation

◆ camera()

uint8_t firevision::RectificationInfoBlock::camera ( ) const

Get block camera identifier.

Returns
camera identifier
See also
rectinfo_block_header_t

Definition at line 120 of file rectinfo_block.cpp.

References _block_header, and firevision::_rectinfo_block_header_t::camera.

Referenced by RectificationInfoBlock(), and firevision::TriclopsStereoProcessor::verify_rectification_lut().

◆ mapping()

void firevision::RectificationInfoBlock::mapping ( uint16_t  x,
uint16_t  y,
uint16_t *  to_x,
uint16_t *  to_y 
)
pure virtual

Get mapping (to_x, to_y) for (x, y).

This can be used as a general method to access the RectificationInfoBlock mapping. For many models there may be a better (faster) way to access the mapping information. It performance matters (and it most probably will) exploit this and use the provided shortcut.

Parameters
xX pixel coordinate to get mapping for
yY pixel coordinate to get mapping for
to_xUpon return contains the X pixel coordinate of the unrectified image
to_yUpon return contains the Y pixel coordinate of the unrectified image

Implemented in firevision::RectificationLutInfoBlock.

Referenced by firevision::FilterRectify::apply().

Member Data Documentation

◆ _block_header

firevision::RectificationInfoBlock::_block_header
protected

Rectification block header.

This is a pointer to the content-specific block header for rectification info blocks.

Definition at line 48 of file rectinfo_block.h.

Referenced by camera(), RectificationInfoBlock(), and ~RectificationInfoBlock().


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