Merge branch 'YCC'
This commit is contained in:
commit
171c886e38
3
ycc.go
3
ycc.go
|
@ -159,8 +159,9 @@ func (p *ycc) YCbCr() *image.YCbCr {
|
||||||
// imageYCbCrToYCC converts a YCbCr image to a ycc image for resizing.
|
// imageYCbCrToYCC converts a YCbCr image to a ycc image for resizing.
|
||||||
func imageYCbCrToYCC(in *image.YCbCr) *ycc {
|
func imageYCbCrToYCC(in *image.YCbCr) *ycc {
|
||||||
w, h := in.Rect.Dx(), in.Rect.Dy()
|
w, h := in.Rect.Dx(), in.Rect.Dy()
|
||||||
|
r := image.Rect(0, 0, w, h)
|
||||||
buf := make([]uint8, 3*w*h)
|
buf := make([]uint8, 3*w*h)
|
||||||
p := ycc{Pix: buf, Stride: 3 * w, Rect: in.Rect, SubsampleRatio: in.SubsampleRatio}
|
p := ycc{Pix: buf, Stride: 3 * w, Rect: r, SubsampleRatio: in.SubsampleRatio}
|
||||||
var off int
|
var off int
|
||||||
|
|
||||||
switch in.SubsampleRatio {
|
switch in.SubsampleRatio {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user