[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] surfarray on 64-bit machines
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] surfarray on 64-bit machines
- From: "Charlie Nolan" <funnyman3595@xxxxxxxxx>
- Date: Wed, 22 Oct 2008 21:28:46 -0500
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Wed, 22 Oct 2008 22:28:49 -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=vglU2cJ4xgYNslqAnyK7ISvhGdInsQ7iX+11lYu8huU=; b=m/R6Dg3R/dpBvH7lOHCW4SKn1mm6vsOeOjvbCOFRdAogv/MoRm0Qhu0jpF6K2u/BCo hHiLNnknFGsUFmxzrzdlmJyxZMbGZb5B1pf1YBXXuomIfFdLeKNOIPWL23ZyluKOD26x CYhcIKYh9PF3jLfnC3wdh3Clq/3Ipc9ku8z2A=
- 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=gqa4wMdKrjhqF19IueCU4SvOgkUT+p3sY0LMJIPo/qlaYTmX/wGhIw7y8GrDLOXQ0L r3Ujg4OiUsz8D3bFKFBQhRQkpqCEWcqHIuqkucTzFpyKbnqgzSVu7L5zEgGypl6h1+V2 k4cVXd8M2SRlhFZAhur6bzJuFLl7vGqbSZQU4=
- In-reply-to: <20081023002313.GA10501@platonas>
- References: <20081023002313.GA10501@platonas>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
I may be having this same error. I've got a bug report with that same
error message at one point (and on a 64-bit machine), even though it
works fine on my (32-bit) machine. Could you try printing out
"array[:].shape"? In my case, I do a sensible slice and somehow end
up with a 0x600 array.
-FM
On Wed, Oct 22, 2008 at 7:23 PM, Marius Gedminas <marius@xxxxxxxxx> wrote:
> A user reported that PySpaceWar fails on 64-bit Linux machines if I try
> to scale the alpha channel. Here's the code (simplified):
>
> import pygame
> import Numeric
> image = pygame.image.load('title.png') # has an alpha channel
> mask = pygame.surfarray.array_alpha(image).astype(Numeric.Int)
> array = pygame.surfarray.pixels_alpha(self.image)
> alpha = 42.5 # a float between 1 and 255
> array[:] = (mask * alpha / 255).astype(Numeric.UnsignedInt8)
>
> The error happens on the last line, and it says
>
> ValueError: matrices are not aligned for copy
>
> Any ideas? The code works fine on 32-bit systems.
>
> Marius Gedminas
> --
> If C gives you enough rope to hang yourself, C++ gives you enough rope to bind
> and gag your neighborhood, rig the sails on a small ship, and still have enough
> rope left over to hang yourself from the yardarm.
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFI/8PxkVdEXeem148RAkA6AJwMJ03rjyOqAh6NWRtif4Hf㋀⟞恍
> o4PpuubhJjENjPrqIg0CZXQ=
> =2e46
> -----END PGP SIGNATURE-----
>
>