Ignition Rendering

API Reference

0.1.0
Camera.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 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 #ifndef IGNITION_RENDERING_CAMERA_HH_
18 #define IGNITION_RENDERING_CAMERA_HH_
19 
20 #include <string>
21 
22 #include <ignition/common/Event.hh>
23 #include <ignition/math/Matrix4.hh>
24 
28 
29 namespace ignition
30 {
31  namespace rendering
32  {
35  class IGNITION_RENDERING_VISIBLE Camera :
36  public virtual Sensor
37  {
39  public: typedef std::function<void(const void*, unsigned int,
40  unsigned int, unsigned int, const std::string&)> NewFrameListener;
41 
43  public: virtual ~Camera() { }
44 
47  public: virtual unsigned int ImageWidth() const = 0;
48 
51  public: virtual void SetImageWidth(unsigned int _width) = 0;
52 
55  public: virtual unsigned int ImageHeight() const = 0;
56 
59  public: virtual void SetImageHeight(unsigned int _height) = 0;
60 
64  public: virtual PixelFormat ImageFormat() const = 0;
65 
68  public: virtual void SetImageFormat(PixelFormat _format) = 0;
69 
72  public: virtual unsigned int ImageMemorySize() const = 0;
73 
76  public: virtual math::Angle HFOV() const = 0;
77 
80  public: virtual void SetHFOV(const math::Angle &_angle) = 0;
81 
84  public: virtual double AspectRatio() const = 0;
85 
90  public: virtual void SetAspectRatio(const double _ratio) = 0;
91 
92  // TODO: add auto-aspect ratio
93 
96  public: virtual unsigned int AntiAliasing() const = 0;
97 
103  public: virtual void SetAntiAliasing(const unsigned int _aa) = 0;
104 
107  public: virtual double FarClipPlane() const = 0;
108 
111  public: virtual void SetFarClipPlane(const double _far) = 0;
112 
115  public: virtual double NearClipPlane() const = 0;
116 
119  public: virtual void SetNearClipPlane(const double _near) = 0;
120 
124  public: virtual void Render() = 0;
125 
130  public: virtual void PostRender() = 0;
131 
137  public: virtual void Update() = 0;
138 
144  public: virtual Image CreateImage() const = 0;
145 
152  public: virtual void Capture(Image &_image) = 0;
153 
159  public: virtual void Copy(Image &_image) const = 0;
160 
166  public: virtual bool SaveFrame(const std::string &_name) = 0;
167 
170  public: virtual common::ConnectionPtr ConnectNewImageFrame(
171  NewFrameListener _listener) = 0;
172 
175  public: virtual RenderWindowPtr CreateRenderWindow() = 0;
176 
179  public: virtual math::Matrix4d ProjectionMatrix() const = 0;
180 
183  public: virtual math::Matrix4d ViewMatrix() const = 0;
184 
197  public: virtual void SetTrackTarget(const NodePtr &_target,
198  const math::Vector3d &_offset = math::Vector3d::Zero,
199  const bool _worldFrame = false) = 0;
200 
203  public: virtual NodePtr TrackTarget() const = 0;
204 
209  public: virtual void SetTrackOffset(const math::Vector3d &_offset) = 0;
210 
214  public: virtual math::Vector3d TrackOffset() const = 0;
215 
219  public: virtual void SetTrackPGain(const double _pGain) = 0;
220 
223  public: virtual double TrackPGain() const = 0;
224 
236  public: virtual void SetFollowTarget(const NodePtr &_target,
237  const math::Vector3d &_offset = math::Vector3d::Zero,
238  const bool _worldFrame = false) = 0;
239 
242  public: virtual NodePtr FollowTarget() const = 0;
243 
248  public: virtual void SetFollowOffset(const math::Vector3d &_offset) = 0;
249 
253  public: virtual math::Vector3d FollowOffset() const = 0;
254 
258  public: virtual void SetFollowPGain(const double _pGain) = 0;
259 
262  public: virtual double FollowPGain() const = 0;
263  };
264  }
265 }
266 #endif
Represents a scene sensor. The most obvious example is a camera, but it can be anything that generate...
Definition: Sensor.hh:29
STL class.
Encapsulates a raw image buffer and relevant properties.
Definition: Image.hh:30
std::function< void(const void *, unsigned int, unsigned int, unsigned int, const std::string &)> NewFrameListener
Callback function for new frame render event listeners.
Definition: Camera.hh:40
PixelFormat
Definition: PixelFormat.hh:29
virtual ~Camera()
Deconstructor.
Definition: Camera.hh:43
Posable camera used for rendering the scene graph.
Definition: Camera.hh:35
Definition: ArrowVisual.hh:22