MCPcopy Index your code
hub / github.com/plotly/plotly.py / adam7_generate

Function adam7_generate

_plotly_utils/png.py:212–227  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

210
211
212def 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)

Callers 2

_deinterlaceMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected