Generate the coordinates for the reduced scanlines of an Adam7 interlaced image of size `width` by `height` pixels. Yields a generator for each pass, and each pass generator yields a series of (x, y, xstep) triples, each one identifying a reduced scanline consisting of
(width, height)
| 210 | |
| 211 | |
| 212 | def adam7_generate(width, height): |
| 213 | """ |
| 214 | Generate the coordinates for the reduced scanlines |
| 215 | of an Adam7 interlaced image |
| 216 | of size `width` by `height` pixels. |
| 217 | |
| 218 | Yields a generator for each pass, |
| 219 | and each pass generator yields a series of (x, y, xstep) triples, |
| 220 | each one identifying a reduced scanline consisting of |
| 221 | pixels starting at (x, y) and taking every xstep pixel to the right. |
| 222 | """ |
| 223 | |
| 224 | for xstart, ystart, xstep, ystep in adam7: |
| 225 | if xstart >= width: |
| 226 | continue |
| 227 | yield ((xstart, y, xstep) for y in range(ystart, height, ystep)) |
| 228 | |
| 229 | |
| 230 | # Models the 'pHYs' chunk (used by the Reader) |
no outgoing calls
no test coverage detected