From 3f843e201c74b15167638ad65234c8d2a620265b Mon Sep 17 00:00:00 2001
From: Alan Aguiar
Date: Wed, 31 Oct 2012 15:47:29 +0000
Subject: remove pygame - uses the installed
---
diff --git a/lib/pygame/__init__.py b/lib/pygame/__init__.py
deleted file mode 100755
index 1e8727e..0000000
--- a/lib/pygame/__init__.py
+++ /dev/null
@@ -1,304 +0,0 @@
-## pygame - Python Game Library
-## Copyright (C) 2000-2001 Pete Shinners
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Library General Public
-## License as published by the Free Software Foundation; either
-## version 2 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Library General Public License for more details.
-##
-## You should have received a copy of the GNU Library General Public
-## License along with this library; if not, write to the Free
-## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-##
-## Pete Shinners
-## pete@shinners.org
-"""Pygame is a set of Python modules designed for writing games.
-It is written on top of the excellent SDL library. This allows you
-to create fully featured games and multimedia programs in the python
-language. The package is highly portable, with games running on
-Windows, MacOS, OS X, BeOS, FreeBSD, IRIX, and Linux.
-"""
-
-import sys, os, string
-
-# check if is old windows... if so use directx video driver by default.
-# if someone sets this respect their setting...
-if not 'SDL_VIDEODRIVER' in os.environ:
- # http://docs.python.org/lib/module-sys.html
- # 0 (VER_PLATFORM_WIN32s) Win32s on Windows 3.1
- # 1 (VER_PLATFORM_WIN32_WINDOWS) Windows 95/98/ME
- # 2 (VER_PLATFORM_WIN32_NT) Windows NT/2000/XP
- # 3 (VER_PLATFORM_WIN32_CE) Windows CE
- if hasattr(sys, "getwindowsversion"):
- try:
- if (sys.getwindowsversion()[3] in [1,2] and
- sys.getwindowsversion()[0] in [0,1,2,3,4,5]):
- os.environ['SDL_VIDEODRIVER'] = 'directx'
- except:
- pass
-
-
-class MissingModule:
- _NOT_IMPLEMENTED_ = True
- def __init__(self, name, info='', urgent=0):
- self.name = name
- self.info = str(info)
- try:
- exc = sys.exc_info()
- if exc[0] != None:
- self.reason = "%s: %s" % (exc[0].__name__, str(exc[1]))
- else:
- self.reason = ""
- finally:
- del exc
- self.urgent = urgent
- if urgent:
- self.warn()
-
- def __getattr__(self, var):
- if not self.urgent:
- self.warn()
- self.urgent = 1
- MissingPygameModule = "%s module not available" % self.name
- if self.reason:
- MissingPygameModule += "\n(%s)" % self.reason
- raise NotImplementedError(MissingPygameModule)
-
- def __nonzero__(self):
- return 0
-
- def warn(self):
- if self.urgent: type = 'import'
- else: type = 'use'
- message = '%s %s: %s' % (type, self.name, self.info)
- if self.reason:
- message += "\n(%s)" % self.reason
- try:
- import warnings
- if self.urgent: level = 4
- else: level = 3
- warnings.warn(message, RuntimeWarning, level)
- except ImportError:
- print (message)
-
-
-
-#we need to import like this, each at a time. the cleanest way to import
-#our modules is with the import command (not the __import__ function)
-
-#first, the "required" modules
-from pygame.base import *
-from pygame.constants import *
-from pygame.version import *
-from pygame.rect import Rect
-from pygame.compat import geterror
-import pygame.rwobject
-import pygame.surflock
-import pygame.color
-Color = color.Color
-__version__ = ver
-
-#next, the "standard" modules
-#we still allow them to be missing for stripped down pygame distributions
-try: import pygame.cdrom
-except (ImportError,IOError):cdrom=MissingModule("cdrom", geterror(), 1)
-
-try: import pygame.cursors
-except (ImportError,IOError):cursors=MissingModule("cursors", geterror(), 1)
-
-try: import pygame.display
-except (ImportError,IOError):display=MissingModule("display", geterror(), 1)
-
-try: import pygame.draw
-except (ImportError,IOError):draw=MissingModule("draw", geterror(), 1)
-
-try: import pygame.event
-except (ImportError,IOError):event=MissingModule("event", geterror(), 1)
-
-try: import pygame.image
-except (ImportError,IOError):image=MissingModule("image", geterror(), 1)
-
-try: import pygame.joystick
-except (ImportError,IOError):joystick=MissingModule("joystick", geterror(), 1)
-
-try: import pygame.key
-except (ImportError,IOError):key=MissingModule("key", geterror(), 1)
-
-try: import pygame.mouse
-except (ImportError,IOError):mouse=MissingModule("mouse", geterror(), 1)
-
-try: import pygame.sprite
-except (ImportError,IOError):sprite=MissingModule("sprite", geterror(), 1)
-
-
-try: import pygame.threads
-except (ImportError,IOError):threads=MissingModule("threads", geterror(), 1)
-
-
-def warn_unwanted_files():
- """ Used to warn about unneeded old files.
- """
-
- # a temporary hack to warn about camera.so and camera.pyd.
- install_path= os.path.split(pygame.base.__file__)[0]
- extension_ext = os.path.splitext(pygame.base.__file__)[1]
-
- # here are the .so/.pyd files we need to ask to remove.
- ext_to_remove = ["camera"]
-
- # here are the .py/.pyo/.pyc files we need to ask to remove.
- py_to_remove = ["color"]
-
- if os.name == "e32": # Don't warn on Symbian. The color.py is used as a wrapper.
- py_to_remove = []
-
- # See if any of the files are there.
- extension_files = ["%s%s" % (x, extension_ext) for x in ext_to_remove]
-
- py_files = ["%s%s" % (x, py_ext)
- for py_ext in [".py", ".pyc", ".pyo"]
- for x in py_to_remove]
-
- files = py_files + extension_files
-
- unwanted_files = []
- for f in files:
- unwanted_files.append( os.path.join( install_path, f ) )
-
-
-
- ask_remove = []
- for f in unwanted_files:
- if os.path.exists(f):
- ask_remove.append(f)
-
-
- if ask_remove:
- message = "Detected old file(s). Please remove the old files:\n"
-
- for f in ask_remove:
- message += "%s " % f
- message += "\nLeaving them there might break pygame. Cheers!\n\n"
-
- try:
- import warnings
- level = 4
- warnings.warn(message, RuntimeWarning, level)
- except ImportError:
- print (message)
-
-
-# disable, because we hopefully don't need it.
-#warn_unwanted_files()
-
-
-
-try: from pygame.surface import *
-except (ImportError,IOError):Surface = lambda:Missing_Function
-
-
-try:
- import pygame.mask
- from pygame.mask import Mask
-except (ImportError,IOError):Mask = lambda:Missing_Function
-
-try: from pygame.pixelarray import *
-except (ImportError,IOError): PixelArray = lambda:Missing_Function
-
-try: from pygame.overlay import *
-except (ImportError,IOError):Overlay = lambda:Missing_Function
-
-try: import pygame.time
-except (ImportError,IOError):time=MissingModule("time", geterror(), 1)
-
-try: import pygame.transform
-except (ImportError,IOError):transform=MissingModule("transform", geterror(), 1)
-
-#lastly, the "optional" pygame modules
-try:
- import pygame.font
- import pygame.sysfont
- pygame.font.SysFont = pygame.sysfont.SysFont
- pygame.font.get_fonts = pygame.sysfont.get_fonts
- pygame.font.match_font = pygame.sysfont.match_font
-except (ImportError,IOError):font=MissingModule("font", geterror(), 0)
-
-# try and load pygame.mixer_music before mixer, for py2app...
-try:
- import pygame.mixer_music
- #del pygame.mixer_music
- #print ("NOTE2: failed importing pygame.mixer_music in lib/__init__.py")
-except (ImportError,IOError):
- pass
-
-try: import pygame.mixer
-except (ImportError,IOError):mixer=MissingModule("mixer", geterror(), 0)
-
-try: import pygame.movie
-except (ImportError,IOError):movie=MissingModule("movie", geterror(), 0)
-
-#try: import pygame.movieext
-#except (ImportError,IOError):movieext=MissingModule("movieext", geterror(), 0)
-
-try: import pygame.scrap
-except (ImportError,IOError):scrap=MissingModule("scrap", geterror(), 0)
-
-try: import pygame.surfarray
-except (ImportError,IOError):surfarray=MissingModule("surfarray", geterror(), 0)
-
-try: import pygame.sndarray
-except (ImportError,IOError):sndarray=MissingModule("sndarray", geterror(), 0)
-
-try: import pygame.fastevent
-except (ImportError,IOError):fastevent=MissingModule("fastevent", geterror(), 0)
-
-#there's also a couple "internal" modules not needed
-#by users, but putting them here helps "dependency finder"
-#programs get everything they need (like py2exe)
-try: import pygame.imageext; del pygame.imageext
-except (ImportError,IOError):pass
-
-def packager_imports():
- """
- Some additional things that py2app/py2exe will want to see
- """
- import atexit
- import Numeric
- import numpy
- import OpenGL.GL
- import pygame.macosx
- import pygame.mac_scrap
- import pygame.bufferproxy
- import pygame.colordict
-
-#make Rects pickleable
-try:
- import copy_reg
-except ImportError:
- import copyreg as copy_reg
-def __rect_constructor(x,y,w,h):
- return Rect(x,y,w,h)
-def __rect_reduce(r):
- assert type(r) == Rect
- return __rect_constructor, (r.x, r.y, r.w, r.h)
-copy_reg.pickle(Rect, __rect_reduce, __rect_constructor)
-
-
-#make Colors pickleable
-def __color_constructor(r,g,b,a):
- return Color(r,g,b,a)
-def __color_reduce(c):
- assert type(c) == Color
- return __color_constructor, (c.r, c.g, c.b, c.a)
-copy_reg.pickle(Color, __color_reduce, __color_constructor)
-
-
-
-
-#cleanup namespace
-del pygame, os, sys, rwobject, surflock, MissingModule, copy_reg, geterror
diff --git a/lib/pygame/_arraysurfarray.so b/lib/pygame/_arraysurfarray.so
deleted file mode 100644
index 4aa881a..0000000
--- a/lib/pygame/_arraysurfarray.so
+++ /dev/null
Binary files differ
diff --git a/lib/pygame/_camera.so b/lib/pygame/_camera.so
deleted file mode 100644
index 6b1f0b2..0000000
--- a/lib/pygame/_camera.so
+++ /dev/null
Binary files differ
diff --git a/lib/pygame/_camera_opencv_highgui.py b/lib/pygame/_camera_opencv_highgui.py
deleted file mode 100755
index 7709c3c..0000000
--- a/lib/pygame/_camera_opencv_highgui.py
+++ /dev/null
@@ -1,98 +0,0 @@
-
-import pygame
-import numpy
-
-import opencv
-#this is important for capturing/displaying images
-from opencv import highgui
-
-
-
-def list_cameras():
- """
- """
- # -1 for opencv means get any of them.
- return [-1]
-
-def init():
- pass
-
-def quit():
- pass
-
-
-class Camera:
-
- def __init__(self, device =0, size = (640,480), mode = "RGB"):
- """
- """
- self.camera = highgui.cvCreateCameraCapture(device)
- if not self.camera:
- raise ValueError ("Could not open camera. Sorry.")
-
-
- def set_controls(self, **kwargs):
- """
- """
-
-
- def set_resolution(self, width, height):
- """Sets the capture resolution. (without dialog)
- """
- # nothing to do here.
- pass
- def query_image(self):
- return True
-
- def stop(self):
- pass
-
- def start(self):
- # do nothing here... since the camera is already open.
- pass
-
- def get_buffer(self):
- """Returns a string containing the raw pixel data.
- """
- return self.get_surface().get_buffer()
-
- def get_image(self, dest_surf = None):
- return self.get_surface(dest_surf)
-
- def get_surface(self, dest_surf = None):
- camera = self.camera
-
- im = highgui.cvQueryFrame(camera)
- #convert Ipl image to PIL image
- #print type(im)
- if im:
- xx = opencv.adaptors.Ipl2NumPy(im)
- #print type(xx)
- #print xx.iscontiguous()
- #print dir(xx)
- #print xx.shape
- xxx = numpy.reshape(xx, (numpy.product(xx.shape),))
-
- if xx.shape[2] != 3:
- raise ValueError("not sure what to do about this size")
-
- pg_img = pygame.image.frombuffer(xxx, (xx.shape[1],xx.shape[0]), "RGB")
-
- # if there is a destination surface given, we blit onto that.
- if dest_surf:
- dest_surf.blit(pg_img, (0,0))
- return dest_surf
- #return pg_img
-
-
-
-if __name__ == "__main__":
-
- # try and use this camera stuff with the pygame camera example.
- import pygame.examples.camera
-
- pygame.camera.Camera = Camera
- pygame.camera.list_cameras = list_cameras
- pygame.examples.camera.main()
-
-
diff --git a/lib/pygame/_camera_vidcapture.py b/lib/pygame/_camera_vidcapture.py
deleted file mode 100755
index 5b6a4f3..0000000
--- a/lib/pygame/_camera_vidcapture.py
+++ /dev/null
@@ -1,133 +0,0 @@
-
-import pygame
-
-def list_cameras():
- return [0]
-
- # this just cycles through all the cameras trying to open them
- cameras = []
- for x in range(256):
- try:
- c = Camera(x)
- except:
- break
- cameras.append(x)
-
- return cameras
-
-
-def init():
- global vidcap
- import vidcap as vc
- vidcap = vc
-
-def quit():
- global vidcap
- pass
- del vidcap
-
-
-
-class Camera:
-
- def __init__(self, device =0,
- size = (640,480),
- mode = "RGB",
- show_video_window=0):
- """device: VideoCapture enumerates the available video capture devices
- on your system. If you have more than one device, specify
- the desired one here. The device number starts from 0.
-
- show_video_window: 0 ... do not display a video window (the default)
- 1 ... display a video window
-
- Mainly used for debugging, since the video window
- can not be closed or moved around.
- """
- self.dev = vidcap.new_Dev(device, show_video_window)
- width, height = size
- self.dev.setresolution(width, height)
-
- def display_capture_filter_properties(self):
- """Displays a dialog containing the property page of the capture filter.
-
- For VfW drivers you may find the option to select the resolution most
- likely here.
- """
- self.dev.displaycapturefilterproperties()
-
- def display_capture_pin_properties(self):
- """Displays a dialog containing the property page of the capture pin.
-
- For WDM drivers you may find the option to select the resolution most
- likely here.
- """
- self.dev.displaycapturepinproperties()
-
- def set_resolution(self, width, height):
- """Sets the capture resolution. (without dialog)
- """
- self.dev.setresolution(width, height)
-
- def get_buffer(self):
- """Returns a string containing the raw pixel data.
- """
- return self.dev.getbuffer()
-
- def start(self):
- """
- """
- def set_controls(self, **kwargs):
- """
- """
-
- def stop(self):
- """
- """
-
- def get_image(self, dest_surf = None):
- return self.get_surface(dest_surf)
-
- def get_surface(self, dest_surf = None):
- """Returns a pygame Surface.
- """
- abuffer, width, height = self.get_buffer()
- if abuffer:
- if 1:
- surf = pygame.image.frombuffer(abuffer, (width, height), "RGB")
-
- # swap it from a BGR surface to an RGB surface.
- r,g,b,a = surf.get_masks()
- surf.set_masks((b,g,r,a))
-
- r,g,b,a = surf.get_shifts()
- surf.set_shifts((b,g,r,a))
-
- surf = pygame.transform.flip(surf, 0,1)
-
- # if there is a destination surface given, we blit onto that.
- if dest_surf:
- dest_surf.blit(surf, (0,0))
- return dest_surf
-
- else:
-
- # Need to flip the image.
- surf = pygame.image.fromstring(abuffer, (width, height), "RGB", 1)
- # swap it from a BGR surface to an RGB surface.
- r,g,b,a = surf.get_masks()
- surf.set_masks((b,g,r,a))
-
- r,g,b,a = surf.get_shifts()
- surf.set_shifts((b,g,r,a))
- return surf
-
-
-if __name__ == "__main__":
- import pygame.examples.camera
-
- pygame.camera.Camera = Camera
- pygame.camera.list_cameras = list_cameras
- pygame.examples.camera.main()
-
-
diff --git a/lib/pygame/_numericsndarray.so b/lib/pygame/_numericsndarray.so
deleted file mode 100644
index 68707b0..0000000
--- a/lib/pygame/_numericsndarray.so
+++ /dev/null
Binary files differ
diff --git a/lib/pygame/_numericsurfarray.so b/lib/pygame/_numericsurfarray.so
deleted file mode 100644
index 14c3a37..0000000
--- a/lib/pygame/_numericsurfarray.so
+++ /dev/null
Binary files differ
diff --git a/lib/pygame/_numpysndarray.py b/lib/pygame/_numpysndarray.py
deleted file mode 100755
index 58c7fba..0000000
--- a/lib/pygame/_numpysndarray.py
+++ /dev/null
@@ -1,136 +0,0 @@
-## pygame - Python Game Library
-## Copyright (C) 2008 Marcus von Appen
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Library General Public
-## License as published by the Free Software Foundation; either
-## version 2 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Library General Public License for more details.
-##
-## You should have received a copy of the GNU Library General Public
-## License along with this library; if not, write to the Free
-## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-##
-## Marcus von Appen
-## mva@sysfault.org
-
-"""pygame module for accessing sound sample data using numpy
-
-Functions to convert between numpy arrays and Sound objects. This module
-will only be available when pygame can use the external numpy package.
-
-Sound data is made of thousands of samples per second, and each sample
-is the amplitude of the wave at a particular moment in time. For
-example, in 22-kHz format, element number 5 of the array is the
-amplitude of the wave after 5/22000 seconds.
-
-Each sample is an 8-bit or 16-bit integer, depending on the data format.
-A stereo sound file has two values per sample, while a mono sound file
-only has one.
-"""
-
-import pygame
-import pygame.mixer as mixer
-import numpy
-
-def _array_samples(sound, raw):
- # Info is a (freq, format, stereo) tuple
- info = mixer.get_init ()
- if not info:
- raise pygame.error("Mixer not initialized")
- fmtbytes = (abs (info[1]) & 0xff) >> 3
- channels = info[2]
- if raw:
- data = sound.get_buffer ().raw
- else:
- data = sound.get_buffer ()
-
- shape = (len (data) // fmtbytes, )
- if channels > 1:
- shape = (shape[0] // channels, channels)
-
- # mixer.init () does not support different formats from the ones below,
- # so MSB/LSB stuff is silently ignored.
- typecode = { 8 : numpy.uint8, # AUDIO_U8
- 16 : numpy.uint16, # AUDIO_U16 / AUDIO_U16SYS
- -8 : numpy.int8, # AUDIO_S8
- -16 : numpy.int16 # AUDUI_S16 / AUDIO_S16SYS
- }[info[1]]
-
- array = numpy.fromstring (data, typecode)
- array.shape = shape
- return array
-
-def array (sound):
- """pygame._numpysndarray.array(Sound): return array
-
- Copy Sound samples into an array.
-
- Creates a new array for the sound data and copies the samples. The
- array will always be in the format returned from
- pygame.mixer.get_init().
- """
- return _array_samples(sound, True)
-
-def samples (sound):
- """pygame._numpysndarray.samples(Sound): return array
-
- Reference Sound samples into an array.
-
- Creates a new array that directly references the samples in a Sound
- object. Modifying the array will change the Sound. The array will
- always be in the format returned from pygame.mixer.get_init().
- """
- # Info is a (freq, format, stereo) tuple
- info = pygame.mixer.get_init ()
- if not info:
- raise pygame.error("Mixer not initialized")
- fmtbytes = (abs (info[1]) & 0xff) >> 3
- channels = info[2]
- data = sound.get_buffer ()
-
- shape = (data.length // fmtbytes, )
- if channels > 1:
- shape = (shape[0] // channels, channels)
-
- # mixer.init () does not support different formats from the ones below,
- # so MSB/LSB stuff is silently ignored.
- typecode = { 8 : numpy.uint8, # AUDIO_U8
- 16 : numpy.uint16, # AUDIO_U16
- -8 : numpy.int8, # AUDIO_S8
- -16 : numpy.int16 # AUDUI_S16
- }[info[1]]
-
- array = numpy.frombuffer (data, typecode)
- array.shape = shape
- return array
-
-def make_sound (array):
- """pygame._numpysndarray.make_sound(array): return Sound
-
- Convert an array into a Sound object.
-
- Create a new playable Sound object from an array. The mixer module
- must be initialized and the array format must be similar to the mixer
- audio format.
- """
- # Info is a (freq, format, stereo) tuple
- info = pygame.mixer.get_init ()
- if not info:
- raise pygame.error("Mixer not initialized")
- channels = info[2]
-
- shape = array.shape
- if channels == 1:
- if len (shape) != 1:
- raise ValueError("Array must be 1-dimensional for mono mixer")
- else:
- if len (shape) != 2:
- raise ValueError("Array must be 2-dimensional for stereo mixer")
- elif shape[1] != channels:
- raise ValueError("Array depth must match number of mixer channels")
- return mixer.Sound (array)
diff --git a/lib/pygame/_numpysurfarray.py b/lib/pygame/_numpysurfarray.py
deleted file mode 100755
index 8eac04d..0000000
--- a/lib/pygame/_numpysurfarray.py
+++ /dev/null
@@ -1,472 +0,0 @@
-## pygame - Python Game Library
-## Copyright (C) 2007 Marcus von Appen
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Library General Public
-## License as published by the Free Software Foundation; either
-## version 2 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Library General Public License for more details.
-##
-## You should have received a copy of the GNU Library General Public
-## License along with this library; if not, write to the Free
-## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-##
-## Marcus von Appen
-## mva@sysfault.org
-
-"""pygame module for accessing surface pixel data using numpy
-
-Functions to convert pixel data between pygame Surfaces and Numpy
-arrays. This module will only be available when pygame can use the
-external Numpy package.
-
-Note, that numpyarray is an optional module. It requires that Numpy is
-installed to be used. If not installed, an exception will be raised when
-it is used. eg. ImportError: no module named numpy
-
-Every pixel is stored as a single integer value to represent the red,
-green, and blue colors. The 8bit images use a value that looks into a
-colormap. Pixels with higher depth use a bit packing process to place
-three or four values into a single number.
-
-The Numpy arrays are indexed by the X axis first, followed by the Y
-axis. Arrays that treat the pixels as a single integer are referred to
-as 2D arrays. This module can also separate the red, green, and blue
-color values into separate indices. These types of arrays are referred
-to as 3D arrays, and the last index is 0 for red, 1 for green, and 2 for
-blue.
-
-In contrast to Numeric Numpy does use unsigned 16bit integers, images
-with 16bit data will be treated as unsigned integers.
-"""
-
-import pygame
-import numpy
-import re
-
-def array2d (surface):
- """pygame.numpyarray.array2d (Surface): return array
-
- copy pixels into a 2d array
-
- Copy the pixels from a Surface into a 2D array. The bit depth of the
- surface will control the size of the integer values, and will work
- for any type of pixel format.
-
- This function will temporarily lock the Surface as pixels are copied
- (see the Surface.lock - lock the Surface memory for pixel access
- method).
- """
- bpp = surface.get_bytesize ()
- if bpp <= 0 or bpp > 4:
- raise ValueError("unsupported bit depth for 2D array")
-
- # Taken from Alex Holkner's pygame-ctypes package. Thanks a lot.
- data = surface.get_buffer ().raw
-
- # Remove extra pitch from each row.
- width = surface.get_width ()
- pitchdiff = surface.get_pitch () - width * bpp
- if pitchdiff > 0:
- pattern = re.compile ('(%s)%s' % ('.' * width * bpp, '.' * pitchdiff),
- flags=re.DOTALL)
- data = ''.join (pattern.findall (data))
-
- if bpp == 3:
- # Pad each triplet of bytes with another zero
- pattern = re.compile ('...', flags=re.DOTALL)
- data = '\0'.join (pattern.findall (data))
- if pygame.get_sdl_byteorder () == pygame.LIL_ENDIAN:
- data += '\0'
- else:
- data = '\0' + data
- bpp = 4
-
- typecode = (numpy.uint8, numpy.uint16, None, numpy.int32)[bpp - 1]
- array = numpy.fromstring (data, typecode)
- array.shape = (surface.get_height (), width)
- array = numpy.transpose (array)
- return array
-
-
-def pixels2d (surface):
- """pygame.numpyarray.pixels2d (Surface): return array
-
- reference pixels into a 2d array
-
- Create a new 2D array that directly references the pixel values in a
- Surface. Any changes to the array will affect the pixels in the
- Surface. This is a fast operation since no data is copied.
-
- Pixels from a 24-bit Surface cannot be referenced, but all other
- Surface bit depths can.
-
- The Surface this references will remain locked for the lifetime of
- the array (see the Surface.lock - lock the Surface memory for pixel
- access method).
- """
- bpp = surface.get_bytesize ()
- if bpp == 3 or bpp < 1 or bpp > 4:
- raise ValueError("unsupported bit depth for 2D reference array")
-
- typecode = (numpy.uint8, numpy.uint16, None, numpy.int32)[bpp - 1]
- array = numpy.frombuffer (surface.get_buffer (), typecode)
- array.shape = surface.get_height (), surface.get_pitch () / bpp
-
- # Padding correction for certain depth due to padding bytes.
- array = array[:,:surface.get_width ()]
- array = numpy.transpose (array)
- return array
-
-def array3d (surface):
- """pygame.numpyarray.array3d (Surface): return array
-
- copy pixels into a 3d array
-
- Copy the pixels from a Surface into a 3D array. The bit depth of the
- surface will control the size of the integer values, and will work
- for any type of pixel format.
-
- This function will temporarily lock the Surface as pixels are copied
- (see the Surface.lock - lock the Surface memory for pixel access
- method).
- """
- bpp = surface.get_bytesize ()
- array = array2d (surface)
-
- # Taken from from Alex Holkner's pygame-ctypes package. Thanks a
- # lot.
- if bpp == 1:
- palette = surface.get_palette ()
- # Resolve the correct values using the color palette
- pal_r = numpy.array ([c[0] for c in palette])
- pal_g = numpy.array ([c[1] for c in palette])
- pal_b = numpy.array ([c[2] for c in palette])
- planes = [numpy.choose (array, pal_r),
- numpy.choose (array, pal_g),
- numpy.choose (array, pal_b)]
- array = numpy.array (planes, numpy.uint8)
- array = numpy.transpose (array, (1, 2, 0))
- return array
- elif bpp == 2:
- # Taken from SDL_GetRGBA.
- masks = surface.get_masks ()
- shifts = surface.get_shifts ()
- losses = surface.get_losses ()
- vr = (array & masks[0]) >> shifts[0]
- vg = (array & masks[1]) >> shifts[1]
- vb = (array & masks[2]) >> shifts[2]
- planes = [(vr << losses[0]) + (vr >> (8 - (losses[0] << 1))),
- (vg << losses[1]) + (vg >> (8 - (losses[1] << 1))),
- (vb << losses[2]) + (vb >> (8 - (losses[2] << 1)))]
- array = numpy.array (planes, numpy.uint8)
- return numpy.transpose (array, (1, 2, 0))
- else:
- masks = surface.get_masks ()
- shifts = surface.get_shifts ()
- losses = surface.get_losses ()
- planes = [((array & masks[0]) >> shifts[0]), # << losses[0], Assume 0
- ((array & masks[1]) >> shifts[1]), # << losses[1],
- ((array & masks[2]) >> shifts[2])] # << losses[2]]
- array = numpy.array (planes, numpy.uint8)
- return numpy.transpose (array, (1, 2, 0))
-
-def pixels3d (surface):
- """pygame.numpyarray.pixels3d (Surface): return array
-
- reference pixels into a 3d array
-
- Create a new 3D array that directly references the pixel values in a
- Surface. Any changes to the array will affect the pixels in the
- Surface. This is a fast operation since no data is copied.
-
- This will only work on Surfaces that have 24-bit or 32-bit
- formats. Lower pixel formats cannot be referenced.
-
- The Surface this references will remain locked for the lifetime of
- the array (see the Surface.lock - lock the Surface memory for pixel
- access method).
- """
- bpp = surface.get_bytesize ()
- if bpp < 3 or bpp > 4:
- raise ValueError("unsupported bit depth for 3D reference array")
- lilendian = pygame.get_sdl_byteorder () == pygame.LIL_ENDIAN
-
- start = 0
- step = 0
-
- # Check for RGB or BGR surface.
- shifts = surface.get_shifts ()
- if shifts[0] == 16 and shifts[1] == 8 and shifts[2] == 0:
- # RGB
- if lilendian:
- start = 2
- step = -1
- else:
- start = 0
- step = 1
- elif shifts[2] == 16 and shifts[1] == 8 and shifts[0] == 0:
- # BGR
- if lilendian:
- start = 0
- step = 1
- else:
- start = 2
- step = -1
- else:
- raise ValueError("unsupported colormasks for 3D reference array")
-
- if bpp == 4 and not lilendian:
- start += 1
-
- array = numpy.ndarray \
- (shape=(surface.get_width (), surface.get_height (), 3),
- dtype=numpy.uint8, buffer=surface.get_buffer (),
- offset=start, strides=(bpp, surface.get_pitch (),step))
- return array
-
-def array_alpha (surface):
- """pygame.numpyarray.array_alpha (Surface): return array
-
- copy pixel alphas into a 2d array
-
- Copy the pixel alpha values (degree of transparency) from a Surface
- into a 2D array. This will work for any type of Surface
- format. Surfaces without a pixel alpha will return an array with all
- opaque values.
-
- This function will temporarily lock the Surface as pixels are copied
- (see the Surface.lock - lock the Surface memory for pixel access
- method).
- """
- if (surface.get_bytesize () == 1 or
- surface.get_alpha () is None or
- surface.get_masks ()[3] == 0):
- # 1 bpp surfaces and surfaces without per-pixel alpha are always
- # fully opaque.
- array = numpy.empty (surface.get_width () * surface.get_height (),
- numpy.uint8)
- array.fill (0xff)
- array.shape = surface.get_width (), surface.get_height ()
- return array
-
- array = array2d (surface)
- if surface.get_bytesize () == 2:
- # Taken from SDL_GetRGBA.
- va = (array & surface.get_masks ()[3]) >> surface.get_shifts ()[3]
- array = ((va << surface.get_losses ()[3]) +
- (va >> (8 - (surface.get_losses ()[3] << 1))))
- else:
- # Taken from _numericsurfarray.c.
- array = array >> surface.get_shifts ()[3] << surface.get_losses ()[3]
- array = array.astype (numpy.uint8)
- return array
-
-def pixels_alpha (surface):
- """pygame.numpyarray.pixels_alpha (Surface): return array
-
- reference pixel alphas into a 2d array
-
- Create a new 2D array that directly references the alpha values
- (degree of transparency) in a Surface. Any changes to the array will
- affect the pixels in the Surface. This is a fast operation since no
- data is copied.
-
- This can only work on 32-bit Surfaces with a per-pixel alpha value.
-
- The Surface this array references will remain locked for the
- lifetime of the array.
- """
- if surface.get_bytesize () != 4:
- raise ValueError("unsupported bit depth for alpha reference array")
- lilendian = pygame.get_sdl_byteorder () == pygame.LIL_ENDIAN
-
- # ARGB surface.
- start = 0
-
- if surface.get_shifts ()[3] == 24 and lilendian:
- # RGBA surface.
- start = 3
- elif surface.get_shifts ()[3] == 0 and not lilendian:
- start = 3
- else:
- raise ValueError("unsupported colormasks for alpha reference array")
-
- array = numpy.ndarray \
- (shape=(surface.get_width (), surface.get_height ()),
- dtype=numpy.uint8, buffer=surface.get_buffer (),
- offset=start, strides=(4, surface.get_pitch ()))
- return array
-
-def array_colorkey (surface):
- """pygame.numpyarray.array_colorkey (Surface): return array
-
- copy the colorkey values into a 2d array
-
- Create a new array with the colorkey transparency value from each
- pixel. If the pixel matches the colorkey it will be fully
- tranparent; otherwise it will be fully opaque.
-
- This will work on any type of Surface format. If the image has no
- colorkey a solid opaque array will be returned.
-
- This function will temporarily lock the Surface as pixels are
- copied.
- """
- colorkey = surface.get_colorkey ()
- if colorkey == None:
- # No colorkey, return a solid opaque array.
- array = numpy.empty (surface.get_width () * surface.get_height (),
- numpy.uint8)
- array.fill (0xff)
- array.shape = surface.get_width (), surface.get_height ()
- return array
-
- # Taken from from Alex Holkner's pygame-ctypes package. Thanks a
- # lot.
- array = array2d (surface)
- # Check each pixel value for the colorkey and mark it as opaque or
- # transparent as needed.
- val = surface.map_rgb (colorkey)
- array = numpy.choose (numpy.equal (array, val),
- (numpy.uint8 (0xff), numpy.uint8 (0)))
- array.shape = surface.get_width (), surface.get_height ()
- return array
-
-def make_surface (array):
- """pygame.numpyarray.make_surface (array): return Surface
-
- copy an array to a new surface
-
- Create a new Surface that best resembles the data and format on the
- array. The array can be 2D or 3D with any sized integer values.
- """
- # Taken from from Alex Holkner's pygame-ctypes package. Thanks a
- # lot.
- bpp = 0
- r = g = b = 0
- shape = array.shape
- if len (shape) == 2:
- # 2D array
- bpp = 8
- r = 0xFF >> 6 << 5
- g = 0xFF >> 5 << 2
- b = 0xFF >> 6
- elif len (shape) == 3 and shape[2] == 3:
- bpp = 32
- r = 0xff << 16
- g = 0xff << 8
- b = 0xff
- else:
- raise ValueError("must be a valid 2d or 3d array")
-
- surface = pygame.Surface ((shape[0], shape[1]), 0, bpp, (r, g, b, 0))
- blit_array (surface, array)
- return surface
-
-def blit_array (surface, array):
- """pygame.numpyarray.blit_array (Surface, array): return None
-
- blit directly from a array values
-
- Directly copy values from an array into a Surface. This is faster
- than converting the array into a Surface and blitting. The array
- must be the same dimensions as the Surface and will completely
- replace all pixel values.
-
- This function will temporarily lock the Surface as the new values
- are copied.
- """
- bpp = surface.get_bytesize ()
- if bpp <= 0 or bpp > 4:
- raise ValueError("unsupported bit depth for surface")
-
- shape = array.shape
- width = surface.get_width ()
-
- typecode = (numpy.uint8, numpy.uint16, None, numpy.uint32)[bpp - 1]
- array = array.astype (typecode)
-
- # Taken from from Alex Holkner's pygame-ctypes package. Thanks a
- # lot.
- if len(shape) == 3 and shape[2] == 3:
- array = numpy.transpose (array, (1, 0, 2))
- shifts = surface.get_shifts ()
- losses = surface.get_losses ()
- array = (array[:,:,::3] >> losses[0] << shifts[0]) | \
- (array[:,:,1::3] >> losses[1] << shifts[1]) | \
- (array[:,:,2::3] >> losses[2] << shifts[2])
- elif len (shape) == 2:
- array = numpy.transpose (array)
- else:
- raise ValueError("must be a valid 2d or 3d array")
-
- if width != shape[0] or surface.get_height () != shape[1]:
- raise ValueError("array must match the surface dimensions")
-
- itemsize = array.itemsize
- data = array.tostring ()
-
- if itemsize > bpp:
- # Trim bytes from each element, keep least significant byte(s)
- pattern = '%s(%s)' % ('.' * (itemsize - bpp), '.' * bpp)
- if pygame.get_sdl_byteorder () == pygame.LIL_ENDIAN:
- pattern = '(%s)%s' % ('.' * bpp, '.' * (itemsize - bpp))
- data = ''.join (re.compile (pattern, flags=re.DOTALL).findall (data))
- elif itemsize < bpp:
- # Add pad bytes to each element, at most significant end
- pad = '\0' * (bpp - itemsize)
- pixels = re.compile ('.' * itemsize, flags=re.DOTALL).findall (data)
- data = pad.join (pixels)
- if pygame.get_sdl_byteorder () == pygame.LIL_ENDIAN:
- data = data + pad
- else:
- data = pad + data
-
- # Add zeros pad for pitch correction
- pitchdiff = surface.get_pitch () - width * bpp
- if pitchdiff > 0:
- pad = '\0' * pitchdiff
- rows = re.compile ('.' * width * bpp, flags=re.DOTALL).findall (data)
- data = pad.join (rows) + pad
-
- surface.get_buffer ().write (data, 0)
-
-def map_array (surface, array):
- """pygame.numpyarray.map_array (Surface, array3d): return array2d
-
- map a 3d array into a 2d array
-
- Convert a 3D array into a 2D array. This will use the given Surface
- format to control the conversion. Palette surface formats are not
- supported.
-
- Note: arrays do not need to be 3D, as long as the minor axis has
- three elements giving the component colours, any array shape can be
- used (for example, a single colour can be mapped, or an array of
- colours).
- """
- # Taken from from Alex Holkner's pygame-ctypes package. Thanks a
- # lot.
- bpp = surface.get_bytesize ()
- if bpp <= 1 or bpp > 4:
- raise ValueError("unsupported bit depth for surface array")
-
- shape = array.shape
- if shape[-1] != 3:
- raise ValueError("array must be a 3d array of 3-value color data")
-
- shifts = surface.get_shifts ()
- losses = surface.get_losses ()
- if array.dtype != numpy.int32:
- array = array.astype(numpy.int32)
- out = array[...,0] >> losses[0] << shifts[0]
- out[...] |= array[...,1] >> losses[1] << shifts[1]
- out[...] |= array[...,2] >> losses[2] << shifts[2]
- if surface.get_flags() & pygame.SRCALPHA:
- out[...] |= numpy.int32(255) >> losses[3] << shifts[3]
- return out
diff --git a/lib/pygame/base.so b/lib/pygame/base.so
deleted file mode 100644
index 745da1e..0000000
--- a/lib/pygame/base.so
+++ /dev/null
Binary files differ
diff --git a/lib/pygame/bufferproxy.so b/lib/pygame/bufferproxy.so
deleted file mode 100644
index b766062..0000000
--- a/lib/pygame/bufferproxy.so
+++ /dev/null
Binary files differ
diff --git a/lib/pygame/camera.py b/lib/pygame/camera.py
deleted file mode 100755
index 618e012..0000000
--- a/lib/pygame/camera.py
+++ /dev/null
@@ -1,144 +0,0 @@
-
-_is_init = 0
-
-
-
-def init():
- global list_cameras, Camera, colorspace, _is_init
-
-
- import os,sys
-
- use_opencv = False
- use_vidcapture = False
- use__camera = True
-
-
- if sys.platform == 'win32':
- use_vidcapture = True
-
- elif "linux" in sys.platform:
- use__camera = True
-
- else:
- use_opencv = True
-
-
-
- # see if we have any user specified defaults in environments.
- camera_env = os.environ.get("PYGAME_CAMERA", "")
- if camera_env == "opencv":
- use_opencv = True
- if camera_env == "vidcapture":
- use_vidcapture = True
-
-
-
- # select the camera module to import here.
-
- # the _camera module has some code which can be reused by other modules.
- # it will also be the default one.
- import _camera
- colorspace = _camera.colorspace
-
- if use__camera:
- list_cameras = _camera.list_cameras
- Camera = _camera.Camera
-
- if use_opencv:
- try:
- import _camera_opencv_highgui
- except:
- _camera_opencv_highgui = None
-
- if _camera_opencv_highgui:
- _camera_opencv_highgui.init()
-
- list_cameras = _camera_opencv_highgui.list_cameras
- Camera = _camera_opencv_highgui.Camera
-
- if use_vidcapture:
- try:
- import _camera_vidcapture
- except:
- _camera_vidcapture = None
-
- if _camera_vidcapture:
- _camera_vidcapture.init()
- list_cameras = _camera_vidcapture.list_cameras
- Camera = _camera_vidcapture.Camera
-
-
-
- _is_init = 1
- pass
-
-
-def quit():
- global _is_init
- _is_init = 0
- pass
-
-
-def _check_init():
- global _is_init
- if not _is_init:
- raise ValueError("Need to call camera.init() before using.")
-
-def list_cameras():
- """
- """
- _check_init()
- raise NotImplementedError()
-
-
-class Camera:
-
- def __init__(self, device =0, size = (320, 200), mode = "RGB"):
- """
- """
- _check_init()
- raise NotImplementedError()
-
- def set_resolution(self, width, height):
- """Sets the capture resolution. (without dialog)
- """
- pass
-
- def start(self):
- """
- """
-
- def stop(self):
- """
- """
-
- def get_buffer(self):
- """
- """
-
- def set_controls(self, **kwargs):
- """
- """
-
- def get_image(self, dest_surf = None):
- """
- """
-
- def get_surface(self, dest_surf = None):
- """
- """
-
-
-
-if __name__ == "__main__":
-
- # try and use this camera stuff with the pygame camera example.
- import pygame.examples.camera
-
- #pygame.camera.Camera = Camera
- #pygame.camera.list_cameras = list_cameras
- pygame.examples.camera.main()
-
-
-
diff --git a/lib/pygame/cdrom.so b/lib/pygame/cdrom.so
deleted file mode 100644
index 3663963..0000000
--- a/lib/pygame/cdrom.so
+++ /dev/null
Binary files differ
diff --git a/lib/pygame/color.so b/lib/pygame/color.so
deleted file mode 100644
index 889b830..0000000
--- a/lib/pygame/color.so
+++ /dev/null
Binary files differ
diff --git a/lib/pygame/colordict.py b/lib/pygame/colordict.py
deleted file mode 100755
index 75a83d3..0000000
--- a/lib/pygame/colordict.py
+++ /dev/null
@@ -1,679 +0,0 @@
-## pygame - Python Game Library
-## Copyright (C) 2000-2003 Pete Shinners
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Library General Public
-## License as published by the Free Software Foundation; either
-## version 2 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Library General Public License for more details.
-##
-## You should have received a copy of the GNU Library General Public
-## License along with this library; if not, write to the Free
-## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-##
-## Pete Shinners
-## pete@shinners.org
-
-THECOLORS = {
-'gray17' : (43, 43, 43, 255) ,
-'gold' : (255, 215, 0, 255) ,
-'gray10' : (26, 26, 26, 255) ,
-'yellow' : (255, 255, 0, 255) ,
-'gray11' : (28, 28, 28, 255) ,
-'grey61' : (156, 156, 156, 255) ,
-'grey60' : (153, 153, 153, 255) ,
-'darkseagreen' : (143, 188, 143, 255) ,
-'grey62' : (158, 158, 158, 255) ,
-'grey65' : (166, 166, 166, 255) ,
-'gray12' : (31, 31, 31, 255) ,
-'grey67' : (171, 171, 171, 255) ,
-'grey66' : (168, 168, 168, 255) ,
-'grey69' : (176, 176, 176, 255) ,
-'gray21' : (54, 54, 54, 255) ,
-'lightsalmon4' : (139, 87, 66, 255) ,
-'lightsalmon2' : (238, 149, 114, 255) ,
-'lightsalmon3' : (205, 129, 98, 255) ,
-'lightsalmon1' : (255, 160, 122, 255) ,
-'gray32' : (82, 82, 82, 255) ,
-'green4' : (0, 139, 0, 255) ,
-'gray30' : (77, 77, 77, 255) ,
-'gray31' : (79, 79, 79, 255) ,
-'green1' : (0, 255, 0, 255) ,
-'gray37' : (94, 94, 94, 255) ,
-'green3' : (0, 205, 0, 255) ,
-'green2' : (0, 238, 0, 255) ,
-'darkslategray1' : (151, 255, 255, 255) ,
-'darkslategray2' : (141, 238, 238, 255) ,
-'darkslategray3' : (121, 205, 205, 255) ,
-'aquamarine1' : (127, 255, 212, 255) ,
-'aquamarine3' : (102, 205, 170, 255) ,
-'aquamarine2' : (118, 238, 198, 255) ,
-'papayawhip' : (255, 239, 213, 255) ,
-'black' : (0, 0, 0, 255) ,
-'darkorange3' : (205, 102, 0, 255) ,
-'oldlace' : (253, 245, 230, 255) ,
-'lightgoldenrod4' : (139, 129, 76, 255) ,
-'gray90' : (229, 229, 229, 255) ,
-'orchid1' : (255, 131, 250, 255) ,
-'orchid2' : (238, 122, 233, 255) ,
-'orchid3' : (205, 105, 201, 255) ,
-'grey68' : (173, 173, 173, 255) ,
-'brown' : (165, 42, 42, 255) ,
-'purple2' : (145, 44, 238, 255) ,
-'gray80' : (204, 204, 204, 255) ,
-'antiquewhite3' : (205, 192, 176, 255) ,
-'antiquewhite2' : (238, 223, 204, 255) ,
-'antiquewhite1' : (255, 239, 219, 255) ,
-'palevioletred3' : (205, 104, 137, 255) ,
-'hotpink' : (255, 105, 180, 255) ,
-'lightcyan' : (224, 255, 255, 255) ,
-'coral3' : (205, 91, 69, 255) ,
-'gray8' : (20, 20, 20, 255) ,
-'gray9' : (23, 23, 23, 255) ,
-'grey32' : (82, 82, 82, 255) ,
-'bisque4' : (139, 125, 107, 255) ,
-'cyan' : (0, 255, 255, 255) ,
-'gray0' : (0, 0, 0, 255) ,
-'gray1' : (3, 3, 3, 255) ,
-'gray6' : (15, 15, 15, 255) ,
-'bisque1' : (255, 228, 196, 255) ,
-'bisque2' : (238, 213, 183, 255) ,
-'bisque3' : (205, 183, 158, 255) ,
-'skyblue' : (135, 206, 235, 255) ,
-'gray' : (190, 190, 190, 255) ,
-'darkturquoise' : (0, 206, 209, 255) ,
-'rosybrown4' : (139, 105, 105, 255) ,
-'deepskyblue3' : (0, 154, 205, 255) ,
-'grey63' : (161, 161, 161, 255) ,
-'indianred1' : (255, 106, 106, 255) ,
-'grey78' : (199, 199, 199, 255) ,
-'lightpink' : (255, 182, 193, 255) ,
-'gray88' : (224, 224, 224, 255) ,
-'gray22' : (56, 56, 56, 255) ,
-'red' : (255, 0, 0, 255) ,
-'grey11' : (28, 28, 28, 255) ,
-'lemonchiffon3' : (205, 201, 165, 255) ,
-'lemonchiffon2' : (238, 233, 191, 255) ,
-'lemonchiffon1' : (255, 250, 205, 255) ,
-'indianred3' : (205, 85, 85, 255) ,
-'violetred1' : (255, 62, 150, 255) ,
-'plum2' : (238, 174, 238, 255) ,
-'plum1' : (255, 187, 255, 255) ,
-'lemonchiffon4' : (139, 137, 112, 255) ,
-'gray99' : (252, 252, 252, 255) ,
-'grey13' : (33, 33, 33, 255) ,
-'grey55' : (140, 140, 140, 255) ,
-'darkcyan' : (0, 139, 139, 255) ,
-'chocolate4' : (139, 69, 19, 255) ,
-'lightgoldenrodyellow' : (250, 250, 210, 255) ,
-'gray54' : (138, 138, 138, 255) ,
-'lavender' : (230, 230, 250, 255) ,
-'chartreuse3' : (102, 205, 0, 255) ,
-'chartreuse2' : (118, 238, 0, 255) ,
-'chartreuse1' : (127, 255, 0, 255) ,
-'grey48' : (122, 122, 122, 255) ,
-'grey16' : (41, 41, 41, 255) ,
-'thistle' : (216, 191, 216, 255) ,
-'chartreuse4' : (69, 139, 0, 255) ,
-'darkorchid4' : (104, 34, 139, 255) ,
-'grey42' : (107, 107, 107, 255) ,
-'grey41' : (105, 105, 105, 255) ,
-'grey17' : (43, 43, 43, 255) ,
-'dimgrey' : (105, 105, 105, 255) ,
-'dodgerblue4' : (16, 78, 139, 255) ,
-'darkorchid2' : (178, 58, 238, 255) ,
-'darkorchid3' : (154, 50, 205, 255) ,
-'blue' : (0, 0, 255, 255) ,
-'rosybrown2' : (238, 180, 180, 255) ,
-'honeydew' : (240, 255, 240, 255) ,
-'gray18' : (46, 46, 46, 255) ,
-'cornflowerblue' : (100, 149, 237, 255) ,
-'grey91' : (232, 232, 232, 255) ,
-'gray14' : (36, 36, 36, 255) ,
-'gray15' : (38, 38, 38, 255) ,
-'gray16' : (41, 41, 41, 255) ,
-'maroon4' : (139, 28, 98, 255) ,
-'maroon3' : (205, 41, 144, 255) ,
-'maroon2' : (238, 48, 167, 255) ,
-'maroon1' : (255, 52, 179, 255) ,
-'gray13' : (33, 33, 33, 255) ,
-'gold3' : (205, 173, 0, 255) ,
-'gold2' : (238, 201, 0, 255) ,
-'gold1' : (255, 215, 0, 255) ,
-'grey79' : (201, 201, 201, 255) ,
-'palevioletred1' : (255, 130, 171, 255) ,
-'palevioletred2' : (238, 121, 159, 255) ,
-'gold4' : (139, 117, 0, 255) ,
-'gray41' : (105, 105, 105, 255) ,
-'gray84' : (214, 214, 214, 255) ,
-'mediumpurple' : (147, 112, 219, 255) ,
-'rosybrown1' : (255, 193, 193, 255) ,
-'lightblue2' : (178, 223, 238, 255) ,
-'lightblue3' : (154, 192, 205, 255) ,
-'grey57' : (145, 145, 145, 255) ,
-'lightblue1' : (191, 239, 255, 255) ,
-'lightblue4' : (104, 131, 139, 255) ,
-'gray33' : (84, 84, 84, 255) ,
-'skyblue4' : (74, 112, 139, 255) ,
-'grey97' : (247, 247, 247, 255) ,
-'skyblue1' : (135, 206, 255, 255) ,
-'gray27' : (69, 69, 69, 255) ,
-'skyblue3' : (108, 166, 205, 255) ,
-'skyblue2' : (126, 192, 238, 255) ,
-'lavenderblush1' : (255, 240, 245, 255) ,
-'darkgrey' : (169, 169, 169, 255) ,
-'lavenderblush3' : (205, 193, 197, 255) ,
-'darkslategrey' : (47, 79, 79, 255) ,
-'lavenderblush4' : (139, 131, 134, 255) ,
-'deeppink4' : (139, 10, 80, 255) ,
-'grey99' : (252, 252, 252, 255) ,
-'gray36' : (92, 92, 92, 255) ,
-'coral4' : (139, 62, 47, 255) ,
-'magenta3' : (205, 0, 205, 255) ,
-'lightskyblue4' : (96, 123, 139, 255) ,
-'mediumturquoise' : (72, 209, 204, 255) ,
-'gray34' : (87, 87, 87, 255) ,
-'floralwhite' : (255, 250, 240, 255) ,
-'grey39' : (99, 99, 99, 255) ,
-'grey36' : (92, 92, 92, 255) ,
-'grey37' : (94, 94, 94, 255) ,
-'grey34' : (87, 87, 87, 255) ,
-'gray26' : (66, 66, 66, 255) ,
-'royalblue2' : (67, 110, 238, 255) ,
-'grey33' : (84, 84, 84, 255) ,
-'turquoise1' : (0, 245, 255, 255) ,
-'grey31' : (79, 79, 79, 255) ,
-'steelblue1' : (99, 184, 255, 255) ,
-'sienna4' : (139, 71, 38, 255) ,
-'steelblue3' : (79, 148, 205, 255) ,
-'lavenderblush2' : (238, 224, 229, 255) ,
-'sienna1' : (255, 130, 71, 255) ,
-'steelblue4' : (54, 100, 139, 255) ,
-'sienna3' : (205, 104, 57, 255) ,
-'aquamarine4' : (69, 139, 116, 255) ,
-'lightyellow1' : (255, 255, 224, 255) ,
-'lightyellow2' : (238, 238, 209, 255) ,
-'lightsteelblue' : (176, 196, 222, 255) ,
-'lightyellow4' : (139, 139, 122, 255) ,
-'magenta2' : (238, 0, 238, 255) ,
-'lightskyblue1' : (176, 226, 255, 255) ,
-'lightgoldenrod' : (238, 221, 130, 255) ,
-'magenta4' : (139, 0, 139, 255) ,
-'gray87' : (222, 222, 222, 255) ,
-'greenyellow' : (173, 255, 47, 255) ,
-'navajowhite4' : (139, 121, 94, 255) ,
-'darkslategray4' : (82, 139, 139, 255) ,
-'olivedrab' : (107, 142, 35, 255) ,
-'navajowhite1' : (255, 222, 173, 255) ,
-'navajowhite2' : (238, 207, 161, 255) ,
-'darkgoldenrod1' : (255, 185, 15, 255) ,
-'sienna' : (160, 82, 45, 255) ,
-'blue1' : (0, 0, 255, 255) ,
-'yellow1' : (255, 255, 0, 255) ,
-'gray61' : (156, 156, 156, 255) ,
-'magenta1' : (255, 0, 255, 255) ,
-'grey52' : (133, 133, 133, 255) ,
-'orangered4' : (139, 37, 0, 255) ,
-'palegreen' : (152, 251, 152, 255) ,
-'gray86' : (219, 219, 219, 255) ,
-'grey80' : (204, 204, 204, 255) ,
-'seashell' : (255, 245, 238, 255) ,
-'royalblue' : (65, 105, 225, 255) ,
-'firebrick3' : (205, 38, 38, 255) ,
-'blue4' : (0, 0, 139, 255) ,
-'peru' : (205, 133, 63, 255) ,
-'gray60' : (153, 153, 153, 255) ,
-'aquamarine' : (127, 255, 212, 255) ,
-'grey53' : (135, 135, 135, 255) ,
-'tan4' : (139, 90, 43, 255) ,
-'darkgoldenrod' : (184, 134, 11, 255) ,
-'tan2' : (238, 154, 73, 255) ,
-'tan1' : (255, 165, 79, 255) ,
-'darkslategray' : (47, 79, 79, 255) ,
-'royalblue3' : (58, 95, 205, 255) ,
-'red2' : (238, 0, 0, 255) ,
-'red1' : (255, 0, 0, 255) ,
-'dodgerblue' : (30, 144, 255, 255) ,
-'violetred4' : (139, 34, 82, 255) ,
-'lightyellow' : (255, 255, 224, 255) ,
-'paleturquoise1' : (187, 255, 255, 255) ,
-'firebrick2' : (238, 44, 44, 255) ,
-'mediumaquamarine' : (102, 205, 170, 255) ,
-'lemonchiffon' : (255, 250, 205, 255) ,
-'chocolate' : (210, 105, 30, 255) ,
-'orchid4' : (139, 71, 137, 255) ,
-'maroon' : (176, 48, 96, 255) ,
-'gray38' : (97, 97, 97, 255) ,
-'darkorange4' : (139, 69, 0, 255) ,
-'mintcream' : (245, 255, 250, 255) ,
-'darkorange1' : (255, 127, 0, 255) ,
-'antiquewhite' : (250, 235, 215, 255) ,
-'darkorange2' : (238, 118, 0, 255) ,
-'grey18' : (46, 46, 46, 255) ,
-'grey19' : (48, 48, 48, 255) ,
-'grey38' : (97, 97, 97, 255) ,
-'moccasin' : (255, 228, 181, 255) ,
-'grey10' : (26, 26, 26, 255) ,
-'chocolate1' : (255, 127, 36, 255) ,
-'chocolate2' : (238, 118, 33, 255) ,
-'chocolate3' : (205, 102, 29, 255) ,
-'saddlebrown' : (139, 69, 19, 255) ,
-'grey15' : (38, 38, 38, 255) ,
-'darkslateblue' : (72, 61, 139, 255) ,
-'lightskyblue' : (135, 206, 250, 255) ,
-'gray69' : (176, 176, 176, 255) ,
-'gray68' : (173, 173, 173, 255) ,
-'deeppink' : (255, 20, 147, 255) ,
-'gray65' : (166, 166, 166, 255) ,
-'gray64' : (163, 163, 163, 255) ,
-'gray67' : (171, 171, 171, 255) ,
-'gray66' : (168, 168, 168, 255) ,
-'gray25' : (64, 64, 64, 255) ,
-'coral' : (255, 127, 80, 255) ,
-'gray63' : (161, 161, 161, 255) ,
-'gray62' : (158, 158, 158, 255) ,
-'goldenrod4' : (139, 105, 20, 255) ,
-'grey35' : (89, 89, 89, 255) ,
-'gray89' : (227, 227, 227, 255) ,
-'goldenrod1' : (255, 193, 37, 255) ,
-'goldenrod2' : (238, 180, 34, 255) ,
-'goldenrod3' : (205, 155, 29, 255) ,
-'springgreen1' : (0, 255, 127, 255) ,
-'springgreen2' : (0, 238, 118, 255) ,
-'springgreen3' : (0, 205, 102, 255) ,
-'springgreen4' : (0, 139, 69, 255) ,
-'mistyrose1' : (255, 228, 225, 255) ,
-'sandybrown' : (244, 164, 96, 255) ,
-'grey30' : (77, 77, 77, 255) ,
-'seashell2' : (238, 229, 222, 255) ,
-'seashell3' : (205, 197, 191, 255) ,
-'tan' : (210, 180, 140, 255) ,
-'seashell1' : (255, 245, 238, 255) ,
-'mistyrose3' : (205, 183, 181, 255) ,
-'magenta' : (255, 0, 255, 255) ,
-'pink' : (255, 192, 203, 255) ,
-'ivory2' : (238, 238, 224, 255) ,
-'ivory1' : (255, 255, 240, 255) ,
-'lightcyan2' : (209, 238, 238, 255) ,
-'mediumseagreen' : (60, 179, 113, 255) ,
-'ivory4' : (139, 139, 131, 255) ,
-'darkorange' : (255, 140, 0, 255) ,
-'powderblue' : (176, 224, 230, 255) ,
-'dodgerblue1' : (30, 144, 255, 255) ,
-'gray95' : (242, 242, 242, 255) ,
-'firebrick1' : (255, 48, 48, 255) ,
-'gray7' : (18, 18, 18, 255) ,
-'mistyrose4' : (139, 125, 123, 255) ,
-'tomato' : (255, 99, 71, 255) ,
-'indianred2' : (238, 99, 99, 255) ,
-'steelblue2' : (92, 172, 238, 255) ,
-'gray100' : (255, 255, 255, 255) ,
-'seashell4' : (139, 134, 130, 255) ,
-'grey89' : (227, 227, 227, 255) ,
-'grey88' : (224, 224, 224, 255) ,
-'grey87' : (222, 222, 222, 255) ,
-'grey86' : (219, 219, 219, 255) ,
-'grey85' : (217, 217, 217, 255) ,
-'grey84' : (214, 214, 214, 255) ,
-'midnightblue' : (25, 25, 112, 255) ,
-'grey82' : (209, 209, 209, 255) ,
-'grey81' : (207, 207, 207, 255) ,
-'yellow3' : (205, 205, 0, 255) ,
-'ivory3' : (205, 205, 193, 255) ,
-'grey22' : (56, 56, 56, 255) ,
-'gray85' : (217, 217, 217, 255) ,
-'violetred3' : (205, 50, 120, 255) ,
-'dodgerblue2' : (28, 134, 238, 255) ,
-'gray42' : (107, 107, 107, 255) ,
-'sienna2' : (238, 121, 66, 255) ,
-'grey72' : (184, 184, 184, 255) ,
-'grey73' : (186, 186, 186, 255) ,
-'grey70' : (179, 179, 179, 255) ,
-'palevioletred' : (219, 112, 147, 255) ,
-'lightslategray' : (119, 136, 153, 255) ,
-'grey77' : (196, 196, 196, 255) ,
-'grey74' : (189, 189, 189, 255) ,
-'slategray1' : (198, 226, 255, 255) ,
-'pink1' : (255, 181, 197, 255) ,
-'mediumpurple1' : (171, 130, 255, 255) ,
-'pink3' : (205, 145, 158, 255) ,
-'antiquewhite4' : (139, 131, 120, 255) ,
-'lightpink1' : (255, 174, 185, 255) ,
-'honeydew2' : (224, 238, 224, 255) ,
-'khaki4' : (139, 134, 78, 255) ,
-'darkolivegreen4' : (110, 139, 61, 255) ,
-'gray45' : (115, 115, 115, 255) ,
-'slategray3' : (159, 182, 205, 255) ,
-'darkolivegreen1' : (202, 255, 112, 255) ,
-'khaki1' : (255, 246, 143, 255) ,
-'khaki2' : (238, 230, 133, 255) ,
-'khaki3' : (205, 198, 115, 255) ,
-'lavenderblush' : (255, 240, 245, 255) ,
-'honeydew4' : (131, 139, 131, 255) ,
-'salmon3' : (205, 112, 84, 255) ,
-'salmon2' : (238, 130, 98, 255) ,
-'gray92' : (235, 235, 235, 255) ,
-'salmon4' : (139, 76, 57, 255) ,
-'gray49' : (125, 125, 125, 255) ,
-'gray48' : (122, 122, 122, 255) ,
-'linen' : (250, 240, 230, 255) ,
-'burlywood1' : (255, 211, 155, 255) ,
-'green' : (0, 255, 0, 255) ,
-'gray47' : (120, 120, 120, 255) ,
-'blueviolet' : (138, 43, 226, 255) ,
-'brown2' : (238, 59, 59, 255) ,
-'brown3' : (205, 51, 51, 255) ,
-'peachpuff' : (255, 218, 185, 255) ,
-'brown4' : (139, 35, 35, 255) ,
-'firebrick4' : (139, 26, 26, 255) ,
-'azure1' : (240, 255, 255, 255) ,
-'azure3' : (193, 205, 205, 255) ,
-'azure2' : (224, 238, 238, 255) ,
-'azure4' : (131, 139, 139, 255) ,
-'tomato4' : (139, 54, 38, 255) ,
-'orange4' : (139, 90, 0, 255) ,
-'firebrick' : (178, 34, 34, 255) ,
-'indianred' : (205, 92, 92, 255) ,
-'orange1' : (255, 165, 0, 255) ,
-'orange3' : (205, 133, 0, 255) ,
-'orange2' : (238, 154, 0, 255) ,
-'darkolivegreen' : (85, 107, 47, 255) ,
-'gray2' : (5, 5, 5, 255) ,
-'slategrey' : (112, 128, 144, 255) ,
-'gray81' : (207, 207, 207, 255) ,
-'darkred' : (139, 0, 0, 255) ,
-'gray3' : (8, 8, 8, 255) ,
-'lightsteelblue1' : (202, 225, 255, 255) ,
-'lightsteelblue2' : (188, 210, 238, 255) ,
-'lightsteelblue3' : (162, 181, 205, 255) ,
-'lightsteelblue4' : (110, 123, 139, 255) ,
-'tomato3' : (205, 79, 57, 255) ,
-'gray43' : (110, 110, 110, 255) ,
-'darkgoldenrod4' : (139, 101, 8, 255) ,
-'grey50' : (127, 127, 127, 255) ,
-'yellow4' : (139, 139, 0, 255) ,
-'mediumorchid' : (186, 85, 211, 255) ,
-'yellow2' : (238, 238, 0, 255) ,
-'darkgoldenrod2' : (238, 173, 14, 255) ,
-'darkgoldenrod3' : (205, 149, 12, 255) ,
-'chartreuse' : (127, 255, 0, 255) ,
-'mediumblue' : (0, 0, 205, 255) ,
-'gray4' : (10, 10, 10, 255) ,
-'springgreen' : (0, 255, 127, 255) ,
-'orange' : (255, 165, 0, 255) ,
-'gray5' : (13, 13, 13, 255) ,
-'lightsalmon' : (255, 160, 122, 255) ,
-'gray19' : (48, 48, 48, 255) ,
-'turquoise' : (64, 224, 208, 255) ,
-'lightseagreen' : (32, 178, 170, 255) ,
-'grey8' : (20, 20, 20, 255) ,
-'grey9' : (23, 23, 23, 255) ,
-'grey6' : (15, 15, 15, 255) ,
-'grey7' : (18, 18, 18, 255) ,
-'grey4' : (10, 10, 10, 255) ,
-'grey5' : (13, 13, 13, 255) ,
-'grey2' : (5, 5, 5, 255) ,
-'grey3' : (8, 8, 8, 255) ,
-'grey0' : (0, 0, 0, 255) ,
-'grey1' : (3, 3, 3, 255) ,
-'gray50' : (127, 127, 127, 255) ,
-'goldenrod' : (218, 165, 32, 255) ,
-'grey58' : (148, 148, 148, 255) ,
-'grey59' : (150, 150, 150, 255) ,
-'gray51' : (130, 130, 130, 255) ,
-'grey54' : (138, 138, 138, 255) ,
-'mediumorchid4' : (122, 55, 139, 255) ,
-'grey56' : (143, 143, 143, 255) ,
-'navajowhite3' : (205, 179, 139, 255) ,
-'mediumorchid1' : (224, 102, 255, 255) ,
-'grey51' : (130, 130, 130, 255) ,
-'mediumorchid3' : (180, 82, 205, 255) ,
-'mediumorchid2' : (209, 95, 238, 255) ,
-'cyan2' : (0, 238, 238, 255) ,
-'cyan3' : (0, 205, 205, 255) ,
-'gray23' : (59, 59, 59, 255) ,
-'cyan1' : (0, 255, 255, 255) ,
-'darkgreen' : (0, 100, 0, 255) ,
-'gray24' : (61, 61, 61, 255) ,
-'cyan4' : (0, 139, 139, 255) ,
-'darkviolet' : (148, 0, 211, 255) ,
-'peachpuff4' : (139, 119, 101, 255) ,
-'gray28' : (71, 71, 71, 255) ,
-'slateblue4' : (71, 60, 139, 255) ,
-'slateblue3' : (105, 89, 205, 255) ,
-'peachpuff1' : (255, 218, 185, 255) ,
-'peachpuff2' : (238, 203, 173, 255) ,
-'peachpuff3' : (205, 175, 149, 255) ,
-'gray29' : (74, 74, 74, 255) ,
-'paleturquoise' : (175, 238, 238, 255) ,
-'darkgray' : (169, 169, 169, 255) ,
-'grey25' : (64, 64, 64, 255) ,
-'darkmagenta' : (139, 0, 139, 255) ,
-'palegoldenrod' : (238, 232, 170, 255) ,
-'grey64' : (163, 163, 163, 255) ,
-'grey12' : (31, 31, 31, 255) ,
-'deeppink3' : (205, 16, 118, 255) ,
-'gray79' : (201, 201, 201, 255) ,
-'gray83' : (212, 212, 212, 255) ,
-'deeppink2' : (238, 18, 137, 255) ,
-'burlywood4' : (139, 115, 85, 255) ,
-'palevioletred4' : (139, 71, 93, 255) ,
-'deeppink1' : (255, 20, 147, 255) ,
-'slateblue2' : (122, 103, 238, 255) ,
-'grey46' : (117, 117, 117, 255) ,
-'royalblue4' : (39, 64, 139, 255) ,
-'yellowgreen' : (154, 205, 50, 255) ,
-'royalblue1' : (72, 118, 255, 255) ,
-'slateblue1' : (131, 111, 255, 255) ,
-'lightgoldenrod3' : (205, 190, 112, 255) ,
-'lightgoldenrod2' : (238, 220, 130, 255) ,
-'navy' : (0, 0, 128, 255) ,
-'orchid' : (218, 112, 214, 255) ,
-'ghostwhite' : (248, 248, 255, 255) ,
-'purple' : (160, 32, 240, 255) ,
-'darkkhaki' : (189, 183, 107, 255) ,
-'grey45' : (115, 115, 115, 255) ,
-'gray94' : (240, 240, 240, 255) ,
-'wheat4' : (139, 126, 102, 255) ,
-'gray96' : (245, 245, 245, 255) ,
-'gray97' : (247, 247, 247, 255) ,
-'wheat1' : (255, 231, 186, 255) ,
-'gray91' : (232, 232, 232, 255) ,
-'wheat3' : (205, 186, 150, 255) ,
-'wheat2' : (238, 216, 174, 255) ,
-'indianred4' : (139, 58, 58, 255) ,
-'coral2' : (238, 106, 80, 255) ,
-'coral1' : (255, 114, 86, 255) ,
-'violetred' : (208, 32, 144, 255) ,
-'rosybrown3' : (205, 155, 155, 255) ,
-'deepskyblue2' : (0, 178, 238, 255) ,
-'deepskyblue1' : (0, 191, 255, 255) ,
-'bisque' : (255, 228, 196, 255) ,
-'grey49' : (125, 125, 125, 255) ,
-'khaki' : (240, 230, 140, 255) ,
-'wheat' : (245, 222, 179, 255) ,
-'lightslateblue' : (132, 112, 255, 255) ,
-'mediumpurple3' : (137, 104, 205, 255) ,
-'gray55' : (140, 140, 140, 255) ,
-'deepskyblue' : (0, 191, 255, 255) ,
-'gray98' : (250, 250, 250, 255) ,
-'steelblue' : (70, 130, 180, 255) ,
-'aliceblue' : (240, 248, 255, 255) ,
-'lightskyblue2' : (164, 211, 238, 255) ,
-'lightskyblue3' : (141, 182, 205, 255) ,
-'lightslategrey' : (119, 136, 153, 255) ,
-'blue3' : (0, 0, 205, 255) ,
-'blue2' : (0, 0, 238, 255) ,
-'gainsboro' : (220, 220, 220, 255) ,
-'grey76' : (194, 194, 194, 255) ,
-'purple3' : (125, 38, 205, 255) ,
-'plum4' : (139, 102, 139, 255) ,
-'gray56' : (143, 143, 143, 255) ,
-'plum3' : (205, 150, 205, 255) ,
-'plum' : (221, 160, 221, 255) ,
-'lightgrey' : (211, 211, 211, 255) ,
-'mediumslateblue' : (123, 104, 238, 255) ,
-'mistyrose' : (255, 228, 225, 255) ,
-'lightcyan1' : (224, 255, 255, 255) ,
-'grey71' : (181, 181, 181, 255) ,
-'darksalmon' : (233, 150, 122, 255) ,
-'beige' : (245, 245, 220, 255) ,
-'grey24' : (61, 61, 61, 255) ,
-'azure' : (240, 255, 255, 255) ,
-'honeydew1' : (240, 255, 240, 255) ,
-'slategray2' : (185, 211, 238, 255) ,
-'dodgerblue3' : (24, 116, 205, 255) ,
-'slategray4' : (108, 123, 139, 255) ,
-'grey27' : (69, 69, 69, 255) ,
-'lightcyan3' : (180, 205, 205, 255) ,
-'cornsilk' : (255, 248, 220, 255) ,
-'tomato1' : (255, 99, 71, 255) ,
-'gray57' : (145, 145, 145, 255) ,
-'mediumvioletred' : (199, 21, 133, 255) ,
-'tomato2' : (238, 92, 66, 255) ,
-'snow4' : (139, 137, 137, 255) ,
-'grey75' : (191, 191, 191, 255) ,
-'snow2' : (238, 233, 233, 255) ,
-'snow3' : (205, 201, 201, 255) ,
-'snow1' : (255, 250, 250, 255) ,
-'grey23' : (59, 59, 59, 255) ,
-'cornsilk3' : (205, 200, 177, 255) ,
-'lightcoral' : (240, 128, 128, 255) ,
-'orangered' : (255, 69, 0, 255) ,
-'navajowhite' : (255, 222, 173, 255) ,
-'mediumpurple2' : (159, 121, 238, 255) ,
-'slategray' : (112, 128, 144, 255) ,
-'pink2' : (238, 169, 184, 255) ,
-'grey29' : (74, 74, 74, 255) ,
-'grey28' : (71, 71, 71, 255) ,
-'gray82' : (209, 209, 209, 255) ,
-'burlywood' : (222, 184, 135, 255) ,
-'mediumpurple4' : (93, 71, 139, 255) ,
-'mediumspringgreen' : (0, 250, 154, 255) ,
-'grey26' : (66, 66, 66, 255) ,
-'grey21' : (54, 54, 54, 255) ,
-'grey20' : (51, 51, 51, 255) ,
-'blanchedalmond' : (255, 235, 205, 255) ,
-'pink4' : (139, 99, 108, 255) ,
-'gray78' : (199, 199, 199, 255) ,
-'tan3' : (205, 133, 63, 255) ,
-'gray76' : (194, 194, 194, 255) ,
-'gray77' : (196, 196, 196, 255) ,
-'white' : (255, 255, 255, 255) ,
-'gray75' : (191, 191, 191, 255) ,
-'gray72' : (184, 184, 184, 255) ,
-'gray73' : (186, 186, 186, 255) ,
-'gray70' : (179, 179, 179, 255) ,
-'gray71' : (181, 181, 181, 255) ,
-'lightgray' : (211, 211, 211, 255) ,
-'ivory' : (255, 255, 240, 255) ,
-'gray46' : (117, 117, 117, 255) ,
-'gray74' : (189, 189, 189, 255) ,
-'lightyellow3' : (205, 205, 180, 255) ,
-'lightpink2' : (238, 162, 173, 255) ,
-'lightpink3' : (205, 140, 149, 255) ,
-'paleturquoise4' : (102, 139, 139, 255) ,
-'lightpink4' : (139, 95, 101, 255) ,
-'paleturquoise3' : (150, 205, 205, 255) ,
-'seagreen4' : (46, 139, 87, 255) ,
-'seagreen3' : (67, 205, 128, 255) ,
-'seagreen2' : (78, 238, 148, 255) ,
-'seagreen1' : (84, 255, 159, 255) ,
-'paleturquoise2' : (174, 238, 238, 255) ,
-'gray52' : (133, 133, 133, 255) ,
-'cornsilk4' : (139, 136, 120, 255) ,
-'cornsilk2' : (238, 232, 205, 255) ,
-'darkolivegreen3' : (162, 205, 90, 255) ,
-'cornsilk1' : (255, 248, 220, 255) ,
-'limegreen' : (50, 205, 50, 255) ,
-'darkolivegreen2' : (188, 238, 104, 255) ,
-'grey' : (190, 190, 190, 255) ,
-'violetred2' : (238, 58, 140, 255) ,
-'salmon1' : (255, 140, 105, 255) ,
-'grey92' : (235, 235, 235, 255) ,
-'grey93' : (237, 237, 237, 255) ,
-'grey94' : (240, 240, 240, 255) ,
-'grey95' : (242, 242, 242, 255) ,
-'grey96' : (245, 245, 245, 255) ,
-'grey83' : (212, 212, 212, 255) ,
-'grey98' : (250, 250, 250, 255) ,
-'lightgoldenrod1' : (255, 236, 139, 255) ,
-'palegreen1' : (154, 255, 154, 255) ,
-'red3' : (205, 0, 0, 255) ,
-'palegreen3' : (124, 205, 124, 255) ,
-'palegreen2' : (144, 238, 144, 255) ,
-'palegreen4' : (84, 139, 84, 255) ,
-'cadetblue' : (95, 158, 160, 255) ,
-'violet' : (238, 130, 238, 255) ,
-'mistyrose2' : (238, 213, 210, 255) ,
-'slateblue' : (106, 90, 205, 255) ,
-'grey43' : (110, 110, 110, 255) ,
-'grey90' : (229, 229, 229, 255) ,
-'gray35' : (89, 89, 89, 255) ,
-'turquoise3' : (0, 197, 205, 255) ,
-'turquoise2' : (0, 229, 238, 255) ,
-'burlywood3' : (205, 170, 125, 255) ,
-'burlywood2' : (238, 197, 145, 255) ,
-'lightcyan4' : (122, 139, 139, 255) ,
-'rosybrown' : (188, 143, 143, 255) ,
-'turquoise4' : (0, 134, 139, 255) ,
-'whitesmoke' : (245, 245, 245, 255) ,
-'lightblue' : (173, 216, 230, 255) ,
-'grey40' : (102, 102, 102, 255) ,
-'gray40' : (102, 102, 102, 255) ,
-'honeydew3' : (193, 205, 193, 255) ,
-'dimgray' : (105, 105, 105, 255) ,
-'grey47' : (120, 120, 120, 255) ,
-'seagreen' : (46, 139, 87, 255) ,
-'red4' : (139, 0, 0, 255) ,
-'grey14' : (36, 36, 36, 255) ,
-'snow' : (255, 250, 250, 255) ,
-'darkorchid1' : (191, 62, 255, 255) ,
-'gray58' : (148, 148, 148, 255) ,
-'gray59' : (150, 150, 150, 255) ,
-'cadetblue4' : (83, 134, 139, 255) ,
-'cadetblue3' : (122, 197, 205, 255) ,
-'cadetblue2' : (142, 229, 238, 255) ,
-'cadetblue1' : (152, 245, 255, 255) ,
-'olivedrab4' : (105, 139, 34, 255) ,
-'purple4' : (85, 26, 139, 255) ,
-'gray20' : (51, 51, 51, 255) ,
-'grey44' : (112, 112, 112, 255) ,
-'purple1' : (155, 48, 255, 255) ,
-'olivedrab1' : (192, 255, 62, 255) ,
-'olivedrab2' : (179, 238, 58, 255) ,
-'olivedrab3' : (154, 205, 50, 255) ,
-'orangered3' : (205, 55, 0, 255) ,
-'orangered2' : (238, 64, 0, 255) ,
-'orangered1' : (255, 69, 0, 255) ,
-'darkorchid' : (153, 50, 204, 255) ,
-'thistle3' : (205, 181, 205, 255) ,
-'thistle2' : (238, 210, 238, 255) ,
-'thistle1' : (255, 225, 255, 255) ,
-'salmon' : (250, 128, 114, 255) ,
-'gray93' : (237, 237, 237, 255) ,
-'thistle4' : (139, 123, 139, 255) ,
-'gray39' : (99, 99, 99, 255) ,
-'lawngreen' : (124, 252, 0, 255) ,
-'hotpink3' : (205, 96, 144, 255) ,
-'hotpink2' : (238, 106, 167, 255) ,
-'hotpink1' : (255, 110, 180, 255) ,
-'lightgreen' : (144, 238, 144, 255) ,
-'hotpink4' : (139, 58, 98, 255) ,
-'darkseagreen4' : (105, 139, 105, 255) ,
-'darkseagreen3' : (155, 205, 155, 255) ,
-'darkseagreen2' : (180, 238, 180, 255) ,
-'darkseagreen1' : (193, 255, 193, 255) ,
-'deepskyblue4' : (0, 104, 139, 255) ,
-'gray44' : (112, 112, 112, 255) ,
-'navyblue' : (0, 0, 128, 255) ,
-'darkblue' : (0, 0, 139, 255) ,
-'forestgreen' : (34, 139, 34, 255) ,
-'gray53' : (135, 135, 135, 255) ,
-'grey100' : (255, 255, 255, 255) ,
-'brown1' : (255, 64, 64, 255) ,
-}
diff --git a/lib/pygame/compat.py b/lib/pygame/compat.py
deleted file mode 100755
index 514ee36..0000000
--- a/lib/pygame/compat.py
+++ /dev/null
@@ -1,47 +0,0 @@
-"""Python 2.x/3.x compatibility tools"""
-
-import sys
-
-__all__ = ['geterror', 'long_', 'xrange_', 'ord_', 'unichr_',
- 'unicode_', 'raw_input_']
-
-def geterror ():
- return sys.exc_info()[1]
-
-try:
- long_ = long
-except NameError:
- long_ = int
-
-try:
- xrange_ = xrange
-except NameError:
- xrange_ = range
-
-def get_BytesIO():
- try:
- from cStringIO import StringIO as BytesIO
- except ImportError:
- from io import BytesIO
- return BytesIO
-
-def ord_(o):
- try:
- return ord(o)
- except TypeError:
- return o
-
-try:
- unichr_ = unichr
-except NameError:
- unichr_ = chr
-
-try:
- unicode_ = unicode
-except NameError:
- unicode_ = str
-
-try:
- raw_input_ = raw_input
-except NameError:
- raw_input_ = input
diff --git a/lib/pygame/constants.so b/lib/pygame/constants.so
deleted file mode 100644
index 6f0118a..0000000
--- a/lib/pygame/constants.so
+++ /dev/null
Binary files differ
diff --git a/lib/pygame/cursors.py b/lib/pygame/cursors.py
deleted file mode 100755
index 80e20df..0000000
--- a/lib/pygame/cursors.py
+++ /dev/null
@@ -1,300 +0,0 @@
-## pygame - Python Game Library
-## Copyright (C) 2000-2003 Pete Shinners
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Library General Public
-## License as published by the Free Software Foundation; either
-## version 2 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Library General Public License for more details.
-##
-## You should have received a copy of the GNU Library General Public
-## License along with this library; if not, write to the Free
-## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-##
-## Pete Shinners
-## pete@shinners.org
-
-"""Set of cursor resources available for use. These cursors come
-in a sequence of values that are needed as the arguments for
-pygame.mouse.set_cursor(). to dereference the sequence in place
-and create the cursor in one step, call like this;
-pygame.mouse.set_cursor(*pygame.cursors.arrow).
-
-Here is a list of available cursors; arrow, diamond, ball,
- broken_x, tri_left, tri_right
-
-There is also a sample string cursor named 'thickarrow_strings'.
-The compile() function can convert these string cursors into cursor byte data.
-"""
-
-#default pygame black arrow
-arrow = ((16, 16), (0, 0),
- (0x00,0x00,0x40,0x00,0x60,0x00,0x70,0x00,0x78,0x00,0x7C,0x00,0x7E,0x00,0x7F,0x00,
- 0x7F,0x80,0x7C,0x00,0x6C,0x00,0x46,0x00,0x06,0x00,0x03,0x00,0x03,0x00,0x00,0x00),
- (0x40,0x00,0xE0,0x00,0xF0,0x00,0xF8,0x00,0xFC,0x00,0xFE,0x00,0xFF,0x00,0xFF,0x80,
- 0xFF,0xC0,0xFF,0x80,0xFE,0x00,0xEF,0x00,0x4F,0x00,0x07,0x80,0x07,0x80,0x03,0x00))
-
-diamond = ((16, 16), (7, 7),
- (0, 0, 1, 0, 3, 128, 7, 192, 14, 224, 28, 112, 56, 56, 112, 28, 56,
- 56, 28, 112, 14, 224, 7, 192, 3, 128, 1, 0, 0, 0, 0, 0),
- (1, 0, 3, 128, 7, 192, 15, 224, 31, 240, 62, 248, 124, 124, 248, 62,
- 124, 124, 62, 248, 31, 240, 15, 224, 7, 192, 3, 128, 1, 0, 0, 0))
-
-ball = ((16, 16), (7, 7),
- (0, 0, 3, 192, 15, 240, 24, 248, 51, 252, 55, 252, 127, 254, 127, 254,
- 127, 254, 127, 254, 63, 252, 63, 252, 31, 248, 15, 240, 3, 192, 0, 0),
- (3, 192, 15, 240, 31, 248, 63, 252, 127, 254, 127, 254, 255, 255, 255,
- 255, 255, 255, 255, 255, 127, 254, 127, 254, 63, 252, 31, 248, 15, 240,
- 3, 192))
-
-broken_x = ((16, 16), (7, 7),
- (0, 0, 96, 6, 112, 14, 56, 28, 28, 56, 12, 48, 0, 0, 0, 0, 0, 0, 0, 0,
- 12, 48, 28, 56, 56, 28, 112, 14, 96, 6, 0, 0),
- (224, 7, 240, 15, 248, 31, 124, 62, 62, 124, 30, 120, 14, 112, 0, 0, 0,
- 0, 14, 112, 30, 120, 62, 124, 124, 62, 248, 31, 240, 15, 224, 7))
-
-
-tri_left = ((16, 16), (1, 1),
- (0, 0, 96, 0, 120, 0, 62, 0, 63, 128, 31, 224, 31, 248, 15, 254, 15, 254,
- 7, 128, 7, 128, 3, 128, 3, 128, 1, 128, 1, 128, 0, 0),
- (224, 0, 248, 0, 254, 0, 127, 128, 127, 224, 63, 248, 63, 254, 31, 255,
- 31, 255, 15, 254, 15, 192, 7, 192, 7, 192, 3, 192, 3, 192, 1, 128))
-
-tri_right = ((16, 16), (14, 1),
- (0, 0, 0, 6, 0, 30, 0, 124, 1, 252, 7, 248, 31, 248, 127, 240, 127, 240,
- 1, 224, 1, 224, 1, 192, 1, 192, 1, 128, 1, 128, 0, 0),
- (0, 7, 0, 31, 0, 127, 1, 254, 7, 254, 31, 252, 127, 252, 255, 248, 255,
- 248, 127, 240, 3, 240, 3, 224, 3, 224, 3, 192, 3, 192, 1, 128))
-
-
-
-#here is an example string resource cursor. to use this;
-# curs, mask = pygame.cursors.compile_cursor(pygame.cursors.thickarrow_strings, 'X', '.')
-# pygame.mouse.set_cursor((24, 24), (0, 0), curs, mask)
-
-thickarrow_strings = ( #sized 24x24
- "XX ",
- "XXX ",
- "XXXX ",
- "XX.XX ",
- "XX..XX ",
- "XX...XX ",
- "XX....XX ",
- "XX.....XX ",
- "XX......XX ",
- "XX.......XX ",
- "XX........XX ",
- "XX........XXX ",
- "XX......XXXXX ",
- "XX.XXX..XX ",
- "XXXX XX..XX ",
- "XX XX..XX ",
- " XX..XX ",
- " XX..XX ",
- " XX..XX ",
- " XXXX ",
- " XX ",
- " ",
- " ",
- " ",
-)
-
-sizer_x_strings = ( #sized 24x16
- " X X ",
- " XX XX ",
- " X.X X.X ",
- " X..X X..X ",
- " X...XXXXXXXX...X ",
- "X................X ",
- " X...XXXXXXXX...X ",
- " X..X X..X ",
- " X.X X.X ",
- " XX XX ",
- " X X ",
- " ",
- " ",
- " ",
- " ",
- " ",
-)
-sizer_y_strings = ( #sized 16x24
- " X ",
- " X.X ",
- " X...X ",
- " X.....X ",
- " X.......X ",
- "XXXXX.XXXXX ",
- " X.X ",
- " X.X ",
- " X.X ",
- " X.X ",
- " X.X ",
- " X.X ",
- " X.X ",
- "XXXXX.XXXXX ",
- " X.......X ",
- " X.....X ",
- " X...X ",
- " X.X ",
- " X ",
- " ",
- " ",
- " ",
- " ",
- " ",
-)
-sizer_xy_strings = ( #sized 24x16
- "XXXXXXXX ",
- "X.....X ",
- "X....X ",
- "X...X ",
- "X..X.X ",
- "X.X X.X ",
- "XX X.X X ",
- "X X.X XX ",
- " X.XX.X ",
- " X...X ",
- " X...X ",
- " X....X ",
- " X.....X ",
- " XXXXXXXX ",
- " ",
- " ",
-)
-textmarker_strings = ( #sized 8x16
- "ooo ooo ",
- " o ",
- " o ",
- " o ",
- " o ",
- " o ",
- " o ",
- " o ",
- " o ",
- " o ",
- " o ",
- "ooo ooo ",
- " ",
- " ",
- " ",
- " ",
-)
-
-
-
-def compile(strings, black='X', white='.',xor='o'):
- """pygame.cursors.compile(strings, black, white,xor) -> data, mask
-compile cursor strings into cursor data
-
-This takes a set of strings with equal length and computes
-the binary data for that cursor. The string widths must be
-divisible by 8.
-
-The black and white arguments are single letter strings that
-tells which characters will represent black pixels, and which
-characters represent white pixels. All other characters are
-considered clear.
-
-This returns a tuple containing the cursor data and cursor mask
-data. Both these arguments are used when setting a cursor with
-pygame.mouse.set_cursor().
-"""
-
- #first check for consistent lengths
- size = len(strings[0]), len(strings)
- if size[0] % 8 or size[1] % 8:
- raise ValueError("cursor string sizes must be divisible by 8 %s" %
- size)
- for s in strings[1:]:
- if len(s) != size[0]:
- raise ValueError("Cursor strings are inconsistent lengths")
-
- #create the data arrays.
- #this could stand a little optimizing
- maskdata = []
- filldata = []
- maskitem = fillitem = 0
- step = 8
- for s in strings:
- for c in s:
- maskitem = maskitem << 1
- fillitem = fillitem << 1
- step = step - 1
- if c == black:
- maskitem = maskitem | 1
- elif c == white:
- maskitem = maskitem | 1
- fillitem = fillitem | 1
- elif c == xor:
- fillitem = fillitem | 1
- if not step:
- maskdata.append(maskitem)
- filldata.append(fillitem)
- maskitem = fillitem = 0
- step = 8
- return tuple(filldata), tuple(maskdata)
-
-
-
-
-def load_xbm(curs, mask):
- """pygame.cursors.load_xbm(cursorfile, maskfile) -> cursor_args
-reads a pair of XBM files into set_cursor arguments
-
-Arguments can either be filenames or filelike objects
-with the readlines method. Not largely tested, but
-should work with typical XBM files.
-"""
- def bitswap(num):
- val = 0
- for x in range(8):
- b = num&(1<Pygame Installation
-Pygame Installation
-
-
-Python can be built from source, but the easiest way is to
-get a binary package for your type of system and version of Python.
-This document will give you information on either type of installation.
-
-
-Windows Binary Installer
-This is probably the most popular method of installation. If you are
-running on windows, it is highly recommended you use this form
-of installing. The installers come with with nearly everything
-you need, and have an easy point and click installers.
-
-The first thing you will need is an installation of Python. Python
-binary installers make it easy to get this done. Pygame binaries
-usually come for the latest 2 releases of Python, so you'll want to be fairly
-up to date.
-
-Once that is in place, you want to download the appropriate
-windows binary. From the pygame downloads page you can find the .EXE
-file you need. This will automatically install all of pygame and all the SDL
-dependencies. The windows binaries have filenames like this; "http://www3.telus.net/len_l/pygame-1.8.0release.win32-py2.5.msi".
-This would be the installer for pygame version 1.8.0, for Python version 2.5. You
-shouldn't have trouble finding the correct binary from the "Windows" section
-of the download page.
-http://www.pygame.org/download.shtml.
-
-You will also probably want to install the windows documentation and
-installation package. This will add easy links to the different documentation
-and games that come with pygame. The installer for this is found
-next to the other windows binary downloads. The filename looks like this;
-"pygame-docs-1.8.0.exe". And this would install the documentation and
-examples for pygame-1.8.0
-
-One other thing the windows binaries are missing is the Numeric or numpy Python
-packages. You can easily install this separately and it will allow you to use
-the pygame "surfarray" module. This module is optional, so there is no need
-to do this. A Numeric for Windows python 2.5 can be found on the download page: http://www.pygame.org/download.shtml. There are older binary installers from the Numeric download page.
-http://sourceforge.net/project/showfiles.php?group_id=1369.
-
PixelArray, which is built into pygame 1.8+, and is usually quite a lot faster is the recommended array implementation to use. Numpy is newer than Numeric, however both are not entirely compatible.
-
-Unix Binary Packages
-For many unix systems, the easiest way to install pygame is
-from source. Still, there are binary packages available for
-different distributions.
-
-There are several binary RPM packages for linux machines. These are
-actually a little bit of work to install, since you will also need several
-RPM packages for the dependencies. There is a good chance
-your linux distribution came with the needed dependencies (like Python
-and SDL). There are binary RPMs available from the website for each dependency.
-
-For debian systems, pygame is actively maintained in the debian
-archives. Visit the debian pygame page for more information.
-http://packages.qa.debian.org/p/pygame.html
-
-FreeBSD also has an active pygame package. While techinicaly it
-isn't binary, it is automatically built and installed by the
-ports manager. See the FreeBSD package page for more information.
-http://www.freebsdports.info/ports/devel/py-game.html
-
-Gentoo has a builtin package for pygame. This is compiled for
-your system as it installs, similar to BSD,
-http://packages.gentoo.org/package/dev-python/pygame
-
-
-Mac OS X Binaries
-For Mac OS X 10.3 and above, binary packages are available from
-http://www.pygame.org/download.shtml
-
-This package includes almost of the dependencies required for pygame
-(SDL, SDL_image, etc.), but you need PyObjC 1.2 or later, and may
-also want to get Numeric, numpy and PyOpenGL. A PyObjC 1.4 installer is also made available on the download page.
-
If you want to use the Apple system python, you will need to compile from source at this time - since most people prefer to leave the system python alone, and use the python downloaded from python.org. See http://pygame.org/wiki/MacCompile for current instructions for compiling from source on Mac OSX.
-
pygame is also available from the fink, and macports distributions.
-
-To build self-contained pygame applications, you should use py2app.
-There is an example in:
-/Developer/Python/pygame/Examples/macosx/aliens_app_example
-
-
-
-
-Installing From Source
-Compiling and installing pygame is handled by Python's distutils.
-Pygame also comes with some scripts to automatically configure
-the flags needed to build pygame. Use the "setup.py" script to
-start the installation.
-
-The first time you run the setup script, it will call the
-"config.py" script. This will build a "Setup" file which
-stores all the information needed to compile. The "config.py"
-will do a good job of detecting what dependencies are available
-and where they are located. If it isn't perfect, it is easy to
-build your own, or edit the created "Setup" text file. This
-"Setup" file is a simple Makefile-like text file. It defines
-variables needed to use each dependency, and then enables
-all the pygame modules with found dependencies. If you have
-trouble compiling, you should be able to easily fix any problems
-inside the "Setup" file.
-
-Running the "setup.py" script will call distutils to build and
-install the pygame package. Distutils actually supports a wide
-variety of compile and install options. running "python setup.py help"
-will start to show you the different options available. You can
-change many things like install locations, compiler to use, and more.
-Calling the "setup.py" script with no arguments and it will just
-ask you if you want the default flags needed to compile and install.
-
-
-Windows Compiling Info
-
-You can compile pygame on windows with mingw (gcc for windows) and also with visual studio.
-
-Up to date details can be found here:
-http://pygame.org/wiki/CompileWindows
-
-
-
-
-Unix Compiling Info
-Compiling from linux shouldn't give you any problems. One thing
-you must keep in mind is that most linux RPM packages separate the
-actual library from the "dev" files needed to compile. To build you
-will need to make sure the packages like "SDL-dev" are
-installed.
-
-You can check to see if SDL is ready to be built from by running
-the command sdl-config and seeing if it is found. If the
-sdl-config script is not on the path (or you have more than
-one?) Set the environment variable SDL_CONFIG to its location.
-
-Sometimes you will have the SDL libraries installed in once
-location, and the other SDL libraries in another. This tricks the
-pygame config scripts, but you can help it out by setting the
-environment LOCALBASE to a path prefix where the other libraries
-are. The common case for this is SDL installed in /usr and other
-SDL libs installed in /usr/local. The command for this situation
-is "LOCALBASE=/usr/local python setup.py install".
-
-
-Mac OS X Compiling Info
-
-Up to date instructions for compiling on Mac OS X can be found here:
-http://pygame.org/wiki/MacCompile
-
-
-
-
-
-