Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Benjamin Jakimow
EO Time Series Viewer
Commits
bd2330af
Commit
bd2330af
authored
Nov 24, 2013
by
Luke Campagnola
Browse files
ImageItem performance boost by avoiding makeQImage(transpose=True)
parent
a08b28c9
Changes
2
Hide whitespace changes
Inline
Side-by-side
pyqtgraph/functions.py
View file @
bd2330af
...
...
@@ -875,6 +875,9 @@ def makeARGB(data, lut=None, levels=None, scale=None, useRGBA=False):
order
=
[
2
,
1
,
0
,
3
]
## for some reason, the colors line up as BGR in the final image.
if
data
.
ndim
==
2
:
# This is tempting:
# imgData[..., :3] = data[..., np.newaxis]
# ..but it turns out this is faster:
for
i
in
range
(
3
):
imgData
[...,
i
]
=
data
elif
data
.
shape
[
2
]
==
1
:
...
...
pyqtgraph/graphicsItems/ImageItem.py
View file @
bd2330af
...
...
@@ -260,8 +260,8 @@ class ImageItem(GraphicsObject):
#print lut.shape
#print self.lut
argb
,
alpha
=
fn
.
makeARGB
(
self
.
image
,
lut
=
lut
,
levels
=
self
.
levels
)
self
.
qimage
=
fn
.
makeQImage
(
argb
,
alpha
)
argb
,
alpha
=
fn
.
makeARGB
(
self
.
image
.
T
,
lut
=
lut
,
levels
=
self
.
levels
)
self
.
qimage
=
fn
.
makeQImage
(
argb
,
alpha
,
transpose
=
False
)
prof
.
finish
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment