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:
parent
f1e9747265
commit
00fe24ef7b
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user