[Python-3000] PEP 368: Standard image protocol and class (original) (raw)
Edin Salkovic edin.salkovic at gmail.com
Tue Jul 3 10:11:59 CEST 2007
- Previous message: [Python-3000] PEP 368: Standard image protocol and class
- Next message: [Python-3000] PEP 368: Standard image protocol and class
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi Lino,
On 7/1/07, Lino Mastrodomenico <l.mastrodomenico at gmail.com> wrote:
_getitem_(integer) -> line
Returns the line at the specified (y) position.
Just some ideas to think about.
Have you considered adding a separate lines property to the Image protocol?
Does one, by default, want to iterate over lines or over pixels of an image? Even your example iterates over pixels:
iterate over an image
for line in rgb_image: for pixel in line: # swap red and blue, and set green to 0 pixel.value = pixel.b, 0, pixel.r
why not just:
iterate over an image
for pixel in rgb_image: pixel.value = pixel.b, 0, pixel.r
- The pixels method (same for the possible lines property that I mentioned above) should probably be a property, i.e.: pixels -> iterator[pixel], not: pixels() -> iterator[pixel]
P.S.: You might also inform the SciPy/NumPy lists about the PEP.
Keep up the good work!, Edin
- Previous message: [Python-3000] PEP 368: Standard image protocol and class
- Next message: [Python-3000] PEP 368: Standard image protocol and class
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]