@ -72,9 +72,9 @@ describe its layout, with pixel format being one of the values from the generic
@ snippet Magnum . cpp ImageView - usage
@ snippet Magnum . cpp ImageView - usage
On construction , the image view internally calculates pixel size corresponding
On construction , the image view internally calculates pixel size corresponding
to given pixel format using @ ref pixelSize ( ) . This value is needed to check
to given pixel format using @ ref pixelFormat Size ( ) . This value is needed to
that the passed data array is large enough and is also required by most image
check that the passed data array is large enough and is also required by most
manipulation operations .
image manipulation operations .
It ' s also possible to create an empty view and assign the memory later . That is
It ' s also possible to create an empty view and assign the memory later . That is
useful for example in case of multi - buffered video streaming , where each frame
useful for example in case of multi - buffered video streaming , where each frame
@ -114,9 +114,9 @@ the @ref GL::PixelFormat and @ref GL::PixelType pair:
@ snippet Magnum . cpp ImageView - usage - gl
@ snippet Magnum . cpp ImageView - usage - gl
In such cases , pixel size is calculated using either @ cpp pixelSize ( T , U ) @ ce
In such cases , pixel size is calculated using either
or @ cpp pixelSize ( T ) @ ce that is found using
@ cpp pixelFormatSize ( T , U ) @ ce or @ cpp pixelFormatSize ( T ) @ ce that is found
[ ADL ] ( https : //en.wikipedia.org/wiki/Argument-dependent_name_lookup), with
using [ ADL ] ( https : //en.wikipedia.org/wiki/Argument-dependent_name_lookup), with
@ cpp T @ ce and @ cpp U @ ce corresponding to types of passed arguments . The
@ cpp T @ ce and @ cpp U @ ce corresponding to types of passed arguments . The
implementation - specific format is wrapped in @ ref PixelFormat using
implementation - specific format is wrapped in @ ref PixelFormat using
@ ref pixelFormatWrap ( ) and @ ref format ( ) returns the wrapped value . In order to
@ ref pixelFormatWrap ( ) and @ ref format ( ) returns the wrapped value . In order to
@ -127,11 +127,11 @@ value is stored verbatim in @ref formatExtra():
@ snippet Magnum . cpp ImageView - usage - gl - extract
@ snippet Magnum . cpp ImageView - usage - gl - extract
As a final fallback , types for which the @ cpp pixelSize ( ) @ ce overload is not
As a final fallback , types for which the @ cpp pixelFormat Size ( ) @ ce overload is
available can be specified directly together with pixel size . In particular ,
not available can be specified directly together with pixel size . In
pixel size of @ cpp 0 @ ce will cause the image to be treated as fully opaque
particular , p ixel size of @ cpp 0 @ ce will cause the image to be treated as
data , disabling all slicing operations . The following shows a image view using
fully opaque data , disabling all slicing operations . The following shows a
Metal - specific format identifier :
image view using Metal - specific format identifier :
@ snippet Magnum . cpp ImageView - usage - metal
@ snippet Magnum . cpp ImageView - usage - metal
@ -220,7 +220,7 @@ template<UnsignedInt dimensions, class T> class ImageView {
*
*
* Unlike with @ ref ImageView ( PixelStorage , PixelFormat , const VectorTypeFor < dimensions , Int > & , Containers : : ArrayView < ErasedType > ) ,
* Unlike with @ ref ImageView ( PixelStorage , PixelFormat , const VectorTypeFor < dimensions , Int > & , Containers : : ArrayView < ErasedType > ) ,
* where pixel size is calculated automatically using
* where pixel size is calculated automatically using
* @ ref pixelSize ( PixelFormat ) , this allows you to specify an
* @ ref pixelFormat Size ( ) , this allows you to specify an
* implementation - specific pixel format and pixel size directly . Uses
* implementation - specific pixel format and pixel size directly . Uses
* @ ref pixelFormatWrap ( ) internally to wrap @ p format in
* @ ref pixelFormatWrap ( ) internally to wrap @ p format in
* @ ref PixelFormat .
* @ ref PixelFormat .
@ -247,7 +247,7 @@ template<UnsignedInt dimensions, class T> class ImageView {
*
*
* Unlike with @ ref ImageView ( PixelStorage , PixelFormat , const VectorTypeFor < dimensions , Int > & ) ,
* Unlike with @ ref ImageView ( PixelStorage , PixelFormat , const VectorTypeFor < dimensions , Int > & ) ,
* where pixel size is calculated automatically using
* where pixel size is calculated automatically using
* @ ref pixelSize ( PixelFormat ) , this allows you to specify an
* @ ref pixelFormat Size ( ) , this allows you to specify an
* implementation - specific pixel format and pixel size directly . Uses
* implementation - specific pixel format and pixel size directly . Uses
* @ ref pixelFormatWrap ( ) internally to wrap @ p format in
* @ ref pixelFormatWrap ( ) internally to wrap @ p format in
* @ ref PixelFormat .
* @ ref PixelFormat .
@ -272,8 +272,8 @@ template<UnsignedInt dimensions, class T> class ImageView {
* @ param size Image size
* @ param size Image size
* @ param data Image data
* @ param data Image data
*
*
* Uses ADL to find a corresponding @ cpp pixelSize ( T , U ) @ ce overload ,
* Uses ADL to find a corresponding @ cpp pixelFormat Size ( T , U ) @ ce
* then calls @ ref ImageView ( PixelStorage , UnsignedInt , UnsignedInt , UnsignedInt , const VectorTypeFor < dimensions , Int > & , Containers : : ArrayView < ErasedType > )
* overload , then calls @ ref ImageView ( PixelStorage , UnsignedInt , UnsignedInt , UnsignedInt , const VectorTypeFor < dimensions , Int > & , Containers : : ArrayView < ErasedType > )
* with calculated pixel size .
* with calculated pixel size .
*/
*/
template < class U , class V > explicit ImageView ( PixelStorage storage , U format , V formatExtra , const VectorTypeFor < dimensions , Int > & size , Containers : : ArrayView < ErasedType > data ) noexcept ;
template < class U , class V > explicit ImageView ( PixelStorage storage , U format , V formatExtra , const VectorTypeFor < dimensions , Int > & size , Containers : : ArrayView < ErasedType > data ) noexcept ;
@ -285,8 +285,8 @@ template<UnsignedInt dimensions, class T> class ImageView {
* @ param size Image size
* @ param size Image size
* @ param data Image data
* @ param data Image data
*
*
* Uses ADL to find a corresponding @ cpp pixelSize ( T ) @ ce overload ,
* Uses ADL to find a corresponding @ cpp pixelFormat Size ( T ) @ ce
* then calls @ ref ImageView ( PixelStorage , UnsignedInt , UnsignedInt , UnsignedInt , const VectorTypeFor < dimensions , Int > & , Containers : : ArrayView < ErasedType > )
* overload , then calls @ ref ImageView ( PixelStorage , UnsignedInt , UnsignedInt , UnsignedInt , const VectorTypeFor < dimensions , Int > & , Containers : : ArrayView < ErasedType > )
* with calculated pixel size and @ p formatExtra set to @ cpp 0 @ ce .
* with calculated pixel size and @ p formatExtra set to @ cpp 0 @ ce .
*/
*/
template < class U > explicit ImageView ( PixelStorage storage , U format , const VectorTypeFor < dimensions , Int > & size , Containers : : ArrayView < ErasedType > data ) noexcept ;
template < class U > explicit ImageView ( PixelStorage storage , U format , const VectorTypeFor < dimensions , Int > & size , Containers : : ArrayView < ErasedType > data ) noexcept ;
@ -321,8 +321,8 @@ template<UnsignedInt dimensions, class T> class ImageView {
* @ param formatExtra Additional pixel format specifier
* @ param formatExtra Additional pixel format specifier
* @ param size Image size
* @ param size Image size
*
*
* Uses ADL to find a corresponding @ cpp pixelSize ( T , U ) @ ce overload ,
* Uses ADL to find a corresponding @ cpp pixelFormat Size ( T , U ) @ ce
* then calls @ ref ImageView ( PixelStorage , UnsignedInt , UnsignedInt , UnsignedInt , const VectorTypeFor < dimensions , Int > & )
* overload , then calls @ ref ImageView ( PixelStorage , UnsignedInt , UnsignedInt , UnsignedInt , const VectorTypeFor < dimensions , Int > & )
* with calculated pixel size .
* with calculated pixel size .
*
*
* Data pointer is set to @ cpp nullptr @ ce , call @ ref setData ( ) to
* Data pointer is set to @ cpp nullptr @ ce , call @ ref setData ( ) to
@ -336,8 +336,8 @@ template<UnsignedInt dimensions, class T> class ImageView {
* @ param format Format of pixel data
* @ param format Format of pixel data
* @ param size Image size
* @ param size Image size
*
*
* Uses ADL to find a corresponding @ cpp pixelSize ( T ) @ ce overload ,
* Uses ADL to find a corresponding @ cpp pixelFormat Size ( T ) @ ce
* then calls @ ref ImageView ( PixelStorage , UnsignedInt , UnsignedInt , UnsignedInt , const VectorTypeFor < dimensions , Int > & )
* overload , then calls @ ref ImageView ( PixelStorage , UnsignedInt , UnsignedInt , UnsignedInt , const VectorTypeFor < dimensions , Int > & )
* with calculated pixel size and @ p formatExtra set to @ cpp 0 @ ce .
* with calculated pixel size and @ p formatExtra set to @ cpp 0 @ ce .
*
*
* Data pointer is set to @ cpp nullptr @ ce , call @ ref setData ( ) to
* Data pointer is set to @ cpp nullptr @ ce , call @ ref setData ( ) to
@ -405,7 +405,7 @@ template<UnsignedInt dimensions, class T> class ImageView {
/**
/**
* @ brief Size of a pixel in bytes
* @ brief Size of a pixel in bytes
*
*
* @ see @ ref pixelSize ( PixelFormat )
* @ see @ ref pixelFormat Size ( )
*/
*/
UnsignedInt pixelSize ( ) const { return _pixelSize ; }
UnsignedInt pixelSize ( ) const { return _pixelSize ; }
@ -899,22 +899,22 @@ typedef BasicMutableCompressedImageView<2> MutableCompressedImageView2D;
*/
*/
typedef BasicMutableCompressedImageView < 3 > MutableCompressedImageView3D ;
typedef BasicMutableCompressedImageView < 3 > MutableCompressedImageView3D ;
template < UnsignedInt dimensions , class T > template < class U , class V > inline ImageView < dimensions , T > : : ImageView ( const PixelStorage storage , const U format , const V formatExtra , const VectorTypeFor < dimensions , Int > & size , const Containers : : ArrayView < ErasedType > data ) noexcept : ImageView { storage , UnsignedInt ( format ) , UnsignedInt ( formatExtra ) , Implementation : : pixelSizeAdl ( format , formatExtra ) , size , data } {
template < UnsignedInt dimensions , class T > template < class U , class V > inline ImageView < dimensions , T > : : ImageView ( const PixelStorage storage , const U format , const V formatExtra , const VectorTypeFor < dimensions , Int > & size , const Containers : : ArrayView < ErasedType > data ) noexcept : ImageView { storage , UnsignedInt ( format ) , UnsignedInt ( formatExtra ) , Implementation : : pixelFormat SizeAdl ( format , formatExtra ) , size , data } {
static_assert ( sizeof ( T ) < = 4 & & sizeof ( U ) < = 4 ,
static_assert ( sizeof ( T ) < = 4 & & sizeof ( U ) < = 4 ,
" format types larger than 32bits are not supported " ) ;
" format types larger than 32bits are not supported " ) ;
}
}
template < UnsignedInt dimensions , class T > template < class U > inline ImageView < dimensions , T > : : ImageView ( const PixelStorage storage , const U format , const VectorTypeFor < dimensions , Int > & size , const Containers : : ArrayView < ErasedType > data ) noexcept : ImageView { storage , UnsignedInt ( format ) , { } , Implementation : : pixelSizeAdl ( format ) , size , data } {
template < UnsignedInt dimensions , class T > template < class U > inline ImageView < dimensions , T > : : ImageView ( const PixelStorage storage , const U format , const VectorTypeFor < dimensions , Int > & size , const Containers : : ArrayView < ErasedType > data ) noexcept : ImageView { storage , UnsignedInt ( format ) , { } , Implementation : : pixelFormat SizeAdl ( format ) , size , data } {
static_assert ( sizeof ( U ) < = 4 ,
static_assert ( sizeof ( U ) < = 4 ,
" format types larger than 32bits are not supported " ) ;
" format types larger than 32bits are not supported " ) ;
}
}
template < UnsignedInt dimensions , class T > template < class U , class V > inline ImageView < dimensions , T > : : ImageView ( const PixelStorage storage , const U format , const V formatExtra , const VectorTypeFor < dimensions , Int > & size ) noexcept : ImageView { storage , UnsignedInt ( format ) , UnsignedInt ( formatExtra ) , Implementation : : pixelSizeAdl ( format , formatExtra ) , size } {
template < UnsignedInt dimensions , class T > template < class U , class V > inline ImageView < dimensions , T > : : ImageView ( const PixelStorage storage , const U format , const V formatExtra , const VectorTypeFor < dimensions , Int > & size ) noexcept : ImageView { storage , UnsignedInt ( format ) , UnsignedInt ( formatExtra ) , Implementation : : pixelFormat SizeAdl ( format , formatExtra ) , size } {
static_assert ( sizeof ( U ) < = 4 & & sizeof ( U ) < = 4 ,
static_assert ( sizeof ( U ) < = 4 & & sizeof ( U ) < = 4 ,
" format types larger than 32bits are not supported " ) ;
" format types larger than 32bits are not supported " ) ;
}
}
template < UnsignedInt dimensions , class T > template < class U > inline ImageView < dimensions , T > : : ImageView ( const PixelStorage storage , const U format , const VectorTypeFor < dimensions , Int > & size ) noexcept : ImageView { storage , UnsignedInt ( format ) , { } , Implementation : : pixelSizeAdl ( format ) , size } {
template < UnsignedInt dimensions , class T > template < class U > inline ImageView < dimensions , T > : : ImageView ( const PixelStorage storage , const U format , const VectorTypeFor < dimensions , Int > & size ) noexcept : ImageView { storage , UnsignedInt ( format ) , { } , Implementation : : pixelFormat SizeAdl ( format ) , size } {
static_assert ( sizeof ( U ) < = 4 ,
static_assert ( sizeof ( U ) < = 4 ,
" format types larger than 32bits are not supported " ) ;
" format types larger than 32bits are not supported " ) ;
}
}