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)
| 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 | """ |
no test coverage detected