[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Fast simple transposition (90-degree rotation)?
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] Fast simple transposition (90-degree rotation)?
- From: "Charlie Nolan" <funnyman3595@xxxxxxxxx>
- Date: Tue, 10 Jun 2008 02:52:36 -0500
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Tue, 10 Jun 2008 03:52:42 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=Wk6EReLsrjWsZHSZ/M/DT1XzfXFscb/E8q1h0GMhKaA=; b=Y/RP8J4erXbeo3FotOgs+vI/mDQQvAaLZGPWa5pgmEfpMs4CrbFbN6qY8ek/oKvGZY lbBe9DVRhUtB7IzX1zAB+JRFlR/tEGYdONyKun704IrJyXGAxbuH4KPFOq77LK6rG5sy 68gfON2sqdqoFqaa5qt64vXdYAEY0Fhci6jdY=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=JXZuo5hI1HzrPQoIY9TxQJVHi8sdKhy0D0nB7QqgSx5Q7JTmYvtUv87RhWPEeY81/G w0FjzKaeywA/KU4ODscvtDk0SeWa9V9gT+tRf0NVHOGvQPDjSuWAW604ffZCg/A2Z0tb 4r1MsVuc6nZ+TBqV8XnB4eUuA1rZQxEcRWGw0=
- In-reply-to: <484E2C34.9070500@xxxxxxxxxxxxxxxxxxxx>
- References: <484E2C34.9070500@xxxxxxxxxxxxxxxxxxxx>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
It's special-casing multiples of 90 since at least 1.7.1, from what I
read in the source.
In fact, there looks to be a subtle bug in how it detects them, but
I'll make a separate post for that.
-FM
On 6/10/08, Terry Hancock <hancock@xxxxxxxxxxxxxxxxxxxx> wrote:
> What's the best way to do (exact) 90-degree rotations in PyGame?
>
> There doesn't seem to be a separate "transpose" operation in the
> "transform" module (I.e. an operation that swaps x & y coordinates).
>
> Does the "rotate" function special-case 90-degree interval rotations?
>
> Or is it more efficient to convert a PyGame Surface to a Python Imaging
> Library image and then transpose that? (PIL does have a separate
> "transpose" method).
>
> How efficient can this be? If I need to get a mirror image or a
> transposition of an existing surface (say a full-screen 1024x768 image),
> is it worth caching the result to disk? Or would it be faster to just
> flip it in memory whenever I need it? (IOW, how does a 90-degree
> rotation or a "flip" compare to a disk I/O on most computers?)
>
> BTW, I tried to look this up, but I can't find a discussion of it in the
> documentation, and wasn't sure how to look it up in the ML archives.
>
> Thanks,
> Terry
>
> --
> Terry Hancock (hancock@xxxxxxxxxxxxxxxxxxxx)
> Anansi Spaceworks http://www.AnansiSpaceworks.com
>
>