|
|
|
|
159
|
// imageYCbCrToYCC converts a YCbCr image to a ycc image for resizing.
|
159
|
// imageYCbCrToYCC converts a YCbCr image to a ycc image for resizing.
|
160
|
func imageYCbCrToYCC(in *image.YCbCr) *ycc {
|
160
|
func imageYCbCrToYCC(in *image.YCbCr) *ycc {
|
161
|
w, h := in.Rect.Dx(), in.Rect.Dy()
|
161
|
w, h := in.Rect.Dx(), in.Rect.Dy()
|
|
|
162
|
+ r := image.Rect(0, 0, w, h)
|
162
|
buf := make([]uint8, 3*w*h)
|
163
|
buf := make([]uint8, 3*w*h)
|
163
|
- p := ycc{Pix: buf, Stride: 3 * w, Rect: in.Rect, SubsampleRatio: in.SubsampleRatio}
|
|
|
|
|
164
|
+ p := ycc{Pix: buf, Stride: 3 * w, Rect: r, SubsampleRatio: in.SubsampleRatio}
|
164
|
var off int
|
165
|
var off int
|
165
|
|
166
|
|
166
|
switch in.SubsampleRatio {
|
167
|
switch in.SubsampleRatio {
|