Commits

marcus  committed a5e20f1

_Really_ fixed the mask docs.

  • Participants
  • Parent commits 2c37905

Comments (0)

Files changed (6)

 #
 #
 
+Mar 30, 2008
+    Added subscript support to PixelArray and PixelArray.make_surface()
+      to create a new surface from the PixelArray view.
+    Fixed mask namespace pollution and docs.
+
+release_1_8_0release
 Mar 18, 2008
     Updated credits.
     Mac OSX binary now has movie module working.

File docs/ref/index.html

 <li><a href="mask.html#pygame.mask">pygame.mask</a> - <font size=-1>pygame module for image masks.</font></li>
 <ul>
 <li><a href="mask.html#pygame.mask.from_surface">pygame.mask.from_surface</a> - <font size=-1>Returns a Mask from the given surface.</font></li>
-<li><a href="mask.html#pygame.mask.get_at">pygame.mask.get_at</a> - <font size=-1>Returns nonzero if the bit at (x,y) is set.</font></li>
-<li><a href="mask.html#pygame.mask.get_bounding_rects">pygame.mask.get_bounding_rects</a> - <font size=-1>Returns a list of bounding rects of regions of set pixels.</font></li>
-<li><a href="mask.html#pygame.mask.get_size">pygame.mask.get_size</a> - <font size=-1>Returns the size of the mask.</font></li>
 <li><a href="mask.html#pygame.mask.Mask">pygame.mask.Mask</a> - <font size=-1>pygame object for representing 2d bitmasks</font></li>
-<li><a href="mask.html#pygame.mask.overlap">pygame.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></li>
-<li><a href="mask.html#pygame.mask.overlap_area">pygame.mask.overlap_area</a> - <font size=-1>Returns the number of overlapping 'pixels'.</font></li>
-<li><a href="mask.html#pygame.mask.set_at">pygame.mask.set_at</a> - <font size=-1>Sets the position in the mask given by x and y.</font></li>
+<ul>
+<li><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></li>
+<li><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></li>
+<li><a href="mask.html#Mask.get_size">Mask.get_size</a> - <font size=-1>Returns the size of the mask.</font></li>
+<li><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></li>
+<li><a href="mask.html#Mask.overlap_area">Mask.overlap_area</a> - <font size=-1>Returns the number of overlapping 'pixels'.</font></li>
+<li><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></li>
+</ul>
 </ul>
 <li><a href="mixer.html#pygame.mixer">pygame.mixer</a> - <font size=-1>pygame module for loading and playing sounds</font></li>
 <ul>

File docs/ref/mask.html

 <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>
-  <tr><td><a href="mask.html#pygame.mask.get_size">pygame.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#pygame.mask.get_at">pygame.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#pygame.mask.set_at">pygame.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#pygame.mask.overlap">pygame.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#pygame.mask.overlap_area">pygame.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#pygame.mask.get_bounding_rects">pygame.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>
 <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>
 <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> 
-<br></ul>
 
 
-<a name="pygame.mask.get_size">
-<big><b>pygame.mask.get_size</big></b><br><ul>
+<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:pygame.mask.get_size--> &nbsp;<br> 
+<!--COMMENTS:Mask.get_size--> &nbsp;<br> 
 <br></ul>
 
 
-<a name="pygame.mask.get_at">
-<big><b>pygame.mask.get_at</big></b><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:pygame.mask.get_at--> &nbsp;<br> 
+<!--COMMENTS:Mask.get_at--> &nbsp;<br> 
 <br></ul>
 
 
-<a name="pygame.mask.set_at">
-<big><b>pygame.mask.set_at</big></b><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:pygame.mask.set_at--> &nbsp;<br> 
+<!--COMMENTS:Mask.set_at--> &nbsp;<br> 
 <br></ul>
 
 
-<a name="pygame.mask.overlap">
-<big><b>pygame.mask.overlap</big></b><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>
-<!--COMMENTS:pygame.mask.overlap--> &nbsp;<br> 
+<!--COMMENTS:Mask.overlap--> &nbsp;<br> 
 <br></ul>
 
 
-<a name="pygame.mask.overlap_area">
-<big><b>pygame.mask.overlap_area</big></b><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:pygame.mask.overlap_area--> &nbsp;<br> 
+<!--COMMENTS:Mask.overlap_area--> &nbsp;<br> 
 <br></ul>
 
 
-<a name="pygame.mask.get_bounding_rects">
-<big><b>pygame.mask.get_bounding_rects</big></b><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:pygame.mask.get_bounding_rects--> &nbsp;<br> 
+<!--COMMENTS:Mask.get_bounding_rects--> &nbsp;<br> 
+<br></ul>
 <br></ul>
 <br></ul>
 
 
 static PyMethodDef maskobj_builtins[] =
 {
-    { "get_size", mask_get_size, METH_VARARGS, DOC_PYGAMEMASKGETSIZE},
-    { "get_at", mask_get_at, METH_VARARGS, DOC_PYGAMEMASKGETAT },
-    { "set_at", mask_set_at, METH_VARARGS, DOC_PYGAMEMASKSETAT },
-    { "overlap", mask_overlap, METH_VARARGS, DOC_PYGAMEMASKOVERLAP },
+    { "get_size", mask_get_size, METH_VARARGS, DOC_MASKGETSIZE},
+    { "get_at", mask_get_at, METH_VARARGS, DOC_MASKGETAT },
+    { "set_at", mask_set_at, METH_VARARGS, DOC_MASKSETAT },
+    { "overlap", mask_overlap, METH_VARARGS, DOC_MASKOVERLAP },
     { "overlap_area", mask_overlap_area, METH_VARARGS,
-      DOC_PYGAMEMASKOVERLAPAREA },
+      DOC_MASKOVERLAPAREA },
     { "get_bounding_rects", mask_get_bounding_rects, METH_VARARGS,
-      DOC_PYGAMEMASKGETBOUNDINGRECTS },
+      DOC_MASKGETBOUNDINGRECTS },
 
     { NULL, NULL, 0, NULL }
 };

File src/mask.doc

 Mask
 pygame object for representing 2d bitmasks
 pygame.Mask((width, height): return Mask
-<END>
+<SECTION>
 
 get_size
 Returns the size of the mask.

File src/pygamedocs.h

 
 #define DOC_PYGAMEMASKMASK "pygame.Mask((width, height): return Mask\npygame object for representing 2d bitmasks"
 
-#define DOC_PYGAMEMASKGETSIZE "Mask.get_size() -> width,height\nReturns the size of the mask."
+#define DOC_MASKGETSIZE "Mask.get_size() -> width,height\nReturns the size of the mask."
 
-#define DOC_PYGAMEMASKGETAT "Mask.get_at((x,y)) -> int\nReturns nonzero if the bit at (x,y) is set."
+#define DOC_MASKGETAT "Mask.get_at((x,y)) -> int\nReturns nonzero if the bit at (x,y) is set."
 
-#define DOC_PYGAMEMASKSETAT "Mask.set_at((x,y),value)\nSets the position in the mask given by x and y."
+#define DOC_MASKSETAT "Mask.set_at((x,y),value)\nSets the position in the mask given by x and y."
 
-#define DOC_PYGAMEMASKOVERLAP "Mask.overlap(othermask, offset) -> x,y\nReturns the point of intersection if the masks overlap with the given offset - or None if it does not overlap."
+#define DOC_MASKOVERLAP "Mask.overlap(othermask, offset) -> x,y\nReturns the point of intersection if the masks overlap with the given offset - or None if it does not overlap."
 
-#define DOC_PYGAMEMASKOVERLAPAREA "Mask.overlap_area(othermask, offset) -> numpixels\nReturns the number of overlapping 'pixels'."
+#define DOC_MASKOVERLAPAREA "Mask.overlap_area(othermask, offset) -> numpixels\nReturns the number of overlapping 'pixels'."
 
-#define DOC_PYGAMEMASKGETBOUNDINGRECTS "Mask.get_bounding_rects() -> Rects\nReturns a list of bounding rects of regions of set pixels."
+#define DOC_MASKGETBOUNDINGRECTS "Mask.get_bounding_rects() -> Rects\nReturns a list of bounding rects of regions of set pixels."
 
 #define DOC_PYGAMEMIXER "pygame module for loading and playing sounds"