Commits

Anonymous committed 25886fe

Bugfix and test for transform.threshold, updated docs (thanks Nirav), added basic tagging to run_tests.py/test_runner.py.

Comments (0)

Files changed (12)

docs/ref/color.html

-
-<html>
-<title>color - Pygame Documentation</title>
-<body bgcolor=#aaeebb text=#000000 link=#331111 vlink=#331111>
-
-
-<table cellpadding=0 cellspacing=0 border=0 style='border: 3px solid black;' width='100%'>
-<tr>
-<td bgcolor='#c2fc20' style='padding: 6px;' align=center valign=center><a href='http://www.pygame.org/'><img src='../pygame_tiny.gif' border=0 width=200 height=60></a><br><b>pygame documentation</b></td>
-<td bgcolor='#6aee28' style='border-left: 3px solid black; padding: 6px;' align=center valign=center>
-	||&nbsp;
-	<a href=http://www.pygame.org>Pygame Home</a> &nbsp;||&nbsp;
-	<a href=../index.html>Help Contents</a> &nbsp;||
-	<a href=index.html>Reference Index</a> &nbsp;||
-	<br>&nbsp;<br>
-	
-<a href="cdrom.html">Cdrom</a>&nbsp;||&nbsp;
-<a href="color.html">Color</a>&nbsp;||&nbsp;
-<a href="cursors.html">Cursors</a>&nbsp;||&nbsp;
-<a href="display.html">Display</a>&nbsp;||&nbsp;
-<a href="draw.html">Draw</a>&nbsp;||&nbsp;
-<a href="event.html">Event</a>&nbsp;||&nbsp;
-<a href="font.html">Font</a>&nbsp;||&nbsp;
-<a href="image.html">Image</a>&nbsp;||&nbsp;
-<a href="joystick.html">Joystick</a>&nbsp;||&nbsp;
-<a href="key.html">Key</a>&nbsp;||&nbsp;
-<a href="mask.html">Mask</a>&nbsp;||&nbsp;
-<a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
-<a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
-<a href="movie.html">Movie</a>&nbsp;||&nbsp;
-<a href="music.html">Music</a>&nbsp;||&nbsp;
-<a href="overlay.html">Overlay</a>&nbsp;||&nbsp;
-<a href="pixelarray.html">Pixelarray</a>&nbsp;||&nbsp;
-<a href="pygame.html">Pygame</a>&nbsp;||&nbsp;
-<a href="rect.html">Rect</a>&nbsp;||&nbsp;
-<a href="scrap.html">Scrap</a>&nbsp;||&nbsp;
-<a href="sndarray.html">Sndarray</a>&nbsp;||&nbsp;
-<a href="sprite.html">Sprite</a>&nbsp;||&nbsp;
-<a href="surface.html">Surface</a>&nbsp;||&nbsp;
-<a href="surfarray.html">Surfarray</a>&nbsp;||&nbsp;
-<a href="time.html">Time</a>&nbsp;||&nbsp;
-<a href="transform.html">Transform</a>
-</td></tr></table>
-<br>
-
-
-<a name="pygame.Color">
-<big><b>pygame.Color</big></b><br><ul>
-  <i>pygame object for color representations</i><br>
-  <tt>pygame.Color(name): Return Color</tt><br>
-  <tt>pygame.Color(r, g, b, a): Return Color</tt><br>
-  <tt>pygame.Color(rgbvalue): Return Color</tt><br>
-<ul><small><table>
-  <tr><td><a href="color.html#Color.r">Color.r</a> - <font size=-1>Gets or sets the red value of the Color.</font></td><td>Gets or sets the red value of the Color.</td></tr>
-  <tr><td><a href="color.html#Color.g">Color.g</a> - <font size=-1>Gets or sets the green value of the Color.</font></td><td>Gets or sets the green value of the Color.</td></tr>
-  <tr><td><a href="color.html#Color.b">Color.b</a> - <font size=-1>Gets or sets the blue value of the Color.</font></td><td>Gets or sets the blue value of the Color.</td></tr>
-  <tr><td><a href="color.html#Color.a">Color.a</a> - <font size=-1>Gets or sets the alpha value of the Color.</font></td><td>Gets or sets the alpha value of the Color.</td></tr>
-  <tr><td><a href="color.html#Color.cmy">Color.cmy</a> - <font size=-1>Gets or sets the CMY representation of the Color.</font></td><td>Gets or sets the CMY representation of the Color.</td></tr>
-  <tr><td><a href="color.html#Color.hsva">Color.hsva</a> - <font size=-1>Gets or sets the HSVA representation of the Color.</font></td><td>Gets or sets the HSVA representation of the Color.</td></tr>
-  <tr><td><a href="color.html#Color.hsla">Color.hsla</a> - <font size=-1>Gets or sets the HSLA representation of the Color.</font></td><td>Gets or sets the HSLA representation of the Color.</td></tr>
-  <tr><td><a href="color.html#Color.i1i2i3">Color.i1i2i3</a> - <font size=-1>Gets or sets the I1I2I3 representation of the Color.</font></td><td>Gets or sets the I1I2I3 representation of the Color.</td></tr>
-  <tr><td><a href="color.html#Color.normalize">Color.normalize</a> - <font size=-1>Returns the normalized RGBA values of the Color.</font></td><td>Returns the normalized RGBA values of the Color.</td></tr>
-  <tr><td><a href="color.html#Color.correct_gamma">Color.correct_gamma</a> - <font size=-1>Applies a certain gamma value to the Color.</font></td><td>Applies a certain gamma value to the Color.</td></tr>
-</table></small></ul>
-<p>The Color class represents <tt>RGBA</tt> color values using a value range of 0-255. It allows basic arithmetic operations to create new colors, supports conversions to other color spaces such as <tt>HSV</tt> or <tt>HSL</tt> and lets you adjust single color channels. </p>
-<p>New in pygame <tt>1.8.1</tt>. </p>
-<!--COMMENTS:pygame.Color--> &nbsp;<br> 
-
-
-<a name="Color.r">
-<big><b>Color.r</big></b><br><ul>
-  <i>Gets or sets the red value of the Color.</i><br>
-  <tt>Color.r: Return int</tt><br>
-<p>The red value of the Color. </p>
-<!--COMMENTS:Color.r--> &nbsp;<br> 
-<br></ul>
-
-
-<a name="Color.g">
-<big><b>Color.g</big></b><br><ul>
-  <i>Gets or sets the green value of the Color.</i><br>
-  <tt>Color.g: Return int</tt><br>
-<p>The green value of the Color. </p>
-<!--COMMENTS:Color.g--> &nbsp;<br> 
-<br></ul>
-
-
-<a name="Color.b">
-<big><b>Color.b</big></b><br><ul>
-  <i>Gets or sets the blue value of the Color.</i><br>
-  <tt>Color.b: Return int</tt><br>
-<p>The blue value of the Color. </p>
-<!--COMMENTS:Color.b--> &nbsp;<br> 
-<br></ul>
-
-
-<a name="Color.a">
-<big><b>Color.a</big></b><br><ul>
-  <i>Gets or sets the alpha value of the Color.</i><br>
-  <tt>Color.a: Return int</tt><br>
-<p>The alpha value of the Color. </p>
-<!--COMMENTS:Color.a--> &nbsp;<br> 
-<br></ul>
-
-
-<a name="Color.cmy">
-<big><b>Color.cmy</big></b><br><ul>
-  <i>Gets or sets the CMY representation of the Color.</i><br>
-  <tt>Color.cmy: Return tuple</tt><br>
-<p>The <tt>CMY</tt> representation of the Color. The <tt>CMY</tt> components are in the ranges <tt>C</tt> = [0, 1], <tt>M</tt> = [0, 1], <tt>Y</tt> = [0, 1]. Note that this will not return the absolutely exact <tt>CMY</tt> values for the set <tt>RGB</tt> values in all cases. Due to the <tt>RGB</tt> mapping from 0-255 and the <tt>CMY</tt> mapping from 0-1 rounding errors may cause the <tt>CMY</tt> values to differ slightly from what you might expect. </p>
-<!--COMMENTS:Color.cmy--> &nbsp;<br> 
-<br></ul>
-
-
-<a name="Color.hsva">
-<big><b>Color.hsva</big></b><br><ul>
-  <i>Gets or sets the HSVA representation of the Color.</i><br>
-  <tt>Color.hsva: Return tuple</tt><br>
-<p>The <tt>HSVA</tt> representation of the Color. The <tt>HSVA</tt> components are in the ranges <tt>H</tt> = [0, 360], <tt>S</tt> = [0, 100], <tt>V</tt> = [0, 100], <tt>A</tt> = [0, 100]. Note that this will not return the absolutely exact <tt>HSV</tt> values for the set <tt>RGB</tt> values in all cases. Due to the <tt>RGB</tt> mapping from 0-255 and the <tt>HSV</tt> mapping from 0-100 and 0-360 rounding errors may cause the <tt>HSV</tt> values to differ slightly from what you might expect. </p>
-<!--COMMENTS:Color.hsva--> &nbsp;<br> 
-<br></ul>
-
-
-<a name="Color.hsla">
-<big><b>Color.hsla</big></b><br><ul>
-  <i>Gets or sets the HSLA representation of the Color.</i><br>
-  <tt>Color.hsla: Return tuple</tt><br>
-<p>The <tt>HSLA</tt> representation of the Color. The <tt>HSLA</tt> components are in the ranges <tt>H</tt> = [0, 360], <tt>S</tt> = [0, 100], <tt>V</tt> = [0, 100], <tt>A</tt> = [0, 100]. Note that this will not return the absolutely exact <tt>HSL</tt> values for the set <tt>RGB</tt> values in all cases. Due to the <tt>RGB</tt> mapping from 0-255 and the <tt>HSL</tt> mapping from 0-100 and 0-360 rounding errors may cause the <tt>HSL</tt> values to differ slightly from what you might expect. </p>
-<!--COMMENTS:Color.hsla--> &nbsp;<br> 
-<br></ul>
-
-
-<a name="Color.i1i2i3">
-<big><b>Color.i1i2i3</big></b><br><ul>
-  <i>Gets or sets the I1I2I3 representation of the Color.</i><br>
-  <tt>Color.i1i2i3: Return tuple</tt><br>
-<p>The <tt>I1I2I3</tt> representation of the Color. The <tt>I1I2I3</tt> components are in the ranges <tt>I1</tt> = [0, 1], <tt>I2</tt> = <tt>[-0.5</tt>, <tt>0.5]</tt>, <tt>I3</tt> = <tt>[-0.5</tt>, <tt>0.5]</tt>. Note that this will not return the absolutely exact <tt>I1I2I3</tt> values for the set <tt>RGB</tt> values in all cases. Due to the <tt>RGB</tt> mapping from 0-255 and the <tt>I1I2I3</tt> mapping from 0-1 rounding errors may cause the <tt>I1I2I3</tt> values to differ slightly from what you might expect. </p>
-<!--COMMENTS:Color.i1i2i3--> &nbsp;<br> 
-<br></ul>
-
-
-<a name="Color.normalize">
-<big><b>Color.normalize</big></b><br><ul>
-  <i>Returns the normalized RGBA values of the Color.</i><br>
-  <tt>Color.normalize(): Return tuple</tt><br>
-<p>Returns the normalized <tt>RGBA</tt> values of the Color as floating point values. </p>
-<!--COMMENTS:Color.normalize--> &nbsp;<br> 
-<br></ul>
-
-
-<a name="Color.correct_gamma">
-<big><b>Color.correct_gamma</big></b><br><ul>
-  <i>Applies a certain gamma value to the Color.</i><br>
-  <tt>Color.correct_gamma (gamma): Return Color</tt><br>
-<p>Applies a certain gamma value to the Color and returns a new Color with the adjusted <tt>RGBA</tt> values. </p>
-<!--COMMENTS:Color.correct_gamma--> &nbsp;<br> 
-<br></ul>
-<br></ul>
-
-</body></html>
+
+<html>
+<title>color - Pygame Documentation</title>
+<body bgcolor=#aaeebb text=#000000 link=#331111 vlink=#331111>
+
+
+<table cellpadding=0 cellspacing=0 border=0 style='border: 3px solid black;' width='100%'>
+<tr>
+<td bgcolor='#c2fc20' style='padding: 6px;' align=center valign=center><a href='http://www.pygame.org/'><img src='../pygame_tiny.gif' border=0 width=200 height=60></a><br><b>pygame documentation</b></td>
+<td bgcolor='#6aee28' style='border-left: 3px solid black; padding: 6px;' align=center valign=center>
+	||&nbsp;
+	<a href=http://www.pygame.org>Pygame Home</a> &nbsp;||&nbsp;
+	<a href=../index.html>Help Contents</a> &nbsp;||
+	<a href=index.html>Reference Index</a> &nbsp;||
+	<br>&nbsp;<br>
+	
+<a href="cdrom.html">Cdrom</a>&nbsp;||&nbsp;
+<a href="color.html">Color</a>&nbsp;||&nbsp;
+<a href="cursors.html">Cursors</a>&nbsp;||&nbsp;
+<a href="display.html">Display</a>&nbsp;||&nbsp;
+<a href="draw.html">Draw</a>&nbsp;||&nbsp;
+<a href="event.html">Event</a>&nbsp;||&nbsp;
+<a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="image.html">Image</a>&nbsp;||&nbsp;
+<a href="joystick.html">Joystick</a>&nbsp;||&nbsp;
+<a href="key.html">Key</a>&nbsp;||&nbsp;
+<a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
+<a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
+<a href="movie.html">Movie</a>&nbsp;||&nbsp;
+<a href="music.html">Music</a>&nbsp;||&nbsp;
+<a href="overlay.html">Overlay</a>&nbsp;||&nbsp;
+<a href="pixelarray.html">Pixelarray</a>&nbsp;||&nbsp;
+<a href="pygame.html">Pygame</a>&nbsp;||&nbsp;
+<a href="rect.html">Rect</a>&nbsp;||&nbsp;
+<a href="scrap.html">Scrap</a>&nbsp;||&nbsp;
+<a href="sndarray.html">Sndarray</a>&nbsp;||&nbsp;
+<a href="sprite.html">Sprite</a>&nbsp;||&nbsp;
+<a href="surface.html">Surface</a>&nbsp;||&nbsp;
+<a href="surfarray.html">Surfarray</a>&nbsp;||&nbsp;
+<a href="time.html">Time</a>&nbsp;||&nbsp;
+<a href="transform.html">Transform</a>
+</td></tr></table>
+<br>
+
+
+<a name="pygame.Color">
+<big><b>pygame.Color</big></b><br><ul>
+  <i>pygame object for color representations</i><br>
+  <tt>pygame.Color(name): Return Color</tt><br>
+  <tt>pygame.Color(r, g, b, a): Return Color</tt><br>
+  <tt>pygame.Color(rgbvalue): Return Color</tt><br>
+<ul><small><table>
+  <tr><td><a href="color.html#Color.r">Color.r</a> - <font size=-1>Gets or sets the red value of the Color.</font></td><td>Gets or sets the red value of the Color.</td></tr>
+  <tr><td><a href="color.html#Color.g">Color.g</a> - <font size=-1>Gets or sets the green value of the Color.</font></td><td>Gets or sets the green value of the Color.</td></tr>
+  <tr><td><a href="color.html#Color.b">Color.b</a> - <font size=-1>Gets or sets the blue value of the Color.</font></td><td>Gets or sets the blue value of the Color.</td></tr>
+  <tr><td><a href="color.html#Color.a">Color.a</a> - <font size=-1>Gets or sets the alpha value of the Color.</font></td><td>Gets or sets the alpha value of the Color.</td></tr>
+  <tr><td><a href="color.html#Color.cmy">Color.cmy</a> - <font size=-1>Gets or sets the CMY representation of the Color.</font></td><td>Gets or sets the CMY representation of the Color.</td></tr>
+  <tr><td><a href="color.html#Color.hsva">Color.hsva</a> - <font size=-1>Gets or sets the HSVA representation of the Color.</font></td><td>Gets or sets the HSVA representation of the Color.</td></tr>
+  <tr><td><a href="color.html#Color.hsla">Color.hsla</a> - <font size=-1>Gets or sets the HSLA representation of the Color.</font></td><td>Gets or sets the HSLA representation of the Color.</td></tr>
+  <tr><td><a href="color.html#Color.i1i2i3">Color.i1i2i3</a> - <font size=-1>Gets or sets the I1I2I3 representation of the Color.</font></td><td>Gets or sets the I1I2I3 representation of the Color.</td></tr>
+  <tr><td><a href="color.html#Color.normalize">Color.normalize</a> - <font size=-1>Returns the normalized RGBA values of the Color.</font></td><td>Returns the normalized RGBA values of the Color.</td></tr>
+  <tr><td><a href="color.html#Color.correct_gamma">Color.correct_gamma</a> - <font size=-1>Applies a certain gamma value to the Color.</font></td><td>Applies a certain gamma value to the Color.</td></tr>
+</table></small></ul>
+<p>The Color class represents <tt>RGBA</tt> color values using a value range of 0-255. It allows basic arithmetic operations to create new colors, supports conversions to other color spaces such as <tt>HSV</tt> or <tt>HSL</tt> and lets you adjust single color channels. </p>
+<p>New in pygame <tt>1.8.1</tt>. </p>
+<!--COMMENTS:pygame.Color--> &nbsp;<br> 
+
+
+<a name="Color.r">
+<big><b>Color.r</big></b><br><ul>
+  <i>Gets or sets the red value of the Color.</i><br>
+  <tt>Color.r: Return int</tt><br>
+<p>The red value of the Color. </p>
+<!--COMMENTS:Color.r--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="Color.g">
+<big><b>Color.g</big></b><br><ul>
+  <i>Gets or sets the green value of the Color.</i><br>
+  <tt>Color.g: Return int</tt><br>
+<p>The green value of the Color. </p>
+<!--COMMENTS:Color.g--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="Color.b">
+<big><b>Color.b</big></b><br><ul>
+  <i>Gets or sets the blue value of the Color.</i><br>
+  <tt>Color.b: Return int</tt><br>
+<p>The blue value of the Color. </p>
+<!--COMMENTS:Color.b--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="Color.a">
+<big><b>Color.a</big></b><br><ul>
+  <i>Gets or sets the alpha value of the Color.</i><br>
+  <tt>Color.a: Return int</tt><br>
+<p>The alpha value of the Color. </p>
+<!--COMMENTS:Color.a--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="Color.cmy">
+<big><b>Color.cmy</big></b><br><ul>
+  <i>Gets or sets the CMY representation of the Color.</i><br>
+  <tt>Color.cmy: Return tuple</tt><br>
+<p>The <tt>CMY</tt> representation of the Color. The <tt>CMY</tt> components are in the ranges <tt>C</tt> = [0, 1], <tt>M</tt> = [0, 1], <tt>Y</tt> = [0, 1]. Note that this will not return the absolutely exact <tt>CMY</tt> values for the set <tt>RGB</tt> values in all cases. Due to the <tt>RGB</tt> mapping from 0-255 and the <tt>CMY</tt> mapping from 0-1 rounding errors may cause the <tt>CMY</tt> values to differ slightly from what you might expect. </p>
+<!--COMMENTS:Color.cmy--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="Color.hsva">
+<big><b>Color.hsva</big></b><br><ul>
+  <i>Gets or sets the HSVA representation of the Color.</i><br>
+  <tt>Color.hsva: Return tuple</tt><br>
+<p>The <tt>HSVA</tt> representation of the Color. The <tt>HSVA</tt> components are in the ranges <tt>H</tt> = [0, 360], <tt>S</tt> = [0, 100], <tt>V</tt> = [0, 100], <tt>A</tt> = [0, 100]. Note that this will not return the absolutely exact <tt>HSV</tt> values for the set <tt>RGB</tt> values in all cases. Due to the <tt>RGB</tt> mapping from 0-255 and the <tt>HSV</tt> mapping from 0-100 and 0-360 rounding errors may cause the <tt>HSV</tt> values to differ slightly from what you might expect. </p>
+<!--COMMENTS:Color.hsva--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="Color.hsla">
+<big><b>Color.hsla</big></b><br><ul>
+  <i>Gets or sets the HSLA representation of the Color.</i><br>
+  <tt>Color.hsla: Return tuple</tt><br>
+<p>The <tt>HSLA</tt> representation of the Color. The <tt>HSLA</tt> components are in the ranges <tt>H</tt> = [0, 360], <tt>S</tt> = [0, 100], <tt>V</tt> = [0, 100], <tt>A</tt> = [0, 100]. Note that this will not return the absolutely exact <tt>HSL</tt> values for the set <tt>RGB</tt> values in all cases. Due to the <tt>RGB</tt> mapping from 0-255 and the <tt>HSL</tt> mapping from 0-100 and 0-360 rounding errors may cause the <tt>HSL</tt> values to differ slightly from what you might expect. </p>
+<!--COMMENTS:Color.hsla--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="Color.i1i2i3">
+<big><b>Color.i1i2i3</big></b><br><ul>
+  <i>Gets or sets the I1I2I3 representation of the Color.</i><br>
+  <tt>Color.i1i2i3: Return tuple</tt><br>
+<p>The <tt>I1I2I3</tt> representation of the Color. The <tt>I1I2I3</tt> components are in the ranges <tt>I1</tt> = [0, 1], <tt>I2</tt> = <tt>[-0.5</tt>, <tt>0.5]</tt>, <tt>I3</tt> = <tt>[-0.5</tt>, <tt>0.5]</tt>. Note that this will not return the absolutely exact <tt>I1I2I3</tt> values for the set <tt>RGB</tt> values in all cases. Due to the <tt>RGB</tt> mapping from 0-255 and the <tt>I1I2I3</tt> mapping from 0-1 rounding errors may cause the <tt>I1I2I3</tt> values to differ slightly from what you might expect. </p>
+<!--COMMENTS:Color.i1i2i3--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="Color.normalize">
+<big><b>Color.normalize</big></b><br><ul>
+  <i>Returns the normalized RGBA values of the Color.</i><br>
+  <tt>Color.normalize(): Return tuple</tt><br>
+<p>Returns the normalized <tt>RGBA</tt> values of the Color as floating point values. </p>
+<!--COMMENTS:Color.normalize--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="Color.correct_gamma">
+<big><b>Color.correct_gamma</big></b><br><ul>
+  <i>Applies a certain gamma value to the Color.</i><br>
+  <tt>Color.correct_gamma (gamma): Return Color</tt><br>
+<p>Applies a certain gamma value to the Color and returns a new Color with the adjusted <tt>RGBA</tt> values. </p>
+<!--COMMENTS:Color.correct_gamma--> &nbsp;<br> 
+<br></ul>
+<br></ul>
+
+</body></html>

docs/ref/mask.html

-
-<html>
-<title>mask - Pygame Documentation</title>
-<body bgcolor=#aaeebb text=#000000 link=#331111 vlink=#331111>
-
-
-<table cellpadding=0 cellspacing=0 border=0 style='border: 3px solid black;' width='100%'>
-<tr>
-<td bgcolor='#c2fc20' style='padding: 6px;' align=center valign=center><a href='http://www.pygame.org/'><img src='../pygame_tiny.gif' border=0 width=200 height=60></a><br><b>pygame documentation</b></td>
-<td bgcolor='#6aee28' style='border-left: 3px solid black; padding: 6px;' align=center valign=center>
-	||&nbsp;
-	<a href=http://www.pygame.org>Pygame Home</a> &nbsp;||&nbsp;
-	<a href=../index.html>Help Contents</a> &nbsp;||
-	<a href=index.html>Reference Index</a> &nbsp;||
-	<br>&nbsp;<br>
-	
-<a href="cdrom.html">Cdrom</a>&nbsp;||&nbsp;
-<a href="color.html">Color</a>&nbsp;||&nbsp;
-<a href="cursors.html">Cursors</a>&nbsp;||&nbsp;
-<a href="display.html">Display</a>&nbsp;||&nbsp;
-<a href="draw.html">Draw</a>&nbsp;||&nbsp;
-<a href="event.html">Event</a>&nbsp;||&nbsp;
-<a href="font.html">Font</a>&nbsp;||&nbsp;
-<a href="image.html">Image</a>&nbsp;||&nbsp;
-<a href="joystick.html">Joystick</a>&nbsp;||&nbsp;
-<a href="key.html">Key</a>&nbsp;||&nbsp;
-<a href="mask.html">Mask</a>&nbsp;||&nbsp;
-<a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
-<a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
-<a href="movie.html">Movie</a>&nbsp;||&nbsp;
-<a href="music.html">Music</a>&nbsp;||&nbsp;
-<a href="overlay.html">Overlay</a>&nbsp;||&nbsp;
-<a href="pixelarray.html">Pixelarray</a>&nbsp;||&nbsp;
-<a href="pygame.html">Pygame</a>&nbsp;||&nbsp;
-<a href="rect.html">Rect</a>&nbsp;||&nbsp;
-<a href="scrap.html">Scrap</a>&nbsp;||&nbsp;
-<a href="sndarray.html">Sndarray</a>&nbsp;||&nbsp;
-<a href="sprite.html">Sprite</a>&nbsp;||&nbsp;
-<a href="surface.html">Surface</a>&nbsp;||&nbsp;
-<a href="surfarray.html">Surfarray</a>&nbsp;||&nbsp;
-<a href="time.html">Time</a>&nbsp;||&nbsp;
-<a href="transform.html">Transform</a>
-</td></tr></table>
-<br>
-
-
-<a name="pygame.mask">
-<big><b>pygame.mask</big></b><br><ul>
-  <i>pygame module for image masks.</i><br>
-<ul><small><table>
-  <tr><td><a href="mask.html#pygame.mask.from_surface">pygame.mask.from_surface</a> - <font size=-1>Returns a Mask from the given surface.</font></td><td>Returns a Mask from the given surface.</td></tr>
-  <tr><td><a href="mask.html#pygame.mask.Mask">pygame.mask.Mask</a> - <font size=-1>pygame object for representing 2d bitmasks</font></td><td>pygame object for representing 2d bitmasks</td></tr>
-</table></small></ul>
-<p>Useful for fast pixel perfect collision detection. <tt>A</tt> Mask uses 1bit per pixel to store which parts collide. </p>
-<p>New in pygame <tt>1.8</tt>. </p>
-<!--COMMENTS:pygame.mask--> &nbsp;<br> 
-
-
-<a name="pygame.mask.from_surface">
-<big><b>pygame.mask.from_surface</big></b><br><ul>
-  <i>Returns a Mask from the given surface.</i><br>
-  <tt>pygame.mask.from_surface(Surface, threshold = 127) -> Mask</tt><br>
-<p>Makes the transparent parts of the Surface not set, and the opaque parts set. </p>
-<p>The alpha of each pixel is checked to see if it is greater than the given threshold. </p>
-<p>If the Surface is color keyed, then threshold is not used. </p>
-<!--COMMENTS:pygame.mask.from_surface--> &nbsp;<br> 
-<br></ul>
-
-
-<a name="pygame.mask.Mask">
-<big><b>pygame.mask.Mask</big></b><br><ul>
-  <i>pygame object for representing 2d bitmasks</i><br>
-  <tt>pygame.Mask((width, height): return Mask</tt><br>
-<ul><small><table>
-  <tr><td><a href="mask.html#Mask.get_size">Mask.get_size</a> - <font size=-1>Returns the size of the mask.</font></td><td>Returns the size of the mask.</td></tr>
-  <tr><td><a href="mask.html#Mask.get_at">Mask.get_at</a> - <font size=-1>Returns nonzero if the bit at (x,y) is set.</font></td><td>Returns nonzero if the bit at (x,y) is set.</td></tr>
-  <tr><td><a href="mask.html#Mask.set_at">Mask.set_at</a> - <font size=-1>Sets the position in the mask given by x and y.</font></td><td>Sets the position in the mask given by x and y.</td></tr>
-  <tr><td><a href="mask.html#Mask.overlap">Mask.overlap</a> - <font size=-1>Returns the point of intersection if the masks overlap with the given offset - or None if it does not overlap.</font></td><td>Returns the point of intersection if the masks overlap with the given offset - or None if it does not overlap.</td></tr>
-  <tr><td><a href="mask.html#Mask.overlap_area">Mask.overlap_area</a> - <font size=-1>Returns the number of overlapping 'pixels'.</font></td><td>Returns the number of overlapping 'pixels'.</td></tr>
-  <tr><td><a href="mask.html#Mask.get_bounding_rects">Mask.get_bounding_rects</a> - <font size=-1>Returns a list of bounding rects of regions of set pixels.</font></td><td>Returns a list of bounding rects of regions of set pixels.</td></tr>
-</table></small></ul>
- &nbsp;<br> 
-<!--COMMENTS:pygame.mask.Mask--> &nbsp;<br> 
-
-
-<a name="Mask.get_size">
-<big><b>Mask.get_size</big></b><br><ul>
-  <i>Returns the size of the mask.</i><br>
-  <tt>Mask.get_size() -> width,height</tt><br>
- &nbsp;<br> 
-<!--COMMENTS:Mask.get_size--> &nbsp;<br> 
-<br></ul>
-
-
-<a name="Mask.get_at">
-<big><b>Mask.get_at</big></b><br><ul>
-  <i>Returns nonzero if the bit at (x,y) is set.</i><br>
-  <tt>Mask.get_at((x,y)) -> int</tt><br>
-<p>Coordinates start at (0,0) is top left - just like Surfaces. </p>
-<!--COMMENTS:Mask.get_at--> &nbsp;<br> 
-<br></ul>
-
-
-<a name="Mask.set_at">
-<big><b>Mask.set_at</big></b><br><ul>
-  <i>Sets the position in the mask given by x and y.</i><br>
-  <tt>Mask.set_at((x,y),value)</tt><br>
- &nbsp;<br> 
-<!--COMMENTS:Mask.set_at--> &nbsp;<br> 
-<br></ul>
-
-
-<a name="Mask.overlap">
-<big><b>Mask.overlap</big></b><br><ul>
-  <i>Returns the point of intersection if the masks overlap with the given offset - or None if it does not overlap.</i><br>
-  <tt>Mask.overlap(othermask, offset) -> x,y</tt><br>
-<p>The overlap tests uses the following offsets (which may be negative): </p>
-<pre>   +----+----------..
-   |A   | yoffset
-   |  +-+----------..
-   +--|B
-   |xoffset
-   |  |
-   :  :
-</pre>
-<!--COMMENTS:Mask.overlap--> &nbsp;<br> 
-<br></ul>
-
-
-<a name="Mask.overlap_area">
-<big><b>Mask.overlap_area</big></b><br><ul>
-  <i>Returns the number of overlapping 'pixels'.</i><br>
-  <tt>Mask.overlap_area(othermask, offset) -> numpixels</tt><br>
-<p>You can see how many pixels overlap with the other mask given. This can be used to see in which direction things collide, or to see how much the two masks collide. </p>
-<!--COMMENTS:Mask.overlap_area--> &nbsp;<br> 
-<br></ul>
-
-
-<a name="Mask.get_bounding_rects">
-<big><b>Mask.get_bounding_rects</big></b><br><ul>
-  <i>Returns a list of bounding rects of regions of set pixels.</i><br>
-  <tt>Mask.get_bounding_rects() -> Rects</tt><br>
-<p>This gets a bounding rect of connected regions of set pixels. <tt>A</tt> bounding rect is one for which each of the connected pixels is inside the rect. </p>
-<!--COMMENTS:Mask.get_bounding_rects--> &nbsp;<br> 
-<br></ul>
-<br></ul>
-<br></ul>
-
-</body></html>
+
+<html>
+<title>mask - Pygame Documentation</title>
+<body bgcolor=#aaeebb text=#000000 link=#331111 vlink=#331111>
+
+
+<table cellpadding=0 cellspacing=0 border=0 style='border: 3px solid black;' width='100%'>
+<tr>
+<td bgcolor='#c2fc20' style='padding: 6px;' align=center valign=center><a href='http://www.pygame.org/'><img src='../pygame_tiny.gif' border=0 width=200 height=60></a><br><b>pygame documentation</b></td>
+<td bgcolor='#6aee28' style='border-left: 3px solid black; padding: 6px;' align=center valign=center>
+	||&nbsp;
+	<a href=http://www.pygame.org>Pygame Home</a> &nbsp;||&nbsp;
+	<a href=../index.html>Help Contents</a> &nbsp;||
+	<a href=index.html>Reference Index</a> &nbsp;||
+	<br>&nbsp;<br>
+	
+<a href="cdrom.html">Cdrom</a>&nbsp;||&nbsp;
+<a href="color.html">Color</a>&nbsp;||&nbsp;
+<a href="cursors.html">Cursors</a>&nbsp;||&nbsp;
+<a href="display.html">Display</a>&nbsp;||&nbsp;
+<a href="draw.html">Draw</a>&nbsp;||&nbsp;
+<a href="event.html">Event</a>&nbsp;||&nbsp;
+<a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="image.html">Image</a>&nbsp;||&nbsp;
+<a href="joystick.html">Joystick</a>&nbsp;||&nbsp;
+<a href="key.html">Key</a>&nbsp;||&nbsp;
+<a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
+<a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
+<a href="movie.html">Movie</a>&nbsp;||&nbsp;
+<a href="music.html">Music</a>&nbsp;||&nbsp;
+<a href="overlay.html">Overlay</a>&nbsp;||&nbsp;
+<a href="pixelarray.html">Pixelarray</a>&nbsp;||&nbsp;
+<a href="pygame.html">Pygame</a>&nbsp;||&nbsp;
+<a href="rect.html">Rect</a>&nbsp;||&nbsp;
+<a href="scrap.html">Scrap</a>&nbsp;||&nbsp;
+<a href="sndarray.html">Sndarray</a>&nbsp;||&nbsp;
+<a href="sprite.html">Sprite</a>&nbsp;||&nbsp;
+<a href="surface.html">Surface</a>&nbsp;||&nbsp;
+<a href="surfarray.html">Surfarray</a>&nbsp;||&nbsp;
+<a href="time.html">Time</a>&nbsp;||&nbsp;
+<a href="transform.html">Transform</a>
+</td></tr></table>
+<br>
+
+
+<a name="pygame.mask">
+<big><b>pygame.mask</big></b><br><ul>
+  <i>pygame module for image masks.</i><br>
+<ul><small><table>
+  <tr><td><a href="mask.html#pygame.mask.from_surface">pygame.mask.from_surface</a> - <font size=-1>Returns a Mask from the given surface.</font></td><td>Returns a Mask from the given surface.</td></tr>
+  <tr><td><a href="mask.html#pygame.mask.Mask">pygame.mask.Mask</a> - <font size=-1>pygame object for representing 2d bitmasks</font></td><td>pygame object for representing 2d bitmasks</td></tr>
+</table></small></ul>
+<p>Useful for fast pixel perfect collision detection. <tt>A</tt> Mask uses 1bit per pixel to store which parts collide. </p>
+<p>New in pygame <tt>1.8</tt>. </p>
+<!--COMMENTS:pygame.mask--> &nbsp;<br> 
+
+
+<a name="pygame.mask.from_surface">
+<big><b>pygame.mask.from_surface</big></b><br><ul>
+  <i>Returns a Mask from the given surface.</i><br>
+  <tt>pygame.mask.from_surface(Surface, threshold = 127) -> Mask</tt><br>
+<p>Makes the transparent parts of the Surface not set, and the opaque parts set. </p>
+<p>The alpha of each pixel is checked to see if it is greater than the given threshold. </p>
+<p>If the Surface is color keyed, then threshold is not used. </p>
+<!--COMMENTS:pygame.mask.from_surface--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="pygame.mask.Mask">
+<big><b>pygame.mask.Mask</big></b><br><ul>
+  <i>pygame object for representing 2d bitmasks</i><br>
+  <tt>pygame.Mask((width, height): return Mask</tt><br>
+<ul><small><table>
+  <tr><td><a href="mask.html#Mask.get_size">Mask.get_size</a> - <font size=-1>Returns the size of the mask.</font></td><td>Returns the size of the mask.</td></tr>
+  <tr><td><a href="mask.html#Mask.get_at">Mask.get_at</a> - <font size=-1>Returns nonzero if the bit at (x,y) is set.</font></td><td>Returns nonzero if the bit at (x,y) is set.</td></tr>
+  <tr><td><a href="mask.html#Mask.set_at">Mask.set_at</a> - <font size=-1>Sets the position in the mask given by x and y.</font></td><td>Sets the position in the mask given by x and y.</td></tr>
+  <tr><td><a href="mask.html#Mask.overlap">Mask.overlap</a> - <font size=-1>Returns the point of intersection if the masks overlap with the given offset - or None if it does not overlap.</font></td><td>Returns the point of intersection if the masks overlap with the given offset - or None if it does not overlap.</td></tr>
+  <tr><td><a href="mask.html#Mask.overlap_area">Mask.overlap_area</a> - <font size=-1>Returns the number of overlapping 'pixels'.</font></td><td>Returns the number of overlapping 'pixels'.</td></tr>
+  <tr><td><a href="mask.html#Mask.get_bounding_rects">Mask.get_bounding_rects</a> - <font size=-1>Returns a list of bounding rects of regions of set pixels.</font></td><td>Returns a list of bounding rects of regions of set pixels.</td></tr>
+</table></small></ul>
+ &nbsp;<br> 
+<!--COMMENTS:pygame.mask.Mask--> &nbsp;<br> 
+
+
+<a name="Mask.get_size">
+<big><b>Mask.get_size</big></b><br><ul>
+  <i>Returns the size of the mask.</i><br>
+  <tt>Mask.get_size() -> width,height</tt><br>
+ &nbsp;<br> 
+<!--COMMENTS:Mask.get_size--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="Mask.get_at">
+<big><b>Mask.get_at</big></b><br><ul>
+  <i>Returns nonzero if the bit at (x,y) is set.</i><br>
+  <tt>Mask.get_at((x,y)) -> int</tt><br>
+<p>Coordinates start at (0,0) is top left - just like Surfaces. </p>
+<!--COMMENTS:Mask.get_at--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="Mask.set_at">
+<big><b>Mask.set_at</big></b><br><ul>
+  <i>Sets the position in the mask given by x and y.</i><br>
+  <tt>Mask.set_at((x,y),value)</tt><br>
+ &nbsp;<br> 
+<!--COMMENTS:Mask.set_at--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="Mask.overlap">
+<big><b>Mask.overlap</big></b><br><ul>
+  <i>Returns the point of intersection if the masks overlap with the given offset - or None if it does not overlap.</i><br>
+  <tt>Mask.overlap(othermask, offset) -> x,y</tt><br>
+<p>The overlap tests uses the following offsets (which may be negative): </p>
+<pre>   +----+----------..
+   |A   | yoffset
+   |  +-+----------..
+   +--|B
+   |xoffset
+   |  |
+   :  :
+</pre>
+<!--COMMENTS:Mask.overlap--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="Mask.overlap_area">
+<big><b>Mask.overlap_area</big></b><br><ul>
+  <i>Returns the number of overlapping 'pixels'.</i><br>
+  <tt>Mask.overlap_area(othermask, offset) -> numpixels</tt><br>
+<p>You can see how many pixels overlap with the other mask given. This can be used to see in which direction things collide, or to see how much the two masks collide. </p>
+<!--COMMENTS:Mask.overlap_area--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="Mask.get_bounding_rects">
+<big><b>Mask.get_bounding_rects</big></b><br><ul>
+  <i>Returns a list of bounding rects of regions of set pixels.</i><br>
+  <tt>Mask.get_bounding_rects() -> Rects</tt><br>
+<p>This gets a bounding rect of connected regions of set pixels. <tt>A</tt> bounding rect is one for which each of the connected pixels is inside the rect. </p>
+<!--COMMENTS:Mask.get_bounding_rects--> &nbsp;<br> 
+<br></ul>
+<br></ul>
+<br></ul>
+
+</body></html>

docs/ref/pixelarray.html

-
-<html>
-<title>pixelarray - Pygame Documentation</title>
-<body bgcolor=#aaeebb text=#000000 link=#331111 vlink=#331111>
-
-
-<table cellpadding=0 cellspacing=0 border=0 style='border: 3px solid black;' width='100%'>
-<tr>
-<td bgcolor='#c2fc20' style='padding: 6px;' align=center valign=center><a href='http://www.pygame.org/'><img src='../pygame_tiny.gif' border=0 width=200 height=60></a><br><b>pygame documentation</b></td>
-<td bgcolor='#6aee28' style='border-left: 3px solid black; padding: 6px;' align=center valign=center>
-	||&nbsp;
-	<a href=http://www.pygame.org>Pygame Home</a> &nbsp;||&nbsp;
-	<a href=../index.html>Help Contents</a> &nbsp;||
-	<a href=index.html>Reference Index</a> &nbsp;||
-	<br>&nbsp;<br>
-	
-<a href="cdrom.html">Cdrom</a>&nbsp;||&nbsp;
-<a href="color.html">Color</a>&nbsp;||&nbsp;
-<a href="cursors.html">Cursors</a>&nbsp;||&nbsp;
-<a href="display.html">Display</a>&nbsp;||&nbsp;
-<a href="draw.html">Draw</a>&nbsp;||&nbsp;
-<a href="event.html">Event</a>&nbsp;||&nbsp;
-<a href="font.html">Font</a>&nbsp;||&nbsp;
-<a href="image.html">Image</a>&nbsp;||&nbsp;
-<a href="joystick.html">Joystick</a>&nbsp;||&nbsp;
-<a href="key.html">Key</a>&nbsp;||&nbsp;
-<a href="mask.html">Mask</a>&nbsp;||&nbsp;
-<a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
-<a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
-<a href="movie.html">Movie</a>&nbsp;||&nbsp;
-<a href="music.html">Music</a>&nbsp;||&nbsp;
-<a href="overlay.html">Overlay</a>&nbsp;||&nbsp;
-<a href="pixelarray.html">Pixelarray</a>&nbsp;||&nbsp;
-<a href="pygame.html">Pygame</a>&nbsp;||&nbsp;
-<a href="rect.html">Rect</a>&nbsp;||&nbsp;
-<a href="scrap.html">Scrap</a>&nbsp;||&nbsp;
-<a href="sndarray.html">Sndarray</a>&nbsp;||&nbsp;
-<a href="sprite.html">Sprite</a>&nbsp;||&nbsp;
-<a href="surface.html">Surface</a>&nbsp;||&nbsp;
-<a href="surfarray.html">Surfarray</a>&nbsp;||&nbsp;
-<a href="time.html">Time</a>&nbsp;||&nbsp;
-<a href="transform.html">Transform</a>
-</td></tr></table>
-<br>
-
-
-<a name="pygame.PixelArray">
-<big><b>pygame.PixelArray</big></b><br><ul>
-  <i>pygame object for direct pixel access of surfaces</i><br>
-  <tt>pygame.PixelArray(Surface): return PixelArray</tt><br>
-<ul><small><table>
-  <tr><td><a href="pixelarray.html#PixelArray.surface">PixelArray.surface</a> - <font size=-1>Gets the Surface the PixelArray uses.</font></td><td>Gets the Surface the PixelArray uses.</td></tr>
-  <tr><td><a href="pixelarray.html#PixelArray.make_surface">PixelArray.make_surface</a> - <font size=-1>Creates a new Surface from the current PixelArray.</font></td><td>Creates a new Surface from the current PixelArray.</td></tr>
-  <tr><td><a href="pixelarray.html#PixelArray.replace">PixelArray.replace</a> - <font size=-1>Replaces the passed color in the PixelArray with another one.</font></td><td>Replaces the passed color in the PixelArray with another one.</td></tr>
-  <tr><td><a href="pixelarray.html#PixelArray.extract">PixelArray.extract</a> - <font size=-1>Extracts the passed color from the PixelArray.</font></td><td>Extracts the passed color from the PixelArray.</td></tr>
-  <tr><td><a href="pixelarray.html#PixelArray.compare">PixelArray.compare</a> - <font size=-1>Compares the PixelArray with another one.</font></td><td>Compares the PixelArray with another one.</td></tr>
-</table></small></ul>
-<p>The PixelArray wraps up a Surface and provides a direct <tt>2D</tt> array access to its pixels using the surface its rows as first and its columns as second axis. It supports slicing, row and pixel manipluation, slicing and slice assignments while inplace operations such as addition, subtraction, multiplication, division and so forth are not allowed. </p>
-<p>While it is possible to assign both, integer color values and <tt>RGB(A)</tt> color tuples, the PixelArray will only use integers for the color representation. Thus, checking for certain colors has to be done using the <tt><a href="surface.html#Surface.map_rgb">Surface.map_rgb</a> - <font size=-1>convert a color into a mapped color value</font></tt> method of the surface, the PixelArray was created for. </p>
-<pre>  pxarray = pygame.PixelArray (surface)
-  # Check, if the first pixel at the topleft corner is blue
-  if pxarray[0][0] == surface.map_rgb ((0, 0, 255)):
-      ...
-</pre><p>Pixels can be manipulated using integer values or color tuples. </p>
-<pre>  pxarray[x][y] = 0xFF00FF
-  pxarray[x][y] = (255, 0, 255)
-</pre><p>If you operate on a slice, you also can use arbitrary sequences or other PixelArray objects to modify the pixels. They have to match the size of the PixelArray however. </p>
-<pre>  pxarray[a:b] = 0xFF00FF                   # set all pixels to 0xFF00FF
-  pxarray[a:b] = (0xFF00FF, 0xAACCEE, ... ) # first pixel = 0xFF00FF,
-                                            # second pixel  = 0xAACCEE, ...
-  pxarray[a:b] = ((255, 0, 255), (170, 204, 238), ...) # same as above
-  pxarray[a:b] = ((255, 0, 255), 0xAACCEE, ...)        # same as above
-  pxarray[a:b] = otherarray[x:y]            # slice sizes must match
-</pre><p>Note, that something like </p>
-<pre>  pxarray[2:4][3:5] = ...
-</pre><p>will not cause a rectangular manipulation. Instead it will be first sliced to a two-column array, which then shall be sliced by columns once more, which will fail due an IndexError. This is caused by the slicing mechanisms in python and an absolutely correct behaviour. Create a single columned slice first, which you can manipulate then: </p>
-<pre>  pxarray[2][3:5] = ...
-  pxarray[3][3:5] = ...
-</pre><p>If you want to make a rectangular manipulation or create a view of a part of the PixelArray, you also can use the subscript abilities. You can easily create different view by creating 'subarrays' using the subscripts. </p>
-<pre>  # Create some new PixelArray objects providing a different view
-  # of the original array/surface.
-  newarray = pxarray[2:4,3:5]
-  otherarray = pxarray[::2,::2]
-</pre><p>Subscripts also can be used to do fast rectangular pixel manipulations instead of iterating over the x or y axis as above. </p>
-<pre>  pxarray[::2,:] = (0, 0, 0)                # Make each second column black.
-</pre><p>During its lifetime, the PixelArray locks the surface, thus you explicitly have to delete it once its not used anymore and the surface should perform operations in the same scope. </p>
-<p>New in pygame <tt>1.8</tt>. Subscript support is new in pygame <tt>1.8.1</tt>. </p>
-<!--COMMENTS:pygame.PixelArray--> &nbsp;<br> 
-
-
-<a name="PixelArray.surface">
-<big><b>PixelArray.surface</big></b><br><ul>
-  <i>Gets the Surface the PixelArray uses.</i><br>
-  <tt>PixelArray.surface: Return Surface</tt><br>
-<p>The Surface, the PixelArray was created for. </p>
-<!--COMMENTS:PixelArray.surface--> &nbsp;<br> 
-<br></ul>
-
-
-<a name="PixelArray.make_surface">
-<big><b>PixelArray.make_surface</big></b><br><ul>
-  <i>Creates a new Surface from the current PixelArray.</i><br>
-  <tt>PixelArray.make_surface (): Return Surface</tt><br>
-<p>Creates a new Surface from the current PixelArray. Depending on the current PixelArray the size, pixel order etc. will be different from the original Surface. </p>
-<pre>  # Create a new surface flipped around the vertical axis.
-  sf = pxarray[:,::-1].make_surface ()
-</pre><p>New in pygame <tt>1.8.1</tt>. </p>
-<!--COMMENTS:PixelArray.make_surface--> &nbsp;<br> 
-<br></ul>
-
-
-<a name="PixelArray.replace">
-<big><b>PixelArray.replace</big></b><br><ul>
-  <i>Replaces the passed color in the PixelArray with another one.</i><br>
-  <tt>PixelArray.replace (color, repcolor, distance=0, weights=(0.299, 0.587, 0.114)): Return None</tt><br>
-<p>Replaces the pixels with the passed color in the PixelArray by changing them them to the passed replacement color. </p>
-<p>It uses a simple weighted euclidian distance formula to calculate the distance between the colors. The distance space ranges from <tt>0.0</tt> to <tt>1.0</tt> and is used as threshold for the color detection. This causes the replacement to take pixels with a similar, but not exactly identical color, into account as well. </p>
-<p>This is an in place operation that directly affects the pixels of the PixelArray. </p>
-<p>New in pygame <tt>1.8.1</tt>. </p>
-<!--COMMENTS:PixelArray.replace--> &nbsp;<br> 
-<br></ul>
-
-
-<a name="PixelArray.extract">
-<big><b>PixelArray.extract</big></b><br><ul>
-  <i>Extracts the passed color from the PixelArray.</i><br>
-  <tt>PixelArray.extract (color, distance=0, weights=(0.299, 0.587, 0.114)): Return PixelArray</tt><br>
-<p>Extracts the passed color by changing all matching pixels to white, while non-matching pixels are changed to black. This returns a new PixelArray with the black/white color mask. </p>
-<p>It uses a simple weighted euclidian distance formula to calculate the distance between the colors. The distance space ranges from <tt>0.0</tt> to <tt>1.0</tt> and is used as threshold for the color detection. This causes the extraction to take pixels with a similar, but not exactly identical color, into account as well. </p>
-<p>New in pygame <tt>1.8.1</tt>. </p>
-<!--COMMENTS:PixelArray.extract--> &nbsp;<br> 
-<br></ul>
-
-
-<a name="PixelArray.compare">
-<big><b>PixelArray.compare</big></b><br><ul>
-  <i>Compares the PixelArray with another one.</i><br>
-  <tt>PixelArray.compare (array, distance=0, weights=(0.299, 0.587, 0.114)): Return PixelArray</tt><br>
-<p>Compares the contents of the PixelArray with those from the passed PixelArray. It returns a new PixelArray with a black/white color mask that indicates the differences (white) of both arrays. Both PixelArray objects must have indentical bit depths and dimensions. </p>
-<p>It uses a simple weighted euclidian distance formula to calculate the distance between the colors. The distance space ranges from <tt>0.0</tt> to <tt>1.0</tt> and is used as threshold for the color detection. This causes the comparision to mark pixels with a similar, but not exactly identical color, as black. </p>
-<p>New in pygame <tt>1.8.1</tt>. </p>
-<!--COMMENTS:PixelArray.compare--> &nbsp;<br> 
-<br></ul>
-<br></ul>
-
-</body></html>
+
+<html>
+<title>pixelarray - Pygame Documentation</title>
+<body bgcolor=#aaeebb text=#000000 link=#331111 vlink=#331111>
+
+
+<table cellpadding=0 cellspacing=0 border=0 style='border: 3px solid black;' width='100%'>
+<tr>
+<td bgcolor='#c2fc20' style='padding: 6px;' align=center valign=center><a href='http://www.pygame.org/'><img src='../pygame_tiny.gif' border=0 width=200 height=60></a><br><b>pygame documentation</b></td>
+<td bgcolor='#6aee28' style='border-left: 3px solid black; padding: 6px;' align=center valign=center>
+	||&nbsp;
+	<a href=http://www.pygame.org>Pygame Home</a> &nbsp;||&nbsp;
+	<a href=../index.html>Help Contents</a> &nbsp;||
+	<a href=index.html>Reference Index</a> &nbsp;||
+	<br>&nbsp;<br>
+	
+<a href="cdrom.html">Cdrom</a>&nbsp;||&nbsp;
+<a href="color.html">Color</a>&nbsp;||&nbsp;
+<a href="cursors.html">Cursors</a>&nbsp;||&nbsp;
+<a href="display.html">Display</a>&nbsp;||&nbsp;
+<a href="draw.html">Draw</a>&nbsp;||&nbsp;
+<a href="event.html">Event</a>&nbsp;||&nbsp;
+<a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="image.html">Image</a>&nbsp;||&nbsp;
+<a href="joystick.html">Joystick</a>&nbsp;||&nbsp;
+<a href="key.html">Key</a>&nbsp;||&nbsp;
+<a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
+<a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
+<a href="movie.html">Movie</a>&nbsp;||&nbsp;
+<a href="music.html">Music</a>&nbsp;||&nbsp;
+<a href="overlay.html">Overlay</a>&nbsp;||&nbsp;
+<a href="pixelarray.html">Pixelarray</a>&nbsp;||&nbsp;
+<a href="pygame.html">Pygame</a>&nbsp;||&nbsp;
+<a href="rect.html">Rect</a>&nbsp;||&nbsp;
+<a href="scrap.html">Scrap</a>&nbsp;||&nbsp;
+<a href="sndarray.html">Sndarray</a>&nbsp;||&nbsp;
+<a href="sprite.html">Sprite</a>&nbsp;||&nbsp;
+<a href="surface.html">Surface</a>&nbsp;||&nbsp;
+<a href="surfarray.html">Surfarray</a>&nbsp;||&nbsp;
+<a href="time.html">Time</a>&nbsp;||&nbsp;
+<a href="transform.html">Transform</a>
+</td></tr></table>
+<br>
+
+
+<a name="pygame.PixelArray">
+<big><b>pygame.PixelArray</big></b><br><ul>
+  <i>pygame object for direct pixel access of surfaces</i><br>
+  <tt>pygame.PixelArray(Surface): return PixelArray</tt><br>
+<ul><small><table>
+  <tr><td><a href="pixelarray.html#PixelArray.surface">PixelArray.surface</a> - <font size=-1>Gets the Surface the PixelArray uses.</font></td><td>Gets the Surface the PixelArray uses.</td></tr>
+  <tr><td><a href="pixelarray.html#PixelArray.make_surface">PixelArray.make_surface</a> - <font size=-1>Creates a new Surface from the current PixelArray.</font></td><td>Creates a new Surface from the current PixelArray.</td></tr>
+  <tr><td><a href="pixelarray.html#PixelArray.replace">PixelArray.replace</a> - <font size=-1>Replaces the passed color in the PixelArray with another one.</font></td><td>Replaces the passed color in the PixelArray with another one.</td></tr>
+  <tr><td><a href="pixelarray.html#PixelArray.extract">PixelArray.extract</a> - <font size=-1>Extracts the passed color from the PixelArray.</font></td><td>Extracts the passed color from the PixelArray.</td></tr>
+  <tr><td><a href="pixelarray.html#PixelArray.compare">PixelArray.compare</a> - <font size=-1>Compares the PixelArray with another one.</font></td><td>Compares the PixelArray with another one.</td></tr>
+</table></small></ul>
+<p>The PixelArray wraps up a Surface and provides a direct <tt>2D</tt> array access to its pixels using the surface its rows as first and its columns as second axis. It supports slicing, row and pixel manipluation, slicing and slice assignments while inplace operations such as addition, subtraction, multiplication, division and so forth are not allowed. </p>
+<p>While it is possible to assign both, integer color values and <tt>RGB(A)</tt> color tuples, the PixelArray will only use integers for the color representation. Thus, checking for certain colors has to be done using the <tt><a href="surface.html#Surface.map_rgb">Surface.map_rgb</a> - <font size=-1>convert a color into a mapped color value</font></tt> method of the surface, the PixelArray was created for. </p>
+<pre>  pxarray = pygame.PixelArray (surface)
+  # Check, if the first pixel at the topleft corner is blue
+  if pxarray[0][0] == surface.map_rgb ((0, 0, 255)):
+      ...
+</pre><p>Pixels can be manipulated using integer values or color tuples. </p>
+<pre>  pxarray[x][y] = 0xFF00FF
+  pxarray[x][y] = (255, 0, 255)
+</pre><p>If you operate on a slice, you also can use arbitrary sequences or other PixelArray objects to modify the pixels. They have to match the size of the PixelArray however. </p>
+<pre>  pxarray[a:b] = 0xFF00FF                   # set all pixels to 0xFF00FF
+  pxarray[a:b] = (0xFF00FF, 0xAACCEE, ... ) # first pixel = 0xFF00FF,
+                                            # second pixel  = 0xAACCEE, ...
+  pxarray[a:b] = ((255, 0, 255), (170, 204, 238), ...) # same as above
+  pxarray[a:b] = ((255, 0, 255), 0xAACCEE, ...)        # same as above
+  pxarray[a:b] = otherarray[x:y]            # slice sizes must match
+</pre><p>Note, that something like </p>
+<pre>  pxarray[2:4][3:5] = ...
+</pre><p>will not cause a rectangular manipulation. Instead it will be first sliced to a two-column array, which then shall be sliced by columns once more, which will fail due an IndexError. This is caused by the slicing mechanisms in python and an absolutely correct behaviour. Create a single columned slice first, which you can manipulate then: </p>
+<pre>  pxarray[2][3:5] = ...
+  pxarray[3][3:5] = ...
+</pre><p>If you want to make a rectangular manipulation or create a view of a part of the PixelArray, you also can use the subscript abilities. You can easily create different view by creating 'subarrays' using the subscripts. </p>
+<pre>  # Create some new PixelArray objects providing a different view
+  # of the original array/surface.
+  newarray = pxarray[2:4,3:5]
+  otherarray = pxarray[::2,::2]
+</pre><p>Subscripts also can be used to do fast rectangular pixel manipulations instead of iterating over the x or y axis as above. </p>
+<pre>  pxarray[::2,:] = (0, 0, 0)                # Make each second column black.
+</pre><p>During its lifetime, the PixelArray locks the surface, thus you explicitly have to delete it once its not used anymore and the surface should perform operations in the same scope. </p>
+<p>New in pygame <tt>1.8</tt>. Subscript support is new in pygame <tt>1.8.1</tt>. </p>
+<!--COMMENTS:pygame.PixelArray--> &nbsp;<br> 
+
+
+<a name="PixelArray.surface">
+<big><b>PixelArray.surface</big></b><br><ul>
+  <i>Gets the Surface the PixelArray uses.</i><br>
+  <tt>PixelArray.surface: Return Surface</tt><br>
+<p>The Surface, the PixelArray was created for. </p>
+<!--COMMENTS:PixelArray.surface--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="PixelArray.make_surface">
+<big><b>PixelArray.make_surface</big></b><br><ul>
+  <i>Creates a new Surface from the current PixelArray.</i><br>
+  <tt>PixelArray.make_surface (): Return Surface</tt><br>
+<p>Creates a new Surface from the current PixelArray. Depending on the current PixelArray the size, pixel order etc. will be different from the original Surface. </p>
+<pre>  # Create a new surface flipped around the vertical axis.
+  sf = pxarray[:,::-1].make_surface ()
+</pre><p>New in pygame <tt>1.8.1</tt>. </p>
+<!--COMMENTS:PixelArray.make_surface--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="PixelArray.replace">
+<big><b>PixelArray.replace</big></b><br><ul>
+  <i>Replaces the passed color in the PixelArray with another one.</i><br>
+  <tt>PixelArray.replace (color, repcolor, distance=0, weights=(0.299, 0.587, 0.114)): Return None</tt><br>
+<p>Replaces the pixels with the passed color in the PixelArray by changing them them to the passed replacement color. </p>
+<p>It uses a simple weighted euclidian distance formula to calculate the distance between the colors. The distance space ranges from <tt>0.0</tt> to <tt>1.0</tt> and is used as threshold for the color detection. This causes the replacement to take pixels with a similar, but not exactly identical color, into account as well. </p>
+<p>This is an in place operation that directly affects the pixels of the PixelArray. </p>
+<p>New in pygame <tt>1.8.1</tt>. </p>
+<!--COMMENTS:PixelArray.replace--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="PixelArray.extract">
+<big><b>PixelArray.extract</big></b><br><ul>
+  <i>Extracts the passed color from the PixelArray.</i><br>
+  <tt>PixelArray.extract (color, distance=0, weights=(0.299, 0.587, 0.114)): Return PixelArray</tt><br>
+<p>Extracts the passed color by changing all matching pixels to white, while non-matching pixels are changed to black. This returns a new PixelArray with the black/white color mask. </p>
+<p>It uses a simple weighted euclidian distance formula to calculate the distance between the colors. The distance space ranges from <tt>0.0</tt> to <tt>1.0</tt> and is used as threshold for the color detection. This causes the extraction to take pixels with a similar, but not exactly identical color, into account as well. </p>
+<p>New in pygame <tt>1.8.1</tt>. </p>
+<!--COMMENTS:PixelArray.extract--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="PixelArray.compare">
+<big><b>PixelArray.compare</big></b><br><ul>
+  <i>Compares the PixelArray with another one.</i><br>
+  <tt>PixelArray.compare (array, distance=0, weights=(0.299, 0.587, 0.114)): Return PixelArray</tt><br>
+<p>Compares the contents of the PixelArray with those from the passed PixelArray. It returns a new PixelArray with a black/white color mask that indicates the differences (white) of both arrays. Both PixelArray objects must have indentical bit depths and dimensions. </p>
+<p>It uses a simple weighted euclidian distance formula to calculate the distance between the colors. The distance space ranges from <tt>0.0</tt> to <tt>1.0</tt> and is used as threshold for the color detection. This causes the comparision to mark pixels with a similar, but not exactly identical color, as black. </p>
+<p>New in pygame <tt>1.8.1</tt>. </p>
+<!--COMMENTS:PixelArray.compare--> &nbsp;<br> 
+<br></ul>
+<br></ul>
+
+</body></html>

docs/ref/surface.html

   <tt>Surface.blit(source, dest, area=None, special_flags = 0): return Rect</tt><br>
 <p>Draws a source Surface onto this Surface. The draw can be positioned with the dest argument. Dest can either be pair of coordinates representing the upper left corner of the source. <tt>A</tt> Rect can also be passed as the destination and the topleft corner of the rectangle will be used as the position for the blit. The size of the destination rectangle does not effect the blit. </p>
 <p>An optional area rectangle can be passed as well. This represents a smaller portion of the source Surface to draw. </p>
-<p>An optional special flags is for passing in <tt>BLEND_ADD</tt>, <tt>BLEND_SUB</tt>, <tt>BLEND_MULT</tt>, <tt>BLEND_MIN</tt>, <tt>BLEND_MAX</tt> With other special blitting flags perhaps added in the future. </p>
+<p>An optional special flags is for passing in new in <tt>1.8.0:</tt> <tt>BLEND_ADD</tt>, <tt>BLEND_SUB</tt>, <tt>BLEND_MULT</tt>, <tt>BLEND_MIN</tt>, <tt>BLEND_MAX</tt> new in <tt>1.8.1:</tt> <tt>BLEND_RGBA_ADD</tt>, <tt>BLEND_RGBA_SUB</tt>, <tt>BLEND_RGBA_MULT</tt>, <tt>BLEND_RGBA_MIN</tt>, <tt>BLEND_RGBA_MAX</tt> <tt>BLEND_RGB_ADD</tt>, <tt>BLEND_RGB_SUB</tt>, <tt>BLEND_RGB_MULT</tt>, <tt>BLEND_RGB_MIN</tt>, <tt>BLEND_RGB_MAX</tt> With other special blitting flags perhaps added in the future. </p>
 <p>The return rectangle is the area of the affected pixels, excluding any pixels outside the destination Surface, or outside the clipping area. </p>
 <p>Pixel alphas will be ignored when blitting to an 8 bit Surface. </p>
 <p>special_flags new in pygame <tt>1.8</tt>. </p>
   <tt>Surface.fill(color, rect=None, special_flags=0): return Rect</tt><br>
 <p>Fill the Surface with a solid color. If no rect argument is given the entire Surface will be filled. The rect argument will limit the fill to a specific area. The fill will also be contained by the Surface clip area. </p>
 <p>The color argument can be either a <tt>RGB</tt> sequence, a <tt>RGBA</tt> sequence or a mapped color index. If using <tt>RGBA</tt>, the Alpha <tt>(A</tt> part of <tt>RGBA)</tt> is ignored unless the surface uses per pixel alpha (Surface has the <tt>SRCALPHA</tt> flag). </p>
-<p>An optional special_flags is for passing in <tt>BLEND_ADD</tt>, <tt>BLEND_SUB</tt>, <tt>BLEND_MULT</tt>, <tt>BLEND_MIN</tt>, <tt>BLEND_MAX</tt> With other special blitting flags perhaps added in the future. </p>
+<p>An optional special_flags is for passing in new in <tt>1.8.0:</tt> <tt>BLEND_ADD</tt>, <tt>BLEND_SUB</tt>, <tt>BLEND_MULT</tt>, <tt>BLEND_MIN</tt>, <tt>BLEND_MAX</tt> new in <tt>1.8.1:</tt> <tt>BLEND_RGBA_ADD</tt>, <tt>BLEND_RGBA_SUB</tt>, <tt>BLEND_RGBA_MULT</tt>, <tt>BLEND_RGBA_MIN</tt>, <tt>BLEND_RGBA_MAX</tt> <tt>BLEND_RGB_ADD</tt>, <tt>BLEND_RGB_SUB</tt>, <tt>BLEND_RGB_MULT</tt>, <tt>BLEND_RGB_MIN</tt>, <tt>BLEND_RGB_MAX</tt> With other special blitting flags perhaps added in the future. </p>
 <p>This will return the affected Surface area. </p>
 <!--COMMENTS:Surface.fill--> &nbsp;<br> 
 <br></ul>

docs/ref/transform.html

 <a name="pygame.transform.threshold">
 <big><b>pygame.transform.threshold</big></b><br><ul>
   <i>finds which, and how many pixels in a surface are within a threshold of a color.</i><br>
-  <tt>pygame.transform.threshold(DestSurface, Surface, color, threshold = (0,0,0,0), diff_color = (0,0,0,0), change_return = True): return num_threshold_pixels</tt><br>
-<p>Finds which, and how many pixels in a surface are within a threshold of a color. </p>
+<p><tt>pygame.transform.threshold(DestSurface</tt>, Surface, color, threshold = (0,0,0,0), diff_color = (0,0,0,0), change_return = True, Surface =None): return num_threshold_pixels </p>
 <p>It can set the destination surface where all of the pixels not within the threshold are changed to diff_color. </p>
 <p>Or it can be used to just count the number of pixels within the threshold if you set change_return to False. </p>
+<p>When given the optional third surface, it will use the colors in that rather than the 3rd position "color" arg. </p>
 <p>You can use a threshold of (r,g,b,a) where the r,g,b can have different thresholds. So you could use an r threshold of 40 and a blue threshold of 2 if you like. </p>
 <p>New in pygame <tt>1.8</tt> </p>
 <!--COMMENTS:pygame.transform.threshold--> &nbsp;<br> 
-#################################### IMPORTS ###################################
-
-import sys, os, re, unittest, subprocess, time, optparse
-import pygame.threads 
-
-from test_runner import run_test, TEST_RESULTS_RE, TEST_RESULTS_START,\
-                        prepare_test_env
-
-from pprint import pformat
-
-main_dir, test_subdir = prepare_test_env()
-fake_test_subdir = os.path.join(test_subdir, 'run_tests__tests')
-test_runner_py = os.path.join(main_dir, "test_runner.py")
-
-import test_utils
-
-################################### CONSTANTS ##################################
-# Defaults:
-#    See optparse options below for more options
-#
-
-# If an xxxx_test.py takes longer than TIME_OUT seconds it will be killed
-# This is only the default, can be over-ridden on command line
-
-TIME_OUT = 30
-
-# Any tests in IGNORE will not be ran
-IGNORE = (
-    "scrap_test",
-)
-
-# Subprocess has less of a need to worry about interference between tests
-SUBPROCESS_IGNORE = (
-    "scrap_test",
-)
-
-################################################################################
-# Human readable output
-#
-
-COMPLETE_FAILURE_TEMPLATE = """
-======================================================================
-ERROR: all_tests_for (%(module)s.AllTestCases)
-----------------------------------------------------------------------
-Traceback (most recent call last):
-  File "test\%(module)s.py", line 1, in all_tests_for
-
-subprocess completely failed with return code of %(return_code)s
-
-cmd:          %(cmd)s
-test_env:     %(test_env)s
-working_dir:  %(working_dir)s
-
-return (top 5 lines):
-%(raw_return)s
-
-"""  # Leave that last empty line else build page regex won't match
-
-TEST_MODULE_RE = re.compile('^(.+_test)\.py$')
-
-RAN_TESTS_DIV = (70 * "-") + "\nRan"
-
-DOTS = re.compile("^([FE.]*)$", re.MULTILINE)
-
-################################################################################
-# Set the command line options
-#
-# Defined in test_runner.py as it shares options, added to here
-
-from test_runner import opt_parser
-
-opt_parser.set_usage("""
-
-Runs all or some of the test/xxxx_test.py tests.
-
-$ run_tests.py sprite threads -sd
-
-Runs the sprite and threads module tests isolated in subprocesses, dumping all
-failing tests info in the form of a dict.
-
-""")
-
-opt_parser.set_defaults (
-    python = sys.executable,
-    time_out = TIME_OUT,
-)
-
-options, args = opt_parser.parse_args()
-
-################################################################################
-# Change to working directory and compile a list of test modules
-# If options.fake, then compile list of fake xxxx_test.py from run_tests__tests
-# this is used for testing subprocess output against single process mode
-
-if options.fake:
-    test_subdir = os.path.join(fake_test_subdir, options.fake )
-    sys.path.append(test_subdir)
-    working_dir = test_subdir
-else:
-    working_dir = main_dir
-
-test_env = {"PYTHONPATH": test_subdir}
-os.chdir(working_dir)
-
-if args:
-    test_modules = [
-        m.endswith('_test') and m or ('%s_test' % m) for m in args
-    ]
-else:
-    if options.subprocess: ignore = SUBPROCESS_IGNORE
-    else: ignore = IGNORE
-
-    test_modules = []
-    for f in sorted(os.listdir(test_subdir)):
-        for match in TEST_MODULE_RE.findall(f):
-            if match in ignore: continue
-            test_modules.append(match)
-
-################################################################################
-# Single process mode
-#
-
-if not options.subprocess:    
-    single_results = run_test ( test_modules, options = options)
-    if options.dump: print pformat(single_results)
-    #TODO  make consistent with subprocess mode
-    else: print single_results['output']
-
-################################################################################
-# Subprocess mode
-#
-
-def combine_results(all_results, t):
-    """
-
-    Return pieced together subprocessed results in a form fit for human 
-    consumption. Don't rely on results. Was originally meant for that purpose 
-    but was found to be unreliable. See options.dump for reliable results.
-
-    """
-
-    all_dots = ''
-    failures = []
-
-    for module, results in sorted(all_results.items()):
-        output, return_code, raw_return = map (
-            results.get, ('output','return_code', 'raw_return')
-        )
-
-        if not output or (return_code and RAN_TESTS_DIV not in output):
-            # would this effect the original dict? TODO
-            results['raw_return'] = ''.join(raw_return.splitlines(1)[:5])
-            failures.append( COMPLETE_FAILURE_TEMPLATE % results )
-            all_dots += 'E'
-            continue
-
-        dots = DOTS.search(output).group(1)
-        all_dots += dots
-
-        if 'E' in dots or 'F' in dots:
-            failures.append( output[len(dots)+1:].split(RAN_TESTS_DIV)[0] )
-    
-    total_fails, total_errors = map(all_dots.count, 'FE')
-    total_tests = len(all_dots)
-
-    combined = [all_dots]
-    if failures: combined += [''.join(failures).lstrip('\n')[:-1]]
-    combined += ["%s %s tests in %.3fs\n" % (RAN_TESTS_DIV, total_tests, t)]
-
-    if not failures: combined += ['OK\n']
-    else: combined += [
-        'FAILED (%s)\n' % ', '.join (
-            (total_fails  and ["failures=%s" % total_fails] or []) +
-            (total_errors and ["errors=%s"  % total_errors] or [])
-        )]
-
-    return total_tests, '\n'.join(combined)
-
-################################################################################
-
-def count(results, *args):
-    for arg in args:
-        all_of = [a for a in [v.get(arg) for v in results.values()] if a]
-        if not all_of: yield 0
-        else:
-            if isinstance(all_of[0], int): the_sum = all_of
-            else: the_sum = (len(v) for v in all_of)
-            yield sum(the_sum)
-
-def test_failures(results):
-    total,   = count(results, 'num_tests')
-    errors = {}
-
-    for module, result in results.items():
-        for breaker in ['errors', 'failures', 'return_code']:
-            if breaker not in result or result[breaker]:
-                if breaker not in result: total += 1
-                errors.update({module:result})
-                break
-
-    return total, errors
-
-################################################################################
-
-if options.subprocess:
-    from async_sub import proc_in_time_or_kill
-
-    def sub_test(module):
-        print 'loading', module
-        
-        pass_on_args = [a for a in sys.argv[1:] if a not in args]
-        cmd = [options.python, test_runner_py, module ] + pass_on_args
-
-        return module, (cmd, test_env, working_dir), proc_in_time_or_kill (
-            cmd,
-            options.time_out,
-            env = test_env,
-            wd = working_dir,
-        )
-
-    if options.multi_thread:
-        def tmap(f, args):
-            return pygame.threads.tmap (
-                f, args, stop_on_error = False,
-                num_workers = options.multi_thread
-            )
-    else: tmap = map
-
-    results = {}
-
-    t = time.time()
-
-    for module, cmd, (return_code, raw_return) in tmap(sub_test, test_modules):
-        cmd, test_env, working_dir = cmd
-
-        test_results = TEST_RESULTS_RE.search(raw_return)
-        if test_results:
-            try:     results.update(eval(test_results.group(1)))
-            except:  raise Exception("BUGGY EVAL:\n %s" % test_results.group(1))
-
-        else: results[module] = {}
-
-        results[module].update (
-            {
-                'return_code': return_code,
-                'raw_return' : raw_return,
-                'cmd'        : cmd,
-                'test_env'   : test_env,
-                'working_dir': working_dir,
-                'module'     : module,
-            }
-        )
-
-    untrusty_total, combined = combine_results(results, time.time() -t)
-    total, fails = test_failures(results)
-
-    if not options.dump or (options.human and untrusty_total == total):
-        print combined
-    else:
-        print TEST_RESULTS_START
-        print pformat(options.all and results or fails)
-
+#################################### IMPORTS ###################################
+
+import sys, os, re, unittest, subprocess, time, optparse
+import pygame.threads 
+
+from test_runner import run_test, get_test_results, TEST_RESULTS_START,\
+                        prepare_test_env, from_namespace, many_modules_key,\
+                        count, test_failures
+
+from pprint import pformat
+
+main_dir, test_subdir, fake_test_subdir = prepare_test_env()
+test_runner_py = os.path.join(main_dir, "test_runner.py")
+
+import test_utils
+
+################################### CONSTANTS ##################################
+# Defaults:
+#    See optparse options below for more options
+#
+
+# If an xxxx_test.py takes longer than TIME_OUT seconds it will be killed
+# This is only the default, can be over-ridden on command line
+
+TIME_OUT = 30
+
+# Any tests in IGNORE will not be ran
+IGNORE = (
+    "scrap_test",
+)
+
+# Subprocess has less of a need to worry about interference between tests
+SUBPROCESS_IGNORE = (
+    "scrap_test",
+)
+
+################################################################################
+# Human readable output
+#
+
+COMPLETE_FAILURE_TEMPLATE = """
+======================================================================
+ERROR: all_tests_for (%(module)s.AllTestCases)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "test\%(module)s.py", line 1, in all_tests_for
+
+subprocess completely failed with return code of %(return_code)s
+
+cmd:          %(cmd)s
+test_env:     %(test_env)s
+working_dir:  %(working_dir)s
+
+return (top 5 lines):
+%(raw_return)s
+
+"""  # Leave that last empty line else build page regex won't match
+
+TEST_MODULE_RE = re.compile('^(.+_test)\.py$')
+
+RAN_TESTS_DIV = (70 * "-") + "\nRan"
+
+DOTS = re.compile("^([FE.]*)$", re.MULTILINE)
+
+################################################################################
+# Set the command line options
+#
+# Defined in test_runner.py as it shares options, added to here
+
+from test_runner import opt_parser
+
+opt_parser.set_usage("""
+
+Runs all or some of the test/xxxx_test.py tests.
+
+$ run_tests.py sprite threads -sd
+
+Runs the sprite and threads module tests isolated in subprocesses, dumping all
+failing tests info in the form of a dict.
+
+""")
+
+opt_parser.set_defaults (
+    python = sys.executable,
+    time_out = TIME_OUT,
+)
+
+options, args = opt_parser.parse_args()
+
+################################################################################
+# Change to working directory and compile a list of test modules
+# If options.fake, then compile list of fake xxxx_test.py from run_tests__tests
+# this is used for testing subprocess output against single process mode
+
+if options.fake:
+    test_subdir = os.path.join(fake_test_subdir, options.fake )
+    sys.path.append(test_subdir)
+    working_dir = test_subdir
+else:
+    working_dir = main_dir
+
+test_env = {"PYTHONPATH": test_subdir}
+os.chdir(working_dir)
+
+if args:
+    test_modules = [
+        m.endswith('_test') and m or ('%s_test' % m) for m in args
+    ]
+else:
+    if options.subprocess: ignore = SUBPROCESS_IGNORE
+    else: ignore = IGNORE
+
+    test_modules = []
+    for f in sorted(os.listdir(test_subdir)):
+        for match in TEST_MODULE_RE.findall(f):
+            if match in ignore: continue
+            test_modules.append(match)
+
+################################################################################
+# Single process mode
+#
+
+if not options.subprocess:
+    single_results = run_test ( test_modules, options = options)
+    if options.dump: print pformat(single_results)
+    #TODO  make consistent with subprocess mode
+    else: print single_results[many_modules_key(test_modules)]['output']
+
+################################################################################
+# Subprocess mode
+#
+
+def combine_results(all_results, t):
+    """
+
+    Return pieced together subprocessed results in a form fit for human 
+    consumption. Don't rely on results. Was originally meant for that purpose 
+    but was found to be unreliable. 
+    
+    See options.dump or options.human for reliable results.
+
+    """
+
+    all_dots = ''
+    failures = []
+
+    for module, results in sorted(all_results.items()):
+        output, return_code, raw_return = map (
+            results.get, ('output','return_code', 'raw_return')
+        )
+
+        if not output or (return_code and RAN_TESTS_DIV not in output):
+            # would this effect the original dict? TODO
+            results['raw_return'] = ''.join(raw_return.splitlines(1)[:5])
+            failures.append( COMPLETE_FAILURE_TEMPLATE % results )
+            continue
+
+        dots = DOTS.search(output).group(1)
+        all_dots += dots
+
+        if 'E' in dots or 'F' in dots:
+            failures.append( output[len(dots)+1:].split(RAN_TESTS_DIV)[0] )
+    
+    total_fails, total_errors = map(all_dots.count, 'FE')
+    total_tests = len(all_dots)
+
+    combined = [all_dots]
+    if failures: combined += [''.join(failures).lstrip('\n')[:-1]]
+    combined += ["%s %s tests in %.3fs\n" % (RAN_TESTS_DIV, total_tests, t)]
+
+    if not failures: combined += ['OK\n']
+    else: combined += [
+        'FAILED (%s)\n' % ', '.join (
+            (total_fails  and ["failures=%s" % total_fails] or []) +
+            (total_errors and ["errors=%s"  % total_errors] or [])
+        )]
+
+    return total_tests, '\n'.join(combined)
+
+################################################################################
+
+if options.subprocess:
+    from async_sub import proc_in_time_or_kill
+
+    def sub_test(module):
+        print 'loading', module
+
+        pass_on_args = [a for a in sys.argv[1:] if a not in args]
+        cmd = [options.python, test_runner_py, module ] + pass_on_args
+
+        return module, (cmd, test_env, working_dir), proc_in_time_or_kill (
+            cmd, options.time_out,  env = test_env,  wd = working_dir,
+        )
+
+    if options.multi_thread:
+        def tmap(f, args):
+            return pygame.threads.tmap (
+                f, args, stop_on_error = False,
+                num_workers = options.multi_thread
+            )
+    else: tmap = map
+
+    results = {}
+    t = time.time()
+
+    for module, cmd, (return_code, raw_return) in tmap(sub_test, test_modules):
+        test_file = '%s.py' % os.path.join(test_subdir, module)
+        cmd, test_env, working_dir = cmd
+
+        test_results = get_test_results(raw_return)
+        if test_results: results.update(test_results)
+        else: results[module] = {}
+        
+        add_to_results = [
+            'return_code', 'raw_return',  'cmd', 'test_file',
+            'test_env', 'working_dir', 'module',
+        ]
+        # conditional adds here
+
+        results[module].update(from_namespace(locals(), add_to_results))
+
+    untrusty_total, combined = combine_results(results, time.time() -t)
+    total, fails = test_failures(results)
+
+    if not options.dump or (options.human and untrusty_total == total):
+        print combined
+    else:
+        print TEST_RESULTS_START
+        # print pformat(list(combined_errs(fails)))
+        print pformat(options.all and results or fails)
+
 ################################################################################
 
 #define DOC_PYGAMETRANSFORMAVERAGESURFACES "pygame.transform.average_surfaces(Surfaces, DestSurface = None): return Surface\nfind the average surface from many surfaces."
 
-#define DOC_PYGAMETRANSFORMTHRESHOLD "pygame.transform.threshold(DestSurface, Surface, color, threshold = (0,0,0,0), diff_color = (0,0,0,0), change_return = True): return num_threshold_pixels\nfinds which, and how many pixels in a surface are within a threshold of a color."
+#define DOC_PYGAMETRANSFORMTHRESHOLD "finds which, and how many pixels in a surface are within a threshold of a color."
 
                         break;
                     }
 
-
+                }
                     similar++;
-                }
 
 
 

src/transform.doc

 
 threshold
 finds which, and how many pixels in a surface are within a threshold of a color.
-pygame.transform.threshold(DestSurface, Surface, color, threshold = (0,0,0,0), diff_color = (0,0,0,0), change_return = True): return num_threshold_pixels
 
-Finds which, and how many pixels in a surface are within a threshold of a color.
+pygame.transform.threshold(DestSurface, Surface, color, threshold = (0,0,0,0), diff_color = (0,0,0,0), change_return = True, Surface =None): return num_threshold_pixels
 
 It can set the destination surface where all of the pixels not within the 
 threshold are changed to diff_color.
 Or it can be used to just count the number of pixels within the threshold if you set
 change_return to False.
 
+When given the optional third surface, it will use the colors in that rather 
+than the 3rd position "color" arg.
+
 You can use a threshold of (r,g,b,a) where the r,g,b can have different thresholds. So
 you could use an r threshold of 40 and a blue threshold of 2 if you like.
 

test/image__save_gl_surface_test.py

 
 class GL_ImageSave(unittest.TestCase):
     def test_image_save_works_with_opengl_surfaces(self):
+        "|tags:display,slow|"
+
         pygame.display.init()
         
         
         self.assert_(os.path.exists(tmp_file))
         
         os.remove(tmp_file)
+        # os.rmdir(tmp_dir)
         
         
         pygame.display.quit()

test/transform_test.py

             # the wrong size surface is past in.  Should raise an error.
             self.assertRaises(ValueError, pygame.transform.smoothscale, s, (33,64), s3)
 
+    
+    
+    
+    def test_threshold__honors_third_surface(self):
+        # __doc__ for threshold as of Tue 07/15/2008
 
+        # pygame.transform.threshold(DestSurface, Surface, color, threshold =
+        # (0,0,0,0), diff_color = (0,0,0,0), change_return = True, Surface =
+        # None): return num_threshold_pixels
 
+        # When given the optional third
+        # surface, it would use the colors in that rather than the "color"
+        # specified in the function to check against.
+        
+        # New in pygame 1.8
+
+        # Sizes
+        (w, h) = size = (32, 32)
+
+        # the original_color is within the threshold of the threshold_color
+        threshold = (20, 20, 20, 20)
+        original_color = (25,25,25,25)
+        threshold_color = (10, 10, 10, 10)
+
+        # Surfaces
+        original_surface = pygame.Surface(size, pygame.SRCALPHA, 32)
+        dest_surface    = pygame.Surface(size, pygame.SRCALPHA, 32)
+        
+        # Third surface is used in lieu of 3rd position arg color
+        third_surface   = pygame.Surface(size, pygame.SRCALPHA, 32)
+
+        # Color filling
+        original_surface.fill(original_color)
+        third_surface.fill(threshold_color)
+
+        # Threshold testing
+        pixels_within_threshold = pygame.transform.threshold (
+            dest_surface, original_surface, threshold_color,
+            threshold,
+            0, # diff_color
+            0  # change_return
+        )
+
+        self.assertEqual(w*h, pixels_within_threshold)
+        
+        # This should respect third_surface colors in place of 3rd arg color
+        # Should be the same as the surface.fill(threshold_color)
+        
+        pixels_within_threshold = pygame.transform.threshold (
+            dest_surface, 
+            original_surface,                              
+            0,                                            # color 
+            threshold,
+            0,                                            # diff_color 
+            0,                                            # change_return
+            third_surface,
+        )
+        
+        self.assertEqual(w*h, pixels_within_threshold)
 
     def test_threshold__surface(self):
         """
+################################################################################
+
 import sys, os, re, unittest, StringIO, time, optparse
+from inspect import getdoc, getmembers, isclass
 from pprint import pformat
 
 ################################################################################
 
 def prepare_test_env():
-    main_dir = os.path.split(os.path.abspath(sys.argv[0]))[0]
+    main_dir = os.path.split(os.path.abspath(__file__))[0]
     test_subdir = os.path.join(main_dir, 'test')
     sys.path.insert(0, test_subdir)
-    return main_dir, test_subdir
+    fake_test_subdir = os.path.join(test_subdir, 'run_tests__tests')
+    return main_dir, test_subdir, fake_test_subdir
 
-main_dir, test_subdir = prepare_test_env()
+main_dir, test_subdir, fake_test_subdir = prepare_test_env()
 import test_utils
 
 ################################################################################
      help   = "dump failures/errors as dict ready to eval" )
 
 opt_parser.add_option (
+     "-e",  "--exclude", 
+     help   = "exclude tests containing any of TAGS" )
+
+opt_parser.add_option (
      "-a",  "--all", action = 'store_true',
      help   = "dump all results not just errors eg. -da" )
 
 
 TEST_RESULTS_START = "<--!! TEST RESULTS START HERE !!-->"
 TEST_RESULTS_RE = re.compile('%s\n(.*)' % TEST_RESULTS_START, re.DOTALL | re.M)
+FILE_LINENUMBER_RE = re.compile(r'File "([^"]+)", line ([0-9]+)')
+
+def get_test_results(raw_return):
+    test_results = TEST_RESULTS_RE.search(raw_return)
+    if test_results:
+        try:     return eval(test_results.group(1))
+        except:  raise Exception (
+            "BUGGY TEST RESULTS EVAL:\n %s" % test_results.group(1)
+        )
+
+def count(results, *args, **kw):
+    if kw.get('single'): results = {'single' : results}
+    for arg in args:
+        all_of = [a for a in [v.get(arg) for v in results.values()] if a]
+        if not all_of: yield 0
+        else:
+            if isinstance(all_of[0], int): the_sum = all_of
+            else: the_sum = (len(v) for v in all_of)
+            yield sum(the_sum)
+
+################################################################################
 
 def redirect_output():
     yield sys.stderr, sys.stdout
 def StringIOContents(io):
     io.seek(0)
     return io.read()
+
+def merged_dict(*args):
+    dictionary = {}
+    for arg in args: dictionary.update(arg)        
+    return dictionary
     
-unittest._TextTestResult.monkeyRepr = lambda self, errors: [
-    (self.getDescription(e[0]), e[1]) for e in errors
+def from_namespace(ns, listing):
+    return dict((i, ns[i]) for i in listing)
+
+def many_modules_key(modules):
+    return ', '.join(modules)
+
+################################################################################
+# ERRORS
+
+unittest._TextTestResult.monkeyRepr = lambda self, flavour, errors:  [
+    (
+        "%s: %s" % (flavour, self.getDescription(e[0])),     # Description
+        e[1],                                                # TraceBack
+        FILE_LINENUMBER_RE.search(e[1]).groups(),            # Blame Info
+    )
+    for e in errors
 ]
 
+def make_complete_failure_error(result):
+    return (
+        "ERROR: all_tests_for (%s.AllTestCases)" % result['module'],
+        "Complete Failure (ret code: %s)" % result['return_code'],
+        (result['test_file'], '1'),
+    )
+
+def combined_errs(results):
+    for result in results.itervalues():
+        combined_errs = result['errors'] + result['failures']
+        for err in combined_errs:
+            yield err
+
+# For combined results, plural, used in subprocess mode
+def test_failures(results):
+    errors = {}
+    total, = count(results, 'num_tests')
+
+    for module, result in results.items():
+        num_errors = sum(count(result, 'failures', 'errors', single = 1))
+        if num_errors is 0 and result['return_code']:
+            result.update(RESULTS_TEMPLATE)
+            result['errors'].append(make_complete_failure_error(result))
+            num_errors += 1
+        if num_errors: errors.update({module:result})
+
+    return total, errors
+
+################################################################################
+
+TAGS_RE = re.compile(r"\|[tT]ags:([ a-zA-Z,0-9_\n]+)\|", re.DOTALL | re.MULTILINE)
+
+def get_tags(obj):
+    tags = TAGS_RE.search(getdoc(obj) or '')
+    return tags and [t.strip() for t in tags.group(1).split(',')] or []
+
+def is_test_case(obj):
+    return isclass(obj) and issubclass(obj, unittest.TestCase)
+
+def is_test(obj):
+    return callable(obj) and obj.__name__.startswith('test_') 
+
+def filter_by_tags(module, tags):
+    for tcstr, test_case in (m for m in getmembers(module, is_test_case)):
+        for tstr, test in (t for t in getmembers(test_case, is_test)):
+            for tag in get_tags(test):
+                if tag in tags:
+                    exec 'del module.%s.%s' % (tcstr, tstr)
+                    break
+
+################################################################################
+# For complete failures (+ namespace saving)
+
+RESULTS_TEMPLATE = {
+    'output'     :  '',
+    'stderr'     :  '',
+    'stdout'     :  '',
+    'num_tests'  :   0,
+    'failures'   :  [],
+    'errors'     :  [],
+}
+
+################################################################################
+
 def run_test(modules, options):
     if isinstance(modules, str): modules = [modules]
     suite = unittest.TestSuite()
 
-
     #TODO: ability to pass module.TestCase etc (names) from run_test.py
     for module in modules:
-        __import__(module)
+        m = __import__(module)
+
         print 'loading', module
+
+        if options.exclude:
+            filter_by_tags(m, [e.strip() for e in options.exclude.split(',')])
         
-        # TODO: based on optparse options
-        # filter test by tags
         # decorate tests with profiling wrappers etc
         
         test = unittest.defaultTestLoader.loadTestsFromName(module)
         suite.addTest(test)
 
-    (realerr, realout), (err, out) =  redirect_output()
-    # restore_output(realerr, realout)   #DEBUG
+    (realerr, realout), (stderr, stdout) =  redirect_output()
+    # restore_output(realerr, realout)       DEBUG
 
-    captured = StringIO.StringIO()
-    runner = unittest.TextTestRunner(stream = captured)
+    output = StringIO.StringIO()
+    runner = unittest.TextTestRunner(stream = output)
 
     test_utils.fail_incomplete_tests = options.incomplete
 
     results = runner.run(suite)
-    captured, err, out = map(StringIOContents, (captured, err, out))
+    output, stderr, stdout = map(StringIOContents, (output, stderr, stdout))
     restore_output(realerr, realout)
-
-    results = (
-        {
-            options.subprocess and modules[0] or 'all_tests':
-            {
-                'num_tests' : results.testsRun,
-                'failures'  : results.monkeyRepr(results.failures),
-                'errors'    : results.monkeyRepr(results.errors),
-                'output'    : captured,
-                'stderr'    : err,
-                'stdout'    : out,
-            }
-        }
-    )
+    
+    num_tests = results.testsRun
+    failures  = results.monkeyRepr('FAIL', results.failures)
+    errors    = results.monkeyRepr('ERROR', results.errors)
+    
+    # conditional adds here
+    results = {
+        many_modules_key(modules): from_namespace(locals(), RESULTS_TEMPLATE)
+    }
 
     if options.subprocess:
         print TEST_RESULTS_START
         print pformat(results)
     else:
-        return results['all_tests']
+        return results
 
 if __name__ == '__main__':
     options, args = opt_parser.parse_args()
     if not args: sys.exit('Called from run_tests.py, use that')
-    run_test(args[0], options)
+    run_test(args[0], options)
+    
+################################################################################
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.