git clone https://git.lucas.co/go_mono.git
webp/nycbcra: deprecate package.
The standard image and image/color packages have NYCbCrA support, as of Go 1.6.
Change-Id: I3ed2a502b3b9fe720968ac21901115e20a11456a
Reviewed-on: https://go-review.googlesource.com/21066
Reviewed-by: Rob Pike <[email protected]>
webp/decode.go | 5 ++---
webp/nycbcra/nycbcra.go | 8 ++++++++
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/webp/decode.go b/webp/decode.go
index 60fb556..134307e 100644
--- a/webp/decode.go
+++ b/webp/decode.go
@@ -18,7 +18,6 @@ import (
"golang.org/x/image/riff"
"golang.org/x/image/vp8"
"golang.org/x/image/vp8l"
- "golang.org/x/image/webp/nycbcra"
)
var errInvalidFormat = errors.New("webp: invalid format")
@@ -98,7 +97,7 @@ func decode(r io.Reader, configOnly bool) (image.Image, image.Config, error) {
return nil, image.Config{}, err
}
if alpha != nil {
- return &nycbcra.Image{
+ return &image.NYCbCrA{
YCbCr: *m,
A: alpha,
AStride: alphaStride,
@@ -138,7 +137,7 @@ func decode(r io.Reader, configOnly bool) (image.Image, image.Config, error) {
heightMinusOne = uint32(buf[7]) | uint32(buf[8])<<8 | uint32(buf[9])<<16
if configOnly {
return nil, image.Config{
- ColorModel: nycbcra.ColorModel,
+ ColorModel: color.NYCbCrAModel,
Width: int(widthMinusOne) + 1,
Height: int(heightMinusOne) + 1,
}, nil
diff --git a/webp/nycbcra/nycbcra.go b/webp/nycbcra/nycbcra.go
index 2e1fe05..101c41f 100644
--- a/webp/nycbcra/nycbcra.go
+++ b/webp/nycbcra/nycbcra.go
@@ -4,6 +4,9 @@
// Package nycbcra provides non-alpha-premultiplied Y'CbCr-with-alpha image and
// color types.
+//
+// Deprecated: as of Go 1.6. Use the standard image and image/color packages
+// instead.
package nycbcra // import "golang.org/x/image/webp/nycbcra"
import (
@@ -11,6 +14,11 @@ import (
"image/color"
)
+func init() {
+ println("The golang.org/x/image/webp/nycbcra package is deprecated, as of Go 1.6. " +
+ "Use the standard image and image/color packages instead.")
+}
+
// TODO: move this to the standard image and image/color packages, so that the
// image/draw package can have fast-path code. Moving would rename:
// nycbcra.Color to color.NYCbCrA