Gazebo Rendering
API Reference
8.2.1
insert_drive_file
Tutorials
library_books
Classes
toc
Namespaces
insert_drive_file
Files
launch
Gazebo Website
Index
List
Hierarchy
Members: All
Members: Functions
Members: Variables
Members: Typedefs
Members: Enumerations
Members: Enumerator
List
Members
Functions
Typedefs
Variables
Enumerations
Enumerator
src
gz-rendering
ogre2
include
gz
rendering
ogre2
Ogre2SegmentationCamera.hh
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2021 Open Source Robotics Foundation
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*
16
*/
17
18
#ifndef GZ_RENDERING_OGRE2_OGRE2SEGMENTATIONCAMERA_HH_
19
#define GZ_RENDERING_OGRE2_OGRE2SEGMENTATIONCAMERA_HH_
20
21
#ifdef _WIN32
22
// Ensure that Winsock2.h is included before Windows.h, which can get
23
// pulled in by anybody (e.g., Boost).
24
#include <Winsock2.h>
25
#endif
26
27
#include <memory>
28
#include <string>
29
30
#include <gz/common/Console.hh>
31
#include <gz/common/Event.hh>
32
33
#include "
gz/rendering/base/BaseSegmentationCamera.hh
"
34
#include "
gz/rendering/ogre2/Ogre2Includes.hh
"
35
#include "
gz/rendering/ogre2/Ogre2ObjectInterface.hh
"
36
#include "
gz/rendering/ogre2/Ogre2Sensor.hh
"
37
38
namespace
gz
39
{
40
namespace
rendering
41
{
42
inline
namespace
GZ_RENDERING_VERSION_NAMESPACE {
43
//
44
// Forward declaration
45
class
Ogre2SegmentationCameraPrivate;
46
49
class
GZ_RENDERING_OGRE2_VISIBLE
Ogre2SegmentationCamera
:
50
public
virtual
BaseSegmentationCamera
<Ogre2Sensor>,
51
public
virtual
Ogre2ObjectInterface
52
{
54
protected
:
Ogre2SegmentationCamera
();
55
57
public
:
virtual
~Ogre2SegmentationCamera
();
58
59
// Documentation inherited
60
public
:
virtual
void
Init
()
override
;
61
62
// Documentation inherited
63
public
:
virtual
void
Destroy
()
override
;
64
65
// Documentation inherited
66
public
:
virtual
void
PreRender
()
override
;
67
68
// Documentation inherited
69
public
:
virtual
void
PostRender
()
override
;
70
71
// Documentation inherited
72
public
:
virtual
gz::common::ConnectionPtr
73
ConnectNewSegmentationFrame
(
74
std::function
<
void
(
const
uint8_t *,
unsigned
int
,
unsigned
int
,
75
unsigned
int
,
const
std::string
&)> _subscriber)
override
;
76
77
// Documentation inherited
78
public
:
virtual
void
Render
()
override
;
79
82
protected
:
virtual
RenderTargetPtr
RenderTarget
()
const override
;
83
84
// Documentation inherited
85
public
:
void
SetBackgroundLabel
(
int
_label)
override
;
86
87
// Documentation inherited
88
public
:
void
LabelMapFromColoredBuffer
(
89
uint8_t * _labelBuffer)
const override
;
90
91
// Documentation inherited.
92
public
:
virtual
Ogre::Camera *
OgreCamera
()
const override
;
93
95
protected
:
void
CreateCamera
();
96
98
protected
:
virtual
void
CreateRenderTexture
();
99
100
// Documentation inherited
101
protected
:
virtual
void
CreateSegmentationTexture
()
override
;
102
104
protected
: Ogre::Camera *ogreCamera =
nullptr
;
105
108
private
:
std::unique_ptr<Ogre2SegmentationCameraPrivate>
dataPtr;
109
111
private
:
friend
class
Ogre2Scene
;
112
};
113
}
114
}
115
}
116
#endif