Ignition Rendering

API Reference

7.0.0~pre1
OgreThermalCamera.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 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 IGNITION_RENDERING_OGRE_OGRETHERMALCAMERA_HH_
19 #define IGNITION_RENDERING_OGRE_OGRETHERMALCAMERA_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 
32 #include "ignition/rendering/ogre/Export.hh"
40 
41 #include "ignition/common/Event.hh"
43 
44 
45 namespace Ogre
46 {
47  class Material;
48  class Camera;
49 }
50 
51 namespace ignition
52 {
53  namespace rendering
54  {
55  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
56  //
57  // forward declaration
58  class OgreThermalCameraPrivate;
59 
63  class IGNITION_RENDERING_OGRE_VISIBLE OgreThermalCamera :
65  public virtual BaseThermalCamera<OgreSensor>,
66  public virtual OgreObjectInterface
67  {
69  protected: OgreThermalCamera();
70 
72  public: virtual ~OgreThermalCamera();
73 
75  public: virtual void Init() override;
76 
78  public: virtual void CreateRenderTexture();
79 
81  public: virtual void PostRender() override;
82 
86  public: virtual ignition::common::ConnectionPtr ConnectNewThermalFrame(
87  std::function<void(const uint16_t *, unsigned int, unsigned int,
88  unsigned int, const std::string &)> _subscriber) override;
89 
90  // Documentation inherited.
91  public: virtual void PreRender() override;
92 
94  public: virtual void Render() override;
95 
96  // Documentation inherited
97  public: virtual void Destroy() override;
98 
99  // Documentation inherited.
100  public: virtual Ogre::Camera *Camera() const override;
101 
104  protected: virtual RenderTargetPtr RenderTarget() const override;
105 
107  protected: void CreateCamera();
108 
110  private: void CreateThermalTexture();
111 
113  protected: Ogre::Camera *ogreCamera = nullptr;
114 
118 
119  private: friend class OgreScene;
120  };
121  }
122  }
123 }
124 #endif
shared_ptr< RenderTarget > RenderTargetPtr
Shared pointer to RenderTarget.
Definition: RenderTypes.hh:230
STL class.
Definition: OgreCamera.hh:28
Definition: OgreScene.hh:39