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

Method read_flat

_plotly_utils/png.py:1854–1870  ·  view source on GitHub ↗

Read a PNG file and decode it into a single array of values. Returns (*width*, *height*, *values*, *info*). May use excessive memory. `values` is a single array. The :meth:`read` method is more stream-friendly than this, because it returns a sequen

(self)

Source from the content-addressed store, hash-verified

1852 return self.width, self.height, rows, info
1853
1854 def read_flat(self):
1855 """
1856 Read a PNG file and decode it into a single array of values.
1857 Returns (*width*, *height*, *values*, *info*).
1858
1859 May use excessive memory.
1860
1861 `values` is a single array.
1862
1863 The :meth:`read` method is more stream-friendly than this,
1864 because it returns a sequence of rows.
1865 """
1866
1867 x, y, pixel, info = self.read()
1868 arraycode = "BH"[info["bitdepth"] > 8]
1869 pixel = array(arraycode, itertools.chain(*pixel))
1870 return x, y, pixel, info
1871
1872 def palette(self, alpha="natural"):
1873 """

Callers

nothing calls this directly

Calls 1

readMethod · 0.95

Tested by

no test coverage detected