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

Method write_array

_plotly_utils/png.py:837–851  ·  view source on GitHub ↗

Write an array that holds all the image values as a PNG file on the output file. See also :meth:`write` method.

(self, outfile, pixels)

Source from the content-addressed store, hash-verified

835 write_chunk(outfile, b"pHYs", struct.pack("!LLB", *tup))
836
837 def write_array(self, outfile, pixels):
838 """
839 Write an array that holds all the image values
840 as a PNG file on the output file.
841 See also :meth:`write` method.
842 """
843
844 if self.interlace:
845 if not isarray(pixels):
846 # Coerce to array type
847 fmt = "BH"[self.bitdepth > 8]
848 pixels = array(fmt, pixels)
849 self.write_passes(outfile, self.array_scanlines_interlace(pixels))
850 else:
851 self.write_passes(outfile, self.array_scanlines(pixels))
852
853 def array_scanlines(self, pixels):
854 """

Callers 1

writeMethod · 0.95

Calls 4

write_passesMethod · 0.95
array_scanlinesMethod · 0.95
isarrayFunction · 0.85

Tested by

no test coverage detected