opensurgsim
ImageMap.h
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2016, SimQuest Solutions Inc.
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 #ifndef SURGSIM_DATASTRUCTURES_IMAGEMAP_H
17 #define SURGSIM_DATASTRUCTURES_IMAGEMAP_H
18 
19 #include "SurgSim/DataStructures/ImageBase.h"
20 
21 
22 namespace SurgSim
23 {
24 namespace DataStructures
25 {
26 
30 template<class T>
31 class ImageMap : public ImageBase<T>
32 {
33 public:
39  ImageMap(size_t width, size_t height, size_t channels, T* data);
40 
41  T* const getData() override;
42 
43  const T* const getData() const override;
44 
45 private:
46  T* m_data;
47 };
48 
49 };
50 };
51 
52 #include "SurgSim/DataStructures/ImageMap-inl.h"
53 
54 #endif //SURGSIM_DATASTRUCTURES_IMAGEMAP_H
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
A class that behaves like an Image but maps an existing array of data.
Definition: ImageMap.h:31
T *const getData() override
Get the pointer to the data.
Definition: ImageMap-inl.h:33
Base class for Image-like classes.
Definition: ImageBase.h:32
ImageMap(size_t width, size_t height, size_t channels, T *data)
Constructor.
Definition: ImageMap-inl.h:26