Browse Source

Allow creating ImageView with nullptr data.

pull/107/head
Vladimír Vondruš 11 years ago
parent
commit
e0b5d05b9f
  1. 2
      src/Magnum/ImageView.h

2
src/Magnum/ImageView.h

@ -71,7 +71,7 @@ template<UnsignedInt dimensions> class ImageView {
* parameters.
*/
explicit ImageView(PixelStorage storage, PixelFormat format, PixelType type, const VectorTypeFor<dimensions, Int>& size, Containers::ArrayView<const void> data) noexcept: _storage{storage}, _format{format}, _type{type}, _size{size}, _data{reinterpret_cast<const char*>(data.data()), data.size()} {
CORRADE_ASSERT(Implementation::imageDataSize(*this) <= _data.size(), "ImageView::ImageView(): bad image data size, got" << _data.size() << "but expected at least" << Implementation::imageDataSize(*this), );
CORRADE_ASSERT(!_data || Implementation::imageDataSize(*this) <= _data.size(), "ImageView::ImageView(): bad image data size, got" << _data.size() << "but expected at least" << Implementation::imageDataSize(*this), );
}
/** @overload

Loading…
Cancel
Save