Source File
impl.go
Belonging Package
image/internal/imageutil
package imageutil
import (
)
:= (.Min.X - .Rect.Min.X) * 4
:= (.Max.X - .Rect.Min.X) * 4
:= .Min.Y - .Rect.Min.Y
:= .Max.Y - .Rect.Min.Y
switch .SubsampleRatio {
case image.YCbCrSubsampleRatio444:
for , := , .Y; != ; , = +1, +1 {
:= .Pix[*.Stride:]
:= (-.Rect.Min.Y)*.YStride + (.X - .Rect.Min.X)
:= (-.Rect.Min.Y)*.CStride + (.X - .Rect.Min.X)
for := ; != ; , , = +4, +1, +1 {
:= [ : +4 : len()]
[0] = uint8()
[1] = uint8()
[2] = uint8()
[3] = 255
}
}
case image.YCbCrSubsampleRatio420:
for , := , .Y; != ; , = +1, +1 {
:= .Pix[*.Stride:]
:= (-.Rect.Min.Y)*.YStride + (.X - .Rect.Min.X)
:= (/2-.Rect.Min.Y/2)*.CStride - .Rect.Min.X/2
for , := , .X; != ; , , = +4, +1, +1 {
:= + /2
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |