|
|
|
@ -1,5 +1,5 @@ |
|
|
|
#ifndef Magnum_ImageWrapper_h |
|
|
|
#ifndef Magnum_ImageReference_h |
|
|
|
#define Magnum_ImageWrapper_h |
|
|
|
#define Magnum_ImageReference_h |
|
|
|
/*
|
|
|
|
/*
|
|
|
|
This file is part of Magnum. |
|
|
|
This file is part of Magnum. |
|
|
|
|
|
|
|
|
|
|
|
@ -25,7 +25,7 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
/** @file
|
|
|
|
/** @file
|
|
|
|
* @brief Class Magnum::ImageWrapper |
|
|
|
* @brief Class Magnum::ImageReference |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
#include "Math/Vector3.h" |
|
|
|
#include "Math/Vector3.h" |
|
|
|
@ -35,7 +35,7 @@ |
|
|
|
namespace Magnum { |
|
|
|
namespace Magnum { |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@brief %Image wrapper |
|
|
|
@brief %Image reference |
|
|
|
|
|
|
|
|
|
|
|
Adds information about dimensions, color components and component type to some |
|
|
|
Adds information about dimensions, color components and component type to some |
|
|
|
data in memory. |
|
|
|
data in memory. |
|
|
|
@ -47,9 +47,9 @@ same properties for each frame, such as video stream. Thus it is not possible |
|
|
|
to change image properties, only data pointer. |
|
|
|
to change image properties, only data pointer. |
|
|
|
|
|
|
|
|
|
|
|
Interchangeable with Image, BufferImage or Trade::ImageData. |
|
|
|
Interchangeable with Image, BufferImage or Trade::ImageData. |
|
|
|
@see ImageWrapper1D, ImageWrapper2D, ImageWrapper3D |
|
|
|
@see ImageReference1D, ImageReference2D, ImageReference3D |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
template<UnsignedInt dimensions> class ImageWrapper: public AbstractImage { |
|
|
|
template<UnsignedInt dimensions> class ImageReference: public AbstractImage { |
|
|
|
public: |
|
|
|
public: |
|
|
|
const static UnsignedInt Dimensions = dimensions; /**< @brief %Image dimension count */ |
|
|
|
const static UnsignedInt Dimensions = dimensions; /**< @brief %Image dimension count */ |
|
|
|
|
|
|
|
|
|
|
|
@ -63,7 +63,7 @@ template<UnsignedInt dimensions> class ImageWrapper: public AbstractImage { |
|
|
|
* Note that the image data are not copied on construction, but they |
|
|
|
* Note that the image data are not copied on construction, but they |
|
|
|
* are deleted on class destruction. |
|
|
|
* are deleted on class destruction. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
constexpr explicit ImageWrapper(const typename DimensionTraits<Dimensions, Int>::VectorType& size, ImageFormat format, ImageType type, void* data): AbstractImage(format, type), _size(size), _data(reinterpret_cast<unsigned char*>(data)) {} |
|
|
|
constexpr explicit ImageReference(const typename DimensionTraits<Dimensions, Int>::VectorType& size, ImageFormat format, ImageType type, void* data): AbstractImage(format, type), _size(size), _data(reinterpret_cast<unsigned char*>(data)) {} |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @brief Constructor |
|
|
|
* @brief Constructor |
|
|
|
@ -74,7 +74,7 @@ template<UnsignedInt dimensions> class ImageWrapper: public AbstractImage { |
|
|
|
* Data pointer is set to zero, call setData() to fill the image with |
|
|
|
* Data pointer is set to zero, call setData() to fill the image with |
|
|
|
* data. |
|
|
|
* data. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
constexpr explicit ImageWrapper(const typename DimensionTraits<Dimensions, Int>::VectorType& size, ImageFormat format, ImageType type): AbstractImage(format, type), _size(size), _data(nullptr) {} |
|
|
|
constexpr explicit ImageReference(const typename DimensionTraits<Dimensions, Int>::VectorType& size, ImageFormat format, ImageType type): AbstractImage(format, type), _size(size), _data(nullptr) {} |
|
|
|
|
|
|
|
|
|
|
|
/** @brief %Image size */ |
|
|
|
/** @brief %Image size */ |
|
|
|
constexpr typename DimensionTraits<Dimensions, Int>::VectorType size() const { return _size; } |
|
|
|
constexpr typename DimensionTraits<Dimensions, Int>::VectorType size() const { return _size; } |
|
|
|
@ -101,13 +101,13 @@ template<UnsignedInt dimensions> class ImageWrapper: public AbstractImage { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
/** @brief One-dimensional image wrapper */ |
|
|
|
/** @brief One-dimensional image wrapper */ |
|
|
|
typedef ImageWrapper<1> ImageWrapper1D; |
|
|
|
typedef ImageReference<1> ImageReference1D; |
|
|
|
|
|
|
|
|
|
|
|
/** @brief Two-dimensional image wrapper */ |
|
|
|
/** @brief Two-dimensional image wrapper */ |
|
|
|
typedef ImageWrapper<2> ImageWrapper2D; |
|
|
|
typedef ImageReference<2> ImageReference2D; |
|
|
|
|
|
|
|
|
|
|
|
/** @brief Three-dimensional image wrapper */ |
|
|
|
/** @brief Three-dimensional image wrapper */ |
|
|
|
typedef ImageWrapper<3> ImageWrapper3D; |
|
|
|
typedef ImageReference<3> ImageReference3D; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|