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 <r@golang.org>
This commit is contained in:
Nigel Tao 2015-10-10 11:24:47 +11:00
parent f1e9747265
commit 00fe24ef7b
2 changed files with 10 additions and 3 deletions

View File

@ -18,7 +18,6 @@ import (
"golang.org/x/image/riff" "golang.org/x/image/riff"
"golang.org/x/image/vp8" "golang.org/x/image/vp8"
"golang.org/x/image/vp8l" "golang.org/x/image/vp8l"
"golang.org/x/image/webp/nycbcra"
) )
var errInvalidFormat = errors.New("webp: invalid format") 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 return nil, image.Config{}, err
} }
if alpha != nil { if alpha != nil {
return &nycbcra.Image{ return &image.NYCbCrA{
YCbCr: *m, YCbCr: *m,
A: alpha, A: alpha,
AStride: alphaStride, 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 heightMinusOne = uint32(buf[7]) | uint32(buf[8])<<8 | uint32(buf[9])<<16
if configOnly { if configOnly {
return nil, image.Config{ return nil, image.Config{
ColorModel: nycbcra.ColorModel, ColorModel: color.NYCbCrAModel,
Width: int(widthMinusOne) + 1, Width: int(widthMinusOne) + 1,
Height: int(heightMinusOne) + 1, Height: int(heightMinusOne) + 1,
}, nil }, nil

View File

@ -4,6 +4,9 @@
// Package nycbcra provides non-alpha-premultiplied Y'CbCr-with-alpha image and // Package nycbcra provides non-alpha-premultiplied Y'CbCr-with-alpha image and
// color types. // 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" package nycbcra // import "golang.org/x/image/webp/nycbcra"
import ( import (
@ -11,6 +14,11 @@ import (
"image/color" "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 // 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: // image/draw package can have fast-path code. Moving would rename:
// nycbcra.Color to color.NYCbCrA // nycbcra.Color to color.NYCbCrA