17 #ifndef GZ_RENDERING_BASE_BASESEGMENTATIONCAMERA_HH_
18 #define GZ_RENDERING_BASE_BASESEGMENTATIONCAMERA_HH_
22 #include <gz/common/Event.hh>
31 inline namespace GZ_RENDERING_VERSION_NAMESPACE {
46 public:
virtual void CreateSegmentationTexture()
override = 0;
49 public:
virtual uint8_t *SegmentationData()
const override;
53 ConnectNewSegmentationFrame(
54 std::function<
void(
const uint8_t *,
unsigned int,
unsigned int,
55 unsigned int,
const std::string &)> _subscriber)
override;
58 public:
virtual void SetSegmentationType(
65 public:
virtual void EnableColoredMap(
bool _enable)
override;
68 public:
virtual bool IsColoredMap()
const override;
71 public:
virtual void SetBackgroundColor(
75 public:
virtual void SetBackgroundLabel(
int _label)
override;
78 public:
virtual const math::Color &BackgroundColor()
const override;
81 public:
virtual int BackgroundLabel()
const override;
84 public:
void LabelMapFromColoredBuffer(
85 uint8_t *_labelBuffer)
const override = 0;
88 protected: uint8_t *segmentationData {
nullptr};
95 protected:
bool isColoredMap {
false};
102 protected:
int backgroundLabel {0};
115 if (this->segmentationData)
117 delete [] this->segmentationData;
118 this->segmentationData =
nullptr;
126 return this->segmentationData;
133 std::function<
void(
const uint8_t *,
unsigned int,
unsigned int,
150 this->isColoredMap = _enable;
164 return this->isColoredMap;
172 this->backgroundColor = _color;
179 this->backgroundLabel = _label;
186 return this->backgroundColor;
193 return this->backgroundLabel;