Fawkes API
Fawkes Development Version
|
Rectification info block. More...
#include <>>
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... | |
![]() | |
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... | |
![]() | |
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 | |
![]() | |
void | set_spec_header (void *spec_header, size_t spec_header_size) |
Set content-specific header. More... | |
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.
Definition at line 36 of file rectinfo_block.h.
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.
block_type | type of the block as defined per rectinfo_block_type_t |
camera | camera identifier |
block_data_size | size 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.
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.
block | FireVision data file block |
Definition at line 99 of file rectinfo_block.cpp.
References _block_header, and firevision::FireVisionDataFileBlock::_spec_header.
|
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.
uint8_t firevision::RectificationInfoBlock::camera | ( | ) | const |
Get block camera identifier.
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().
|
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.
x | X pixel coordinate to get mapping for |
y | Y pixel coordinate to get mapping for |
to_x | Upon return contains the X pixel coordinate of the unrectified image |
to_y | Upon return contains the Y pixel coordinate of the unrectified image |
Implemented in firevision::RectificationLutInfoBlock.
Referenced by firevision::FilterRectify::apply().
|
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().