Image.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 2013-2016, SimQuest Solutions Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SURGSIM_DATASTRUCTURES_IMAGE_H
#define SURGSIM_DATASTRUCTURES_IMAGE_H
#include <memory>
#include "SurgSim/DataStructures/ImageBase.h"
namespace SurgSim
{
namespace DataStructures
{
template<class T>
class Image : public ImageBase<T>
{
public:
Image();
Image(size_t width, size_t height, size_t channels);
Image(size_t width, size_t height, size_t channels, const T* const data);
template<class D>
Image(size_t width, size_t height, size_t channels, const D* const data);
Image(const Image<T>& other);
Image(Image<T>&& other);
virtual ~Image();
Image<T>& operator=(const Image<T>& other);
Image<T>& operator=(Image<T>&& other);
T* const getData() override;
const T* const getData() const override;
private:
std::unique_ptr<T[]> m_data;
};
}
}
#include "SurgSim/DataStructures/Image-inl.h"
#endif //SURGSIM_DATASTRUCTURES_IMAGE_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::DataStructures::Image::m_data
std::unique_ptr< T[]> m_data
Definition: Image.h:87
SurgSim::DataStructures::Image
A templated Image class.
Definition: Image.h:33
SurgSim::DataStructures::Image::operator=
Image< T > & operator=(const Image< T > &other)
Assignment Operator.
Definition: Image-inl.h:74
SurgSim::DataStructures::Image::Image
Image()
Default Constructor.
Definition: Image-inl.h:26
SurgSim::DataStructures::Image::getData
T *const getData() override
Get the pointer to the data.
Definition: Image-inl.h:109
SurgSim::DataStructures::ImageBase
Base class for Image-like classes.
Definition: ImageBase.h:32
SurgSim::DataStructures::Image::~Image
virtual ~Image()
Destructor.
Definition: Image-inl.h:104
Image-inl.h
ImageBase.h