ImageHeightmap.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2016 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 _GAZEBO_IMAGE_HEIGHTMAP_DATA_HH_
19 #define _GAZEBO_IMAGE_HEIGHTMAP_DATA_HH_
20 
21 #include <string>
22 #include <vector>
23 #include <ignition/math/Vector3.hh>
24 
26 #include "gazebo/common/Image.hh"
27 #include "gazebo/math/Vector3.hh"
28 #include "gazebo/util/system.hh"
29 
30 namespace gazebo
31 {
32  namespace common
33  {
36 
39  class GZ_COMMON_VISIBLE ImageHeightmap
41  {
44  public: ImageHeightmap();
45 
49  public: int Load(const std::string &_filename="");
50 
51  // Documentation inherited.
52  public: void FillHeightMap(int _subSampling, unsigned int _vertSize,
53  const math::Vector3 &_size, const math::Vector3 &_scale, bool _flipY,
54  std::vector<float> &_heights);
55 
56  // Documentation inherited.
57  public: void FillHeightMap(int _subSampling, unsigned int _vertSize,
58  const ignition::math::Vector3d &_size,
59  const ignition::math::Vector3d &_scale, bool _flipY,
60  std::vector<float> &_heights);
61 
64  public: std::string GetFilename() const;
65 
66  // Documentation inherited.
67  public: unsigned int GetHeight() const;
68 
69  // Documentation inherited.
70  public: unsigned int GetWidth() const;
71 
72  // Documentation inherited.
73  public: float GetMaxElevation() const;
74 
76  private: gazebo::common::Image img;
77  };
79  }
80 }
81 #endif
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
Encapsulates a generic heightmap data file.
Definition: HeightmapData.hh:37
Encapsulates an image that will be interpreted as a heightmap.
Definition: ImageHeightmap.hh:39
Encapsulates an image.
Definition: Image.hh:74