예제 #1
0
파일: utils.go 프로젝트: eliquious/gift
// check if image is opaque
func isOpaque(img image.Image) bool {
	switch img := img.(type) {
	case *image.NRGBA:
		return img.Opaque()
	case *image.NRGBA64:
		return img.Opaque()
	case *image.RGBA:
		return img.Opaque()
	case *image.RGBA64:
		return img.Opaque()
	case *image.Gray:
		return true
	case *image.Gray16:
		return true
	case *image.YCbCr:
		return true
	case *image.Paletted:
		return img.Opaque()
	}
	return false
}