Browse Source

GL: document ImageFlag behavior in *Framebuffer::read().

No actual change compared to previous state, which is exactly how I
envisioned this -- the most common and default case being the implicit
one.
pull/578/head
Vladimír Vondruš 4 years ago
parent
commit
e0e8ddcae2
  1. 2
      src/Magnum/GL/AbstractFramebuffer.cpp
  2. 13
      src/Magnum/GL/AbstractFramebuffer.h

2
src/Magnum/GL/AbstractFramebuffer.cpp

@ -376,7 +376,7 @@ void AbstractFramebuffer::read(const Range2Di& rectangle, Image2D& image) {
data = Containers::Array<char>{dataSize}; data = Containers::Array<char>{dataSize};
/* Replace the storage, proxy to the function taking a view */ /* Replace the storage, proxy to the function taking a view */
image = Image2D{image.storage(), image.format(), image.formatExtra(), image.pixelSize(), rectangle.size(), std::move(data)}; image = Image2D{image.storage(), image.format(), image.formatExtra(), image.pixelSize(), rectangle.size(), std::move(data), ImageFlags2D{}};
read(rectangle, MutableImageView2D(image)); read(rectangle, MutableImageView2D(image));
} }

13
src/Magnum/GL/AbstractFramebuffer.h

@ -383,10 +383,11 @@ class MAGNUM_GL_EXPORT AbstractFramebuffer {
* @param image Image where to put the data * @param image Image where to put the data
* *
* Image parameters like format and type of pixel data are taken from * Image parameters like format and type of pixel data are taken from
* given image. The storage is not reallocated if it is large enough to * given image. @ref ImageFlags of @p image get cleared. The storage
* contain the new data --- however if you want to read into existing * is not reallocated if it is large enough to contain the new data
* memory or *ensure* a reallocation does not happen, use * --- however if you want to read into existing memory or *ensure* a
* @ref read(const Range2Di&, const MutableImageView2D&) instead. * reallocation does not happen, use @ref read(const Range2Di&, const MutableImageView2D&)
* instead.
* *
* On OpenGL ES 2.0 and WebGL 1.0, if @ref PixelStorage::skip() is set, * On OpenGL ES 2.0 and WebGL 1.0, if @ref PixelStorage::skip() is set,
* the functionality is emulated by adjusting the data pointer. If * the functionality is emulated by adjusting the data pointer. If
@ -418,7 +419,9 @@ class MAGNUM_GL_EXPORT AbstractFramebuffer {
* Compared to @ref read(const Range2Di&, Image2D&) the function * Compared to @ref read(const Range2Di&, Image2D&) the function
* reads the pixels into the memory provided by @p image, expecting * reads the pixels into the memory provided by @p image, expecting
* it's not @cpp nullptr @ce and its size is the same as @p rectangle * it's not @cpp nullptr @ce and its size is the same as @p rectangle
* size. * size. Any set of @ref ImageFlags is allowed in @p image --- e.g.,
* it's possible to read a 2D framebuffer to an image marked as 1D
* array.
*/ */
void read(const Range2Di& rectangle, const MutableImageView2D& image); void read(const Range2Di& rectangle, const MutableImageView2D& image);

Loading…
Cancel
Save