{"action":"closed","issue":{"url":"https://api.github.com/repos/golang/go/issues/20926","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/20926/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/20926/comments","events_url":"https://api.github.com/repos/golang/go/issues/20926/events","html_url":"https://github.com/golang/go/issues/20926","id":241011530,"number":20926,"title":"proposal: the api image.NewYCbCr allow user input initial image data to init it","user":{"login":"acrazing","id":10029810,"avatar_url":"https://avatars0.githubusercontent.com/u/10029810?v=4","gravatar_id":"","url":"https://api.github.com/users/acrazing","html_url":"https://github.com/acrazing","followers_url":"https://api.github.com/users/acrazing/followers","following_url":"https://api.github.com/users/acrazing/following{/other_user}","gists_url":"https://api.github.com/users/acrazing/gists{/gist_id}","starred_url":"https://api.github.com/users/acrazing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acrazing/subscriptions","organizations_url":"https://api.github.com/users/acrazing/orgs","repos_url":"https://api.github.com/users/acrazing/repos","events_url":"https://api.github.com/users/acrazing/events{/privacy}","received_events_url":"https://api.github.com/users/acrazing/received_events","type":"User","site_admin":false},"labels":[{"id":236419512,"url":"https://api.github.com/repos/golang/go/labels/Proposal","name":"Proposal","color":"ededed","default":false},{"id":357033853,"url":"https://api.github.com/repos/golang/go/labels/WaitingForInfo","name":"WaitingForInfo","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/30","html_url":"https://github.com/golang/go/milestone/30","labels_url":"https://api.github.com/repos/golang/go/milestones/30/labels","id":1373555,"number":30,"title":"Proposal","description":"Proposals that are pending (not yet accepted/rejected).\r\n","creator":{"login":"rsc","id":104030,"avatar_url":"https://avatars1.githubusercontent.com/u/104030?v=4","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"open_issues":112,"closed_issues":188,"state":"open","created_at":"2015-10-24T01:40:49Z","updated_at":"2017-07-19T00:37:09Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2017-07-06T16:19:21Z","updated_at":"2017-07-19T00:37:09Z","closed_at":"2017-07-19T00:37:09Z","body":"Currently, this API init the image with an empty bytes slice, it is useless for handle a yuv stream for we need to init it with user defined data usually.\r\n\r\nThe souce code at: <https://github.com/golang/go/blob/c478c48597e2fb7c52ea39d1dde51448949860ce/src/image/ycbcr.go#L169-L184>\r\n\r\nas follow:\r\n\r\n```go\r\n// NewYCbCr returns a new YCbCr image with the given bounds and subsample\r\n// ratio.\r\nfunc NewYCbCr(r Rectangle, subsampleRatio YCbCrSubsampleRatio) *YCbCr {\r\n    w, h, cw, ch := yCbCrSize(r, subsampleRatio)\r\n    i0 := w*h + 0*cw*ch\r\n    i1 := w*h + 1*cw*ch\r\n    i2 := w*h + 2*cw*ch\r\n    b := make([]byte, i2)\r\n    return &YCbCr{\r\n        Y:              b[:i0:i0],\r\n        Cb:             b[i0:i1:i1],\r\n        Cr:             b[i1:i2:i2],\r\n        SubsampleRatio: subsampleRatio,\r\n        YStride:        w,\r\n        CStride:        cw,\r\n        Rect:           r,\r\n    }\r\n}\r\n```\r\n\r\nEnv: Go 1.8.3, x86-64, MacOS 10\r\n"}}
{"actor":{"display_login":"nigeltao"}}