Browse Source

doc: no, pixel size isn't calculated, it's determined.

pull/651/merge
Vladimír Vondruš 1 year ago
parent
commit
4b0460d1d5
  1. 12
      src/Magnum/Image.h
  2. 14
      src/Magnum/ImageView.h
  3. 6
      src/Magnum/Trade/ImageData.h

12
src/Magnum/Image.h

@ -207,7 +207,7 @@ template<UnsignedInt dimensions> class Image {
* @param flags Image layout flags
*
* Unlike with @ref Image(PixelStorage, PixelFormat, const VectorTypeFor<dimensions, Int>&, Containers::Array<char>&&, ImageFlags<dimensions>),
* where pixel size is calculated automatically using
* where pixel size is determined automatically using
* @ref pixelFormatSize(), this allows you to specify an
* implementation-specific pixel format and pixel size directly. Uses
* @ref pixelFormatWrap() internally to wrap @p format in
@ -235,7 +235,7 @@ template<UnsignedInt dimensions> class Image {
* @param pixelSize Size of a pixel in given format, in bytes
*
* Unlike with @ref Image(PixelStorage, PixelFormat), where pixel size
* is calculated automatically using @ref pixelFormatSize(), this
* is determined automatically using @ref pixelFormatSize(), this
* allows you to specify an implementation-specific pixel format and
* pixel size directly. Uses @ref pixelFormatWrap() internally to wrap
* @p format in @ref PixelFormat.
@ -264,7 +264,7 @@ template<UnsignedInt dimensions> class Image {
*
* Uses ADL to find a corresponding @cpp pixelFormatSize(T, U) @ce
* overload, then calls @ref Image(PixelStorage, UnsignedInt, UnsignedInt, UnsignedInt, const VectorTypeFor<dimensions, Int>&, Containers::Array<char>&&, ImageFlags<dimensions>)
* with calculated pixel size.
* with determined pixel size.
*/
template<class T, class U> explicit Image(PixelStorage storage, T format, U formatExtra, const VectorTypeFor<dimensions, Int>& size, Containers::Array<char>&& data, ImageFlags<dimensions> flags = {}) noexcept;
@ -278,7 +278,7 @@ template<UnsignedInt dimensions> class Image {
*
* Uses ADL to find a corresponding @cpp pixelFormatSize(T) @ce
* overload, then calls @ref Image(PixelStorage, UnsignedInt, UnsignedInt, UnsignedInt, const VectorTypeFor<dimensions, Int>&, Containers::Array<char>&&, ImageFlags<dimensions>)
* with calculated pixel size and @p formatExtra set to @cpp 0 @ce.
* with determined pixel size and @p formatExtra set to @cpp 0 @ce.
*/
template<class T> explicit Image(PixelStorage storage, T format, const VectorTypeFor<dimensions, Int>& size, Containers::Array<char>&& data, ImageFlags<dimensions> flags = {}) noexcept;
@ -315,7 +315,7 @@ template<UnsignedInt dimensions> class Image {
*
* Uses ADL to find a corresponding @cpp pixelFormatSize(T, U) @ce
* overload, then calls @ref Image(PixelStorage, UnsignedInt, UnsignedInt, UnsignedInt)
* with calculated pixel size.
* with determined pixel size.
*/
/* No ImageFlags parameter here as this constructor is mainly used to
query GL textures, and there the flags are forcibly reset */
@ -340,7 +340,7 @@ template<UnsignedInt dimensions> class Image {
*
* Uses ADL to find a corresponding @cpp pixelFormatSize(T) @ce
* overload, then calls @ref Image(PixelStorage, UnsignedInt, UnsignedInt, UnsignedInt)
* with calculated pixel size and @p formatExtra set to @cpp 0 @ce.
* with determined pixel size and @p formatExtra set to @cpp 0 @ce.
*/
/* No ImageFlags parameter here as this constructor is mainly used to
query GL textures, and there the flags are forcibly reset */

14
src/Magnum/ImageView.h

@ -122,7 +122,7 @@ the @ref GL::PixelFormat and @ref GL::PixelType pair:
@snippet Magnum.cpp ImageView-usage-gl
In such cases, pixel size is calculated using either
In such cases, pixel size is determined using either
@cpp pixelFormatSize(T, U) @ce or @cpp pixelFormatSize(T) @ce that is found
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
@ -252,7 +252,7 @@ template<UnsignedInt dimensions, class T> class ImageView {
* @param flags Image layout flags
*
* Unlike with @ref ImageView(PixelStorage, PixelFormat, const VectorTypeFor<dimensions, Int>&, Containers::ArrayView<ErasedType>, ImageFlags<dimensions>),
* where pixel size is calculated automatically using
* where pixel size is determined automatically using
* @ref pixelFormatSize(), this allows you to specify an
* implementation-specific pixel format and pixel size directly. Uses
* @ref pixelFormatWrap() internally to wrap @p format in
@ -282,7 +282,7 @@ template<UnsignedInt dimensions, class T> class ImageView {
* @param flags Image layout flags
*
* Unlike with @ref ImageView(PixelStorage, PixelFormat, const VectorTypeFor<dimensions, Int>&, ImageFlags<dimensions>),
* where pixel size is calculated automatically using
* where pixel size is determined automatically using
* @ref pixelFormatSize(), this allows you to specify an
* implementation-specific pixel format and pixel size directly. Uses
* @ref pixelFormatWrap() internally to wrap @p format in
@ -313,7 +313,7 @@ template<UnsignedInt dimensions, class T> class ImageView {
*
* Uses ADL to find a corresponding @cpp pixelFormatSize(T, U) @ce
* overload, then calls @ref ImageView(PixelStorage, UnsignedInt, UnsignedInt, UnsignedInt, const VectorTypeFor<dimensions, Int>&, Containers::ArrayView<ErasedType>, ImageFlags<dimensions>)
* with calculated pixel size.
* with determined pixel size.
*/
template<class U, class V> explicit ImageView(PixelStorage storage, U format, V formatExtra, const VectorTypeFor<dimensions, Int>& size, Containers::ArrayView<ErasedType> data, ImageFlags<dimensions> flags = {}) noexcept;
@ -327,7 +327,7 @@ template<UnsignedInt dimensions, class T> class ImageView {
*
* Uses ADL to find a corresponding @cpp pixelFormatSize(T) @ce
* overload, then calls @ref ImageView(PixelStorage, UnsignedInt, UnsignedInt, UnsignedInt, const VectorTypeFor<dimensions, Int>&, Containers::ArrayView<ErasedType>, ImageFlags<dimensions>)
* with calculated pixel size and @p formatExtra set to @cpp 0 @ce.
* with determined 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, ImageFlags<dimensions> flags = {}) noexcept;
@ -366,7 +366,7 @@ template<UnsignedInt dimensions, class T> class ImageView {
*
* Uses ADL to find a corresponding @cpp pixelFormatSize(T, U) @ce
* overload, then calls @ref ImageView(PixelStorage, UnsignedInt, UnsignedInt, UnsignedInt, const VectorTypeFor<dimensions, Int>&, ImageFlags<dimensions>)
* with calculated pixel size.
* with determined pixel size.
*
* Data pointer is set to @cpp nullptr @ce, call @ref setData() to
* assign a memory view to the image.
@ -382,7 +382,7 @@ template<UnsignedInt dimensions, class T> class ImageView {
*
* Uses ADL to find a corresponding @cpp pixelFormatSize(T) @ce
* overload, then calls @ref ImageView(PixelStorage, UnsignedInt, UnsignedInt, UnsignedInt, const VectorTypeFor<dimensions, Int>&, ImageFlags<dimensions>)
* with calculated pixel size and @p formatExtra set to @cpp 0 @ce.
* with determined pixel size and @p formatExtra set to @cpp 0 @ce.
*
* Data pointer is set to @cpp nullptr @ce, call @ref setData() to
* assign a memory view to the image.

6
src/Magnum/Trade/ImageData.h

@ -276,7 +276,7 @@ template<UnsignedInt dimensions> class ImageData {
* @m_since_latest
*
* Unlike with @ref ImageData(PixelStorage, PixelFormat, const VectorTypeFor<dimensions, Int>&, Containers::Array<char>&&, ImageFlags<dimensions>, const void*),
* where pixel size is calculated automatically using
* where pixel size is determined automatically using
* @ref pixelFormatSize(), this allows you to specify an
* implementation-specific pixel format and pixel size directly. Uses
* @ref pixelFormatWrap() internally to wrap @p format in
@ -374,7 +374,7 @@ template<UnsignedInt dimensions> class ImageData {
*
* Uses ADL to find a corresponding @cpp pixelFormatSize(T, U) @ce
* overload, then calls @ref ImageData(PixelStorage, UnsignedInt, UnsignedInt, UnsignedInt, const VectorTypeFor<dimensions, Int>&, Containers::Array<char>&&, ImageFlags<dimensions>, const void*)
* with calculated pixel size.
* with determined pixel size.
*/
template<class T, class U> explicit ImageData(PixelStorage storage, T format, U formatExtra, const VectorTypeFor<dimensions, Int>& size, Containers::Array<char>&& data, ImageFlags<dimensions> flags = {}, const void* importerState = nullptr) noexcept;
@ -428,7 +428,7 @@ template<UnsignedInt dimensions> class ImageData {
*
* Uses ADL to find a corresponding @cpp pixelFormatSize(T) @ce
* overload, then calls @ref ImageData(PixelStorage, UnsignedInt, UnsignedInt, UnsignedInt, const VectorTypeFor<dimensions, Int>&, Containers::Array<char>&&, ImageFlags<dimensions>, const void*)
* with calculated pixel size and @p formatExtra set to @cpp 0 @ce.
* with determined pixel size and @p formatExtra set to @cpp 0 @ce.
*/
template<class T> explicit ImageData(PixelStorage storage, T format, const VectorTypeFor<dimensions, Int>& size, Containers::Array<char>&& data, ImageFlags<dimensions> flags = {}, const void* importerState = nullptr) noexcept;

Loading…
Cancel
Save