Repository: pyqtgraph/pyqtgraph

Issue:
RawImageWidget ignores imageAxisOrder config option
### Short description
RawImageWidget ignores imageAxisOrder whereas RawImageGLWidget respects it.
In the included example below, the user needs to manually transpose the image.

### Code to reproduce
```python
import scipy.misc
import pyqtgraph as pg
from pyqtgraph.widgets.RawImageWidget import RawImageWidget, RawImageGLWidget

pg.setConfigOptions(imageAxisOrder='row-major')

data = scipy.misc.face()

app = pg.mkQApp()
win = pg.Qt.QtWidgets.QMainWindow()
if 1:
    wgt = RawImageWidget(scaled=True)
    # data = data.transpose(1,0,2)    # needs a manual transpose
else:
    wgt = RawImageGLWidget()
wgt.setImage(data)
win.setCentralWidget(wgt)
win.resize(800, 600)
win.show()
app.exec_()
```

### Expected behavior
<!-- What should happen? -->
Image displayed right-side up

### Real behavior
<!-- What happens? -->
Image displayed transposed

### Tested environment(s)

 * PyQtGraph version: 0.11.1.dev0
 * Qt Python binding: PyQt5 5.15.2 Qt 5.15.2
 * Python version: 3.7.9
 * NumPy version: 1.19.4
 * Operating system: Windows 10 x64
 * Installation method: pip install -e .

### Additional context
None


Discussion:
Here I was expecting to have to debug for a while, only to see that config option isn't even referenced anywhere in `RawImageWidget` ... I'll look into fixing that up.
@pijyoi since I don't work w/ these objects much, should the two Image widgets behave the same?

For example `RawImageWidget`

![image](https://user-images.githubusercontent.com/646398/108162069-3370ad00-70a1-11eb-9d83-339d478ed83e.png)

and `RawImageGLWidget`:
![image](https://user-images.githubusercontent.com/646398/108162112-4aaf9a80-70a1-11eb-86a6-3de897ab8983.png)


I don't imagine that's intentional, or is that a separate issue?

Resolving patch:
diff --git a/pyqtgraph/widgets/RawImageWidget.py b/pyqtgraph/widgets/RawImageWidget.py
--- a/pyqtgraph/widgets/RawImageWidget.py
+++ b/pyqtgraph/widgets/RawImageWidget.py
@@ -43,6 +43,8 @@ def setImage(self, img, *args, **kargs):
         img must be ndarray of shape (x,y), (x,y,3), or (x,y,4).
         Extra arguments are sent to functions.makeARGB
         """
+        if getConfigOption('imageAxisOrder') == 'row-major':
+            img = img.transpose((1, 0, 2))
         self.opts = (img, args, kargs)
         self.image = None
         self.update()
@@ -79,7 +81,7 @@ def paintEvent(self, ev):
     class RawImageGLWidget(QtWidgets.QOpenGLWidget):
         """
         Similar to RawImageWidget, but uses a GL widget to do all drawing.
-        Perfomance varies between platforms; see examples/VideoSpeedTest for benchmarking.
+        Performance varies between platforms; see examples/VideoSpeedTest for benchmarking.
 
         Checks if setConfigOptions(imageAxisOrder='row-major') was set.
         """
@@ -91,7 +93,6 @@ def __init__(self, parent=None, scaled=False):
             self.uploaded = False
             self.smooth = False
             self.opts = None
-            self.row_major = getConfigOption('imageAxisOrder') == 'row-major'
 
         def setImage(self, img, *args, **kargs):
             """
@@ -118,20 +119,20 @@ def uploadTexture(self):
             glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER)
             glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER)
             # glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_BORDER)
-
-            if self.row_major:
+            if getConfigOption('imageAxisOrder') == 'row-major':
                 image = self.image
             else:
                 image = self.image.transpose((1, 0, 2))
 
-            # ## Test texture dimensions first
+            ## Test texture dimensions first
             # shape = self.image.shape
             # glTexImage2D(GL_PROXY_TEXTURE_2D, 0, GL_RGBA, shape[0], shape[1], 0, GL_RGBA, GL_UNSIGNED_BYTE, None)
             # if glGetTexLevelParameteriv(GL_PROXY_TEXTURE_2D, 0, GL_TEXTURE_WIDTH) == 0:
-            # raise Exception("OpenGL failed to create 2D texture (%dx%d); too large for this hardware." % shape[:2])
+                # raise Exception("OpenGL failed to create 2D texture (%dx%d); too large for this hardware." % shape[:2])
 
             glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.shape[1], image.shape[0], 0, GL_RGBA, GL_UNSIGNED_BYTE, image)
             glDisable(GL_TEXTURE_2D)
+            self.uploaded = True
 
         def paintGL(self):
             glClear(GL_COLOR_BUFFER_BIT)


Test patch: