- """Create and return an iterator object for this pixel data object."""
- return self.PixelIterator(self)
-
- class PixelIterator(object):
- """
- Sequential iterator which returns pixel accessor objects starting at the
- the top-left corner, and going row-by-row until the bottom-right
- corner is reached.
- """
-
- class PixelAccessor(object):
- """
- This class is what is returned by the iterator and allows the pixel
- to be Get or Set.
- """
- def __init__(self, data, pixels, x, y):
- self.data = data
- self.pixels = pixels
- self.x = x
- self.y = y
- def Set(self, *args, **kw):
- self.pixels.MoveTo(self.data, self.x, self.y)
- return self.pixels.Set(*args, **kw)
+ """
+ Create and return an iterator object for this pixel data
+ object. (It's really a generator but I won't tell if you
+ don't tell.)
+ """
+ width = self.GetWidth()
+ height = self.GetHeight()
+ pixels = self.GetPixels()
+
+
+
+
+ class PixelFacade(object):