internal/png/stdlibwriter.go
func levelToZlib(l CompressionLevel) int {
	switch l {
	case DefaultCompression:
		return zlib.DefaultCompression
	case NoCompression:
		return zlib.NoCompression
	case BestSpeed:
		return zlib.BestSpeed
	case BestCompression:
		return zlib.BestCompression
	default:
		return zlib.DefaultCompression
	}
}
func levelToZlib(l CompressionLevel) int {
	switch l {
	case DefaultCompression:
		return zlib.DefaultCompression
	case NoCompression:
		return zlib.NoCompression
	case BestSpeed:
		return zlib.BestSpeed
	case BestCompression:
		return zlib.BestCompression
	default:
		return zlib.DefaultCompression
	}
}
func levelToZlib ( l CompressionLevel ) int { switch l { case DefaultCompression : return zlib . DefaultCompression case NoCompression : return zlib . NoCompression case BestSpeed : return zlib . BestSpeed case BestCompression : return zlib . BestCompression default : return zlib . DefaultCompression } }
// This function is required because we want the zero value of
// Encoder.CompressionLevel to map to zlib.DefaultCompression.
This function is required because we want the zero value of Encoder . CompressionLevel to map to zlib . DefaultCompression .