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

Method rows_from_interlace

_plotly_utils/png.py:1821–1833  ·  view source on GitHub ↗

Yield each row from an interlaced PNG.

()

Source from the content-addressed store, hash-verified

1819 if self.interlace:
1820
1821 def rows_from_interlace():
1822 """Yield each row from an interlaced PNG."""
1823 # It's important that this iterator doesn't read
1824 # IDAT chunks until it yields the first row.
1825 bs = bytearray(itertools.chain(*raw))
1826 arraycode = "BH"[self.bitdepth > 8]
1827 # Like :meth:`group` but
1828 # producing an array.array object for each row.
1829 values = self._deinterlace(bs)
1830 vpr = self.width * self.planes
1831 for i in range(0, len(values), vpr):
1832 row = array(arraycode, values[i : i + vpr])
1833 yield row
1834
1835 rows = rows_from_interlace()
1836 else:

Callers

nothing calls this directly

Calls 1

_deinterlaceMethod · 0.95

Tested by

no test coverage detected