draw_go117.go 900 B

123456789101112131415161718192021222324252627
  1. // Copyright 2021 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. //go:build go1.17
  5. // +build go1.17
  6. package draw
  7. import (
  8. "image/draw"
  9. )
  10. // The package documentation, in draw.go, gives the intent of this package:
  11. //
  12. // This package is a superset of and a drop-in replacement for the
  13. // image/draw package in the standard library.
  14. //
  15. // "Drop-in replacement" means that we use type aliases in this file.
  16. //
  17. // TODO: move the type aliases to draw.go once Go 1.16 is no longer supported.
  18. // RGBA64Image extends both the Image and image.RGBA64Image interfaces with a
  19. // SetRGBA64 method to change a single pixel. SetRGBA64 is equivalent to
  20. // calling Set, but it can avoid allocations from converting concrete color
  21. // types to the color.Color interface type.
  22. type RGBA64Image = draw.RGBA64Image