[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] writing to a QImage buffer
From: Florian Bruhin <me () the-compiler ! org>
Date: 2014-11-13 5:13:50
Message-ID: 20141113051350.GI5944 () lupin
[Download RAW message or body]
This is a MIME-formatted message. If you see this text it means that your
E-mail software does not support MIME-formatted messages.
[Attachment #2 (multipart/signed)]
This is a MIME-formatted message. If you see this text it means that your
E-mail software does not support MIME-formatted messages.
* James Conger <jlconger@yahoo.com> [2014-11-12 17:00:01 -0800]:
> QImage.scanLine() returns a sip void * pointer to a memory block containing one row \
> of the image. For performance reasons I would like to write pixel RGB data directly \
> to that buffer from within my Python code. How do you convert the void * pointer to \
> a r/w object such as a Python array?
> Many thanks.
See
http://pyqt.sourceforge.net/Docs/PyQt5/gotchas.html#support-for-void
A sip.voidptr may also be given a size (ie. the size of the block
of memory that is pointed to) by calling its setsize() method. If
it has a size then it is also able to support Python's buffer
protocol and behaves like a Python memoryview object so that the
block of memory can be treated as a mutable list of bytes.
Florian
--
http://www.the-compiler.org | me@the-compiler.org (Mail/XMPP)
GPG 0xFD55A072 | http://the-compiler.org/pubkey.asc
I love long mails! | http://email.is-not-s.ms/
[Attachment #5 (application/pgp-signature)]
[Attachment #6 (text/plain)]
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic