draw: alias the stdlib draw.RGBA64Image type The stdlib type is new in Go 1.17 (CL 311129). Change-Id: If5981c39f6c31cdf785576f9373db5661c99753c Reviewed-on: https://go-review.googlesource.com/c/image/+/330489 Trust: Nigel Tao <nigeltao@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
diff --git a/draw/draw_go117.go b/draw/draw_go117.go new file mode 100644 index 0000000..fa83648 --- /dev/null +++ b/draw/draw_go117.go
@@ -0,0 +1,27 @@ +// Copyright 2021 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build go1.17 +// +build go1.17 + +package draw + +import ( + "image/draw" +) + +// The package documentation, in draw.go, gives the intent of this package: +// +// This package is a superset of and a drop-in replacement for the +// image/draw package in the standard library. +// +// "Drop-in replacement" means that we use type aliases in this file. +// +// TODO: move the type aliases to draw.go once Go 1.16 is no longer supported. + +// RGBA64Image extends both the Image and image.RGBA64Image interfaces with a +// SetRGBA64 method to change a single pixel. SetRGBA64 is equivalent to +// calling Set, but it can avoid allocations from converting concrete color +// types to the color.Color interface type. +type RGBA64Image = draw.RGBA64Image