8#ifndef META_OCEAN_TRACKING_SLAM_FRAME_PYRAMID_MANAGER_H
9#define META_OCEAN_TRACKING_SLAM_FRAME_PYRAMID_MANAGER_H
107 inline operator bool()
const;
244 inline size_t size()
const;
255 static unsigned int idealPyramidLayers(
const unsigned int width,
const unsigned int height,
const unsigned int patchSize,
const float maximalTrackingDistance,
const unsigned int coarseLayerRadius);
281 *
this = std::move(scopedPyramid);
322inline FramePyramidManager::ScopedPyramid::operator bool()
const
This class implements a frame pyramid.
Definition FramePyramid.h:46
This class implements Ocean's image class.
Definition Frame.h:1969
This class implements a recursive lock object.
Definition Lock.h:31
This class implements a scoped lock object for recursive lock objects.
Definition Lock.h:147
This class implements a static vector that has a fixed capacity.
Definition StaticVector.h:25
This class implements a pyramid object with usage counter.
Definition FramePyramidManager.h:181
unsigned int usageCounter_
The usage counter.
Definition FramePyramidManager.h:188
CV::FramePyramid framePyramid_
The actual frame pyramid.
Definition FramePyramidManager.h:191
Index32 frameIndex_
The frame index, -1 if unused.
Definition FramePyramidManager.h:185
This class implements a scoped pyramid object providing automatic lifetime management.
Definition FramePyramidManager.h:41
ScopedPyramid(const ScopedPyramid &scopedPyramid)=delete
Disabled copy constructor.
const CV::FramePyramid & pyramid() const
Returns a const reference to the pyramid.
Definition FramePyramidManager.h:294
FramePyramidManager * owner_
The owner manager.
Definition FramePyramidManager.h:166
void release()
Explicitly releases the pyramid before the scoped object is destroyed.
Index32 frameIndex_
The frame index.
Definition FramePyramidManager.h:172
const Frame & finestLayer() const
Returns the finest layer of the pyramid.
Definition FramePyramidManager.h:300
bool isValid() const
Returns whether this scoped pyramid is valid.
Definition FramePyramidManager.h:317
ScopedPyramid()=default
Creates an invalid scoped pyramid object.
const CV::FramePyramid & operator*() const
Returns a const reference to the pyramid.
Definition FramePyramidManager.h:327
~ScopedPyramid()
Destructs the scoped pyramid and releases the pyramid.
Definition FramePyramidManager.h:284
const CV::FramePyramid * operator->() const
Returns a const pointer to the pyramid.
Definition FramePyramidManager.h:339
CV::FramePyramid * pyramid_
The pyramid object.
Definition FramePyramidManager.h:169
ScopedPyramid & operator=(const ScopedPyramid &scopedPyramid)=delete
Disabled copy assignment operator.
Index32 frameIndex() const
Returns the frame index of this pyramid.
Definition FramePyramidManager.h:289
friend class FramePyramidManager
Definition FramePyramidManager.h:42
ScopedPyramid & operator=(ScopedPyramid &&scopedPyramid) noexcept
Move assignment operator.
Objects freeObjects_
The vector of free pyramid objects.
Definition FramePyramidManager.h:266
Lock lock_
The lock object.
Definition FramePyramidManager.h:269
FramePyramidManager()=default
Creates a new manager object.
Index32 latestFrameIndex_
The frame index of the latest pyramid, -1 if invalid.
Definition FramePyramidManager.h:260
std::shared_ptr< Object > SharedObject
Definition of a shared pointer to an object.
Definition FramePyramidManager.h:195
StaticVector< SharedObject, 8 > Objects
Definition of a static vector holding object pointers.
Definition FramePyramidManager.h:198
size_t size() const
Returns the number of currently used pyramids.
Definition FramePyramidManager.h:272
Objects usedObjects_
The vector of used pyramid objects.
Definition FramePyramidManager.h:263
static unsigned int idealPyramidLayers(const unsigned int width, const unsigned int height, const unsigned int patchSize, const float maximalTrackingDistance, const unsigned int coarseLayerRadius)
Determines the ideal number of pyramid layers for given parameters.
ScopedPyramid newPyramid(const Index32 frameIndex)
Creates a new pyramid for a given frame index.
ScopedPyramid existingPyramid(const Index32 frameIndex)
Returns an existing pyramid for a given frame index.
void unlockPyramid(const Index32 frameIndex)
Unlocks a pyramid for a given frame index.
ScopedPyramid latestPyramid()
Returns the latest pyramid.
void updateLatest(const Index32 frameIndex)
Updates the latest pyramid to a given frame index.
uint32_t Index32
Definition of a 32 bit index value.
Definition Base.h:84
Namespace of the SLAM Tracking library.
Definition BackgroundTask.h:24
Namespace of the Tracker library.
The namespace covering the entire Ocean framework.
Definition Accessor.h:15