0116523a66
We directly use an instance of RangeDescriptor to avoid incurring the memory cost of using a StagingBuffer here. It's unnecessary since these stencils will always be 32bits large.
63 lines
1.3 KiB
C++
63 lines
1.3 KiB
C++
#ifndef _LG1_PCLOUD_AMBIENCE_STENCIL_H
|
|
#define _LG1_PCLOUD_AMBIENCE_STENCIL_H
|
|
|
|
#include "livoxGen1.h"
|
|
#include <user/pcloudAmbienceStencil.h>
|
|
#include <user/stencil.h>
|
|
|
|
namespace smo {
|
|
namespace stim_buff {
|
|
|
|
/**
|
|
* LG1PcloudAmbienceStencil represents Livox Gen1-specific stencils for
|
|
* ambience data. It holds a single RangeDescriptor with bodySpot=0 and
|
|
* nContiguousSpots=1.
|
|
*/
|
|
class LG1PcloudAmbienceStencil
|
|
: public PcloudAmbienceStencil
|
|
{
|
|
public:
|
|
explicit LG1PcloudAmbienceStencil()
|
|
: PcloudAmbienceStencil(),
|
|
rangeDescriptor{0, 1}
|
|
{}
|
|
|
|
~LG1PcloudAmbienceStencil() = default;
|
|
|
|
// Implement pure virtual functions from Stencil
|
|
bool hasData() const override
|
|
{
|
|
return true;
|
|
}
|
|
|
|
size_t getRelevantCount() const override
|
|
{
|
|
return rangeDescriptor.nContiguousSpots;
|
|
}
|
|
|
|
bool isRelevant(size_t offset) const override
|
|
{
|
|
return (offset >= rangeDescriptor.bodySpot &&
|
|
offset < rangeDescriptor.bodySpot + rangeDescriptor.nContiguousSpots);
|
|
}
|
|
|
|
size_t getNRangeDescriptors() const override
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
bool buildStencilMetadata() override
|
|
{
|
|
// Metadata is already built (single fixed descriptor)
|
|
return true;
|
|
}
|
|
|
|
public:
|
|
smo::cologex::Stencil::RangeDescriptor rangeDescriptor;
|
|
};
|
|
|
|
} // namespace stim_buff
|
|
} // namespace smo
|
|
|
|
#endif // _LG1_PCLOUD_AMBIENCE_STENCIL_H
|