diff --git a/doc/changelog.dox b/doc/changelog.dox index 76f5a0784..712da2115 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -329,6 +329,10 @@ See also: - @ref MeshIndexType was enlarged to 32 bits and can now wrap implementation-specific values similar to @ref PixelFormat, @ref CompressedPixelFormat, @ref VertexFormat and @ref MeshPrimitive +- @ref Image::size(), @ref ImageView::size() as well as + @ref Trade::ImageData::size() now return a @cpp const& @ce instead of a + value to allow creating a @relativeref{Corrade,Containers::StridedArrayView} + slice onto this member. @subsubsection changelog-latest-changes-debugtools DebugTools library diff --git a/src/Magnum/Image.h b/src/Magnum/Image.h index a60ed3fae..158a9a074 100644 --- a/src/Magnum/Image.h +++ b/src/Magnum/Image.h @@ -364,7 +364,7 @@ template class Image { UnsignedInt pixelSize() const { return _pixelSize; } /** @brief Image size in pixels */ - VectorTypeFor size() const { return _size; } + const VectorTypeFor& size() const { return _size; } /** * @brief Image data properties @@ -470,7 +470,7 @@ template class Image { PixelFormat _format; UnsignedInt _formatExtra; UnsignedInt _pixelSize; - Math::Vector _size; + VectorTypeFor _size; Containers::Array _data; }; diff --git a/src/Magnum/ImageView.h b/src/Magnum/ImageView.h index 14546b6ff..65ac7082b 100644 --- a/src/Magnum/ImageView.h +++ b/src/Magnum/ImageView.h @@ -410,7 +410,7 @@ template class ImageView { UnsignedInt pixelSize() const { return _pixelSize; } /** @brief Image size in pixels */ - constexpr VectorTypeFor size() const { return _size; } + constexpr const VectorTypeFor& size() const { return _size; } /** * @brief Image data properties @@ -484,7 +484,7 @@ template class ImageView { PixelFormat _format; UnsignedInt _formatExtra; UnsignedInt _pixelSize; - Math::Vector _size; + VectorTypeFor _size; Containers::ArrayView _data; }; diff --git a/src/Magnum/Trade/ImageData.h b/src/Magnum/Trade/ImageData.h index 1bd127bcc..f9a265fd8 100644 --- a/src/Magnum/Trade/ImageData.h +++ b/src/Magnum/Trade/ImageData.h @@ -524,7 +524,7 @@ template class ImageData { UnsignedInt pixelSize() const; /** @brief Image size in pixels */ - VectorTypeFor size() const { return _size; } + const VectorTypeFor& size() const { return _size; } /** * @brief Uncompressed image data properties @@ -693,7 +693,7 @@ template class ImageData { }; UnsignedInt _formatExtra; UnsignedInt _pixelSize; - Math::Vector _size; + VectorTypeFor _size; Containers::Array _data; const void* _importerState; };