Home | History | Annotate | Download | only in png

Lines Matching refs:png

5 package png
83 // the sng command-line tool. Package png doesn't keep that metadata when
84 // png.Decode returns an image.Image.
100 // the sng command-line tool. Package png doesn't keep that metadata when
101 // png.Decode returns an image.Image.
108 // approximation to the sng command-line tool. The PNG model is that
111 // image.Image type returned by png.Decode, such as image.RGBA (with all pixels
114 // can't otherwise discriminate PNG's "IHDR says color (with no alpha) but tRNS
127 func sng(w io.WriteCloser, filename string, png image.Image) {
129 bounds := png.Bounds()
130 cm := png.ColorModel()
151 paletted = png.(*image.Paletted)
155 io.WriteString(w, "#SNG: from "+filename+".png\nIHDR {\n")
170 io.WriteString(w, "unknown PNG decoder color model\n")
175 // We fake a gAMA chunk. The test files have a gAMA chunk but the go PNG
176 // parser ignores it (the PNG spec section 11.3 says "Ancillary chunks may
223 switch c := png.At(0, 0).(type) {
261 gray := png.At(x, y).(color.Gray)
266 gray16 := png.At(x, y).(color.Gray16)
271 rgba := png.At(x, y).(color.RGBA)
276 rgba64 := png.At(x, y).(color.RGBA64)
281 nrgba := png.At(x, y).(color.NRGBA)
295 nrgba64 := png.At(x, y).(color.NRGBA64)
337 // Read the .png file.
338 img, err := readPNG("testdata/pngsuite/" + fn + ".png")
418 {"invalid-zlib.png", "zlib: invalid checksum"},
419 {"invalid-crc32.png", "invalid checksum"},
420 {"invalid-noend.png", "unexpected EOF"},
421 {"invalid-trunc.png", "unexpected EOF"},
442 f, err := os.Open("testdata/pngsuite/" + fn + ".png")
466 a, err := readPNG("testdata/gray-gradient.png")
470 b, err := readPNG("testdata/gray-gradient.interlaced.png")
480 // The following is an invalid 1x2 grayscale PNG image. The header is OK,
495 // The following is a valid 1x1 PNG image containing color.Gray{255} and
496 // a trailing zero-length IDAT chunk (see PNG specification section 12.9):
523 The following is a valid 1x1 paletted PNG image with a 1-element palette
525 0000000: 8950 4e47 0d0a 1a0a 0000 000d 4948 4452 .PNG........IHDR
610 benchmarkDecode(b, "testdata/benchGray.png", 1)
614 benchmarkDecode(b, "testdata/benchNRGBA-gradient.png", 4)
618 benchmarkDecode(b, "testdata/benchNRGBA-opaque.png", 4)
622 benchmarkDecode(b, "testdata/benchPaletted.png", 1)
626 benchmarkDecode(b, "testdata/benchRGB.png", 4)
630 benchmarkDecode(b, "testdata/benchRGB-interlace.png", 4)