|
|
|
|
@ -62,7 +62,7 @@ template<UnsignedInt dimensions> class ImageWrapper: public AbstractImage {
|
|
|
|
|
* Note that the image data are not copied on construction, but they |
|
|
|
|
* are deleted on class destruction. |
|
|
|
|
*/ |
|
|
|
|
inline explicit ImageWrapper(const typename DimensionTraits<Dimensions, Int>::VectorType& size, Format format, Type type, GLvoid* data): AbstractImage(format, type), _size(size), _data(reinterpret_cast<char*>(data)) {} |
|
|
|
|
inline explicit ImageWrapper(const typename DimensionTraits<Dimensions, Int>::VectorType& size, Format format, Type type, GLvoid* data): AbstractImage(format, type), _size(size), _data(reinterpret_cast<unsigned char*>(data)) {} |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Constructor |
|
|
|
|
@ -79,8 +79,8 @@ template<UnsignedInt dimensions> class ImageWrapper: public AbstractImage {
|
|
|
|
|
inline typename DimensionTraits<Dimensions, Int>::VectorType size() const { return _size; } |
|
|
|
|
|
|
|
|
|
/** @brief Pointer to raw data */ |
|
|
|
|
inline void* data() { return _data; } |
|
|
|
|
inline const void* data() const { return _data; } /**< @overload */ |
|
|
|
|
inline unsigned char* data() { return _data; } |
|
|
|
|
inline const unsigned char* data() const { return _data; } /**< @overload */ |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Set image data |
|
|
|
|
@ -91,12 +91,12 @@ template<UnsignedInt dimensions> class ImageWrapper: public AbstractImage {
|
|
|
|
|
* destruction. |
|
|
|
|
*/ |
|
|
|
|
inline void setData(GLvoid* data) { |
|
|
|
|
_data = reinterpret_cast<char*>(data); |
|
|
|
|
_data = reinterpret_cast<unsigned char*>(data); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
Math::Vector<Dimensions, Int> _size; |
|
|
|
|
char* _data; |
|
|
|
|
unsigned char* _data; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** @brief One-dimensional image wrapper */ |
|
|
|
|
|