{"action":"created","issue":{"url":"https://api.github.com/repos/Khan/Prototope/issues/57","labels_url":"https://api.github.com/repos/Khan/Prototope/issues/57/labels{/name}","comments_url":"https://api.github.com/repos/Khan/Prototope/issues/57/comments","events_url":"https://api.github.com/repos/Khan/Prototope/issues/57/events","html_url":"https://github.com/Khan/Prototope/pull/57","id":61767488,"number":57,"title":"[WIP] Image pixel data access","user":{"login":"saniul","id":371773,"avatar_url":"https://avatars.githubusercontent.com/u/371773?v=3","gravatar_id":"","url":"https://api.github.com/users/saniul","html_url":"https://github.com/saniul","followers_url":"https://api.github.com/users/saniul/followers","following_url":"https://api.github.com/users/saniul/following{/other_user}","gists_url":"https://api.github.com/users/saniul/gists{/gist_id}","starred_url":"https://api.github.com/users/saniul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saniul/subscriptions","organizations_url":"https://api.github.com/users/saniul/orgs","repos_url":"https://api.github.com/users/saniul/repos","events_url":"https://api.github.com/users/saniul/events{/privacy}","received_events_url":"https://api.github.com/users/saniul/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-03-15T07:31:47Z","updated_at":"2015-03-25T15:41:12Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Khan/Prototope/pulls/57","html_url":"https://github.com/Khan/Prototope/pull/57","diff_url":"https://github.com/Khan/Prototope/pull/57.diff","patch_url":"https://github.com/Khan/Prototope/pull/57.patch"},"body":"- [x] Swift API (Feedback wanted)\r\n- [x] JS Bridge\r\n- [x] Documentation\r\n\r\nIt’s a bit awkward that `Pixel`s store color info in Int8 [0, 255] instead of Double [0.0, 1.0], but I provided a `.color` getter and setter, which could be enough... Thoughts?\r\n\r\n`PixelBitmap` has a `transform` method, which constructs a new `PixelBitmap` by applying the transformation on the original. The additional convenience overloads of `transform` provide information about the index (0..<width*height), or the row/column of the pixel. What do you think? Should this be simpler?"},"comment":{"url":"https://api.github.com/repos/Khan/Prototope/issues/comments/86086860","html_url":"https://github.com/Khan/Prototope/pull/57#issuecomment-86086860","issue_url":"https://api.github.com/repos/Khan/Prototope/issues/57","id":86086860,"user":{"login":"andymatuschak","id":2771,"avatar_url":"https://avatars.githubusercontent.com/u/2771?v=3","gravatar_id":"","url":"https://api.github.com/users/andymatuschak","html_url":"https://github.com/andymatuschak","followers_url":"https://api.github.com/users/andymatuschak/followers","following_url":"https://api.github.com/users/andymatuschak/following{/other_user}","gists_url":"https://api.github.com/users/andymatuschak/gists{/gist_id}","starred_url":"https://api.github.com/users/andymatuschak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andymatuschak/subscriptions","organizations_url":"https://api.github.com/users/andymatuschak/orgs","repos_url":"https://api.github.com/users/andymatuschak/repos","events_url":"https://api.github.com/users/andymatuschak/events{/privacy}","received_events_url":"https://api.github.com/users/andymatuschak/received_events","type":"User","site_admin":false},"created_at":"2015-03-25T15:41:12Z","updated_at":"2015-03-25T15:41:12Z","body":"I'm not super surprised, but that's a bummer. Two ideas, depending on exactly what's slow here:\r\n\r\n1. In the likely event that it's bridging millions of different `Pixel` objects that's slow, you could try making these functions consume `function(x, y, r, g, b)` instead.\r\n\r\n2. In the also-likely event that millions of  context switches is also intractable, you could instead expose an API to access a JavaScript array of rgb data (a bit like Processing's [pixels[]](https://processing.org/reference/pixels.html))"}}