ImageHeightmap.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 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/util/system.hh"
28 
29 namespace gazebo
30 {
31  namespace common
32  {
35 
38  class GZ_COMMON_VISIBLE ImageHeightmap
40  {
43  public: ImageHeightmap();
44 
48  public: int Load(const std::string &_filename="");
49 
50  // Documentation inherited.
51  public: void FillHeightMap(int _subSampling, unsigned int _vertSize,
52  const ignition::math::Vector3d &_size,
53  const ignition::math::Vector3d &_scale, bool _flipY,
54  std::vector<float> &_heights);
55 
58  public: std::string GetFilename() const;
59 
60  // Documentation inherited.
61  public: unsigned int GetHeight() const;
62 
63  // Documentation inherited.
64  public: unsigned int GetWidth() const;
65 
66  // Documentation inherited.
67  public: float GetMaxElevation() const;
68 
70  private: gazebo::common::Image img;
71  };
73  }
74 }
75 #endif
Encapsulates a generic heightmap data file.
Definition: HeightmapData.hh:39
Encapsulates an image that will be interpreted as a heightmap.
Definition: ImageHeightmap.hh:38
Encapsulates an image.
Definition: Image.hh:75