Skip to content
Snippets Groups Projects
Commit 72fd36d4 authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Slight tweaks to comment about in-memory format of images. (Christian Schilling)

parent 6c704b82
No related branches found
No related tags found
No related merge requests found
...@@ -403,9 +403,15 @@ Images ...@@ -403,9 +403,15 @@ Images
.. note:: .. note::
If you want to load images from numpy arrays or read images back into arrays, be aware If you want to load images from :mod:`numpy.ndarray` instances or read images
that numpy arrays are stored row-major by default whereas OpenCL expects them to be stored in back into them, be aware that OpenCL images expect the *x* dimension to vary
column-major order. fastest, whereas in the default (C) order of :mod:`numpy` arrays, the last index
varies fastest. If your array is arranged in the wrong order in memory,
there are two possible fixes for this:
* Convert the array to Fortran (column-major) order using :func:`numpy.asarray`.
* Pass *ary.T.copy()* to the image creation function.
.. versionadded:: 0.91 .. versionadded:: 0.91
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment