opensurgsim
Image.h
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013-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_IMAGE_H
17 #define SURGSIM_DATASTRUCTURES_IMAGE_H
18 
19 #include <memory>
20 
21 #include "SurgSim/DataStructures/ImageBase.h"
22 
23 
24 namespace SurgSim
25 {
26 namespace DataStructures
27 {
28 
32 template<class T>
33 class Image : public ImageBase<T>
34 {
35 public:
37  Image();
38 
43  Image(size_t width, size_t height, size_t channels);
44 
50  Image(size_t width, size_t height, size_t channels, const T* const data);
51 
58  template<class D>
59  Image(size_t width, size_t height, size_t channels, const D* const data);
60 
63  Image(const Image<T>& other);
64 
67  Image(Image<T>&& other);
68 
70  virtual ~Image();
71 
75  Image<T>& operator=(const Image<T>& other);
76 
80  Image<T>& operator=(Image<T>&& other);
81 
82  T* const getData() override;
83 
84  const T* const getData() const override;
85 
86 private:
87  std::unique_ptr<T[]> m_data;
88 };
89 
90 }
91 }
92 
93 #include "SurgSim/DataStructures/Image-inl.h"
94 
95 #endif //SURGSIM_DATASTRUCTURES_IMAGE_H
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
A templated Image class.
Definition: Image.h:33
Image< T > & operator=(const Image< T > &other)
Assignment Operator.
Definition: Image-inl.h:74
Image()
Default Constructor.
Definition: Image-inl.h:26
T *const getData() override
Get the pointer to the data.
Definition: Image-inl.h:109
Base class for Image-like classes.
Definition: ImageBase.h:32
virtual ~Image()
Destructor.
Definition: Image-inl.h:104