Mercurial > pygame
diff src/pixelarray.c @ 992:1577bcf02ed5
Added threshold recognition using weighted euclideance distances to PixelArray.replace() and PixelArray.extract(). Fixed slice assignment issue.
| author | marcus |
|---|---|
| date | Sat, 05 Apr 2008 10:46:13 +0000 |
| parents | 684d96c73d0d |
| children | b678d5e99f33 |
line wrap: on
line diff
--- a/src/pixelarray.c Fri Apr 04 10:40:09 2008 +0000 +++ b/src/pixelarray.c Sat Apr 05 10:46:13 2008 +0000 @@ -95,9 +95,9 @@ */ static PyMethodDef _pxarray_methods[] = { - { "replace", (PyCFunction) _replace_color, METH_VARARGS, + { "replace", (PyCFunction) _replace_color, METH_KEYWORDS, DOC_PIXELARRAYREPLACE }, - { "extract", (PyCFunction) _extract_color, METH_VARARGS, + { "extract", (PyCFunction) _extract_color, METH_KEYWORDS, DOC_PIXELARRAYEXTRACT }, { "make_surface", (PyCFunction) _make_surface, METH_NOARGS, DOC_PIXELARRAYMAKESURFACE }, @@ -1019,7 +1019,7 @@ xstart = array->xstart; ystart = array->ystart + low * array->ystep; xlen = array->xlen; - ylen = high; + ylen = ABS (high - low); ystep = array->ystep; xstep = array->xstep; padding = array->padding; @@ -1028,7 +1028,7 @@ { xstart = array->xstart + low * array->xstep; ystart = array->ystart; - xlen = high; + xlen = ABS (high - low); ylen = array->ylen; xstep = array->xstep; ystep = array->ystep;
