Pixel storage support, part 6: accepting only sized data arrays in images.
Makes it far easier to detect pixel storage misconfigurations and
improperly sized data arrays. Data owning classes (Image,
Trade::ImageData) accept Containers::Array<char> while wrappers
(ImageView, BufferImage) accept Containers::ArrayView<const void>.
ImageView reinterprets the passed array as const char to enable pointer
arithmetic on the data.
The old way (constructor/setData() call accepting void*) is now marked as
deprecated and will be removed in some future release. Because decay of
fixed-size arrays to void* is preferred to calling Containers::ArrayView
constructor, there are two more overloads to have proper handling of
const T(&)[n] and std::nullptr_t arguments.
Currently the TgaImporter and TgaImageConverter fail on images with row
length not aligned to 4, will fix that in followup commits.
CORRADE_ASSERT(Implementation::imageDataSize(*this)<=data.size(),"BufferImage::BufferImage(): bad image data size, got"<<data.size()<<"but expected at least"<<Implementation::imageDataSize(*this),);
CORRADE_ASSERT(Implementation::imageDataSize(*this)<=data.size(),"BufferImage::setData(): bad image data size, got"<<data.size()<<"but expected at least"<<Implementation::imageDataSize(*this),);
CORRADE_ASSERT(Implementation::imageDataSize(*this)<=_data.size(),"Image::Image(): bad image data size, got"<<_data.size()<<"but expected at least"<<Implementation::imageDataSize(*this),);
CORRADE_ASSERT(Implementation::imageDataSize(*this)<=data.size(),"Image::setData(): bad image data size, got"<<data.size()<<"but expected at least"<<Implementation::imageDataSize(*this),);
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(Implementation::imageDataSize(*this)<=data.size(),"ImageView::setData(): bad image data size, got"<<data.size()<<"but expected at least"<<Implementation::imageDataSize(*this),);
CORRADE_ASSERT(Implementation::imageDataSize(*this)<=_data.size(),"Trade::ImageDat::ImageData(): bad image data size, got"<<_data.size()<<"but expected at least"<<Implementation::imageDataSize(*this),);