#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 stimulusBufferSpot=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.stimulusBufferSpot &&
			offset < (rangeDescriptor.stimulusBufferSpot
				+ 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
