{"action":"closed","number":1972,"pull_request":{"url":"https://api.github.com/repos/psychopy/psychopy/pulls/1972","id":209994912,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5OTk0OTEy","html_url":"https://github.com/psychopy/psychopy/pull/1972","diff_url":"https://github.com/psychopy/psychopy/pull/1972.diff","patch_url":"https://github.com/psychopy/psychopy/pull/1972.patch","issue_url":"https://api.github.com/repos/psychopy/psychopy/issues/1972","number":1972,"state":"closed","locked":false,"title":"BF: gamma table issues","user":{"login":"djmannion","id":1371039,"node_id":"MDQ6VXNlcjEzNzEwMzk=","avatar_url":"https://avatars0.githubusercontent.com/u/1371039?v=4","gravatar_id":"","url":"https://api.github.com/users/djmannion","html_url":"https://github.com/djmannion","followers_url":"https://api.github.com/users/djmannion/followers","following_url":"https://api.github.com/users/djmannion/following{/other_user}","gists_url":"https://api.github.com/users/djmannion/gists{/gist_id}","starred_url":"https://api.github.com/users/djmannion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djmannion/subscriptions","organizations_url":"https://api.github.com/users/djmannion/orgs","repos_url":"https://api.github.com/users/djmannion/repos","events_url":"https://api.github.com/users/djmannion/events{/privacy}","received_events_url":"https://api.github.com/users/djmannion/received_events","type":"User","site_admin":false},"body":"This relates to issue #1859.\r\n\r\nThe first problem was that, on windows, the gamma table that was read was not the same as the gamma table that was set. The set operation used a ```byteswap```, whereas the get operation did not.\r\n\r\nTo expand:\r\n\r\n* It seems like windows takes a 16 bit unsigned integer for each entry in the LUT. The first 8 bits are taken as the LUT index and the second 8 bits are ignored/undefined.\r\n* The ```byteswap``` function swaps the first and last bytes, so one can make a LUT between 0 and 255 and then use ```byteswap``` to move that into the first byte rather than the second.\r\n* When reading the LUT, the first 8 bits will where the LUT is defined. That means that we can do a ```byteswap``` to shift them into the second 8 bits and then normalise by dividing by 255. This should remove the get/set discrepancy.\r\n\r\nThe second problem was that a linear gamma table, defined between 0 and 1, was not producing evenly spaced integers with an 8-bit LUT between 0 and 255. The problem seems to be that the integer conversion was truncating, so a rounding operation was added prior to type conversion.\r\n\r\n\r\n\r\n","created_at":"2018-08-22T01:02:21Z","updated_at":"2018-08-22T12:02:24Z","closed_at":"2018-08-22T12:02:24Z","merged_at":"2018-08-22T12:02:24Z","merge_commit_sha":"34a7bc0a76172915cc9a39a926a01c04a934cb76","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/psychopy/psychopy/pulls/1972/commits","review_comments_url":"https://api.github.com/repos/psychopy/psychopy/pulls/1972/comments","review_comment_url":"https://api.github.com/repos/psychopy/psychopy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/psychopy/psychopy/issues/1972/comments","statuses_url":"https://api.github.com/repos/psychopy/psychopy/statuses/0a40b8010d985e98b1099d1cf3d7d60b4d676aa2","head":{"label":"djmannion:gamma_newfix","ref":"gamma_newfix","sha":"0a40b8010d985e98b1099d1cf3d7d60b4d676aa2","user":{"login":"djmannion","id":1371039,"node_id":"MDQ6VXNlcjEzNzEwMzk=","avatar_url":"https://avatars0.githubusercontent.com/u/1371039?v=4","gravatar_id":"","url":"https://api.github.com/users/djmannion","html_url":"https://github.com/djmannion","followers_url":"https://api.github.com/users/djmannion/followers","following_url":"https://api.github.com/users/djmannion/following{/other_user}","gists_url":"https://api.github.com/users/djmannion/gists{/gist_id}","starred_url":"https://api.github.com/users/djmannion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djmannion/subscriptions","organizations_url":"https://api.github.com/users/djmannion/orgs","repos_url":"https://api.github.com/users/djmannion/repos","events_url":"https://api.github.com/users/djmannion/events{/privacy}","received_events_url":"https://api.github.com/users/djmannion/received_events","type":"User","site_admin":false},"repo":{"id":3247291,"node_id":"MDEwOlJlcG9zaXRvcnkzMjQ3Mjkx","name":"psychopy","full_name":"djmannion/psychopy","owner":{"login":"djmannion","id":1371039,"node_id":"MDQ6VXNlcjEzNzEwMzk=","avatar_url":"https://avatars0.githubusercontent.com/u/1371039?v=4","gravatar_id":"","url":"https://api.github.com/users/djmannion","html_url":"https://github.com/djmannion","followers_url":"https://api.github.com/users/djmannion/followers","following_url":"https://api.github.com/users/djmannion/following{/other_user}","gists_url":"https://api.github.com/users/djmannion/gists{/gist_id}","starred_url":"https://api.github.com/users/djmannion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djmannion/subscriptions","organizations_url":"https://api.github.com/users/djmannion/orgs","repos_url":"https://api.github.com/users/djmannion/repos","events_url":"https://api.github.com/users/djmannion/events{/privacy}","received_events_url":"https://api.github.com/users/djmannion/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/djmannion/psychopy","description":"Main repository of PsychoPy","fork":true,"url":"https://api.github.com/repos/djmannion/psychopy","forks_url":"https://api.github.com/repos/djmannion/psychopy/forks","keys_url":"https://api.github.com/repos/djmannion/psychopy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/djmannion/psychopy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/djmannion/psychopy/teams","hooks_url":"https://api.github.com/repos/djmannion/psychopy/hooks","issue_events_url":"https://api.github.com/repos/djmannion/psychopy/issues/events{/number}","events_url":"https://api.github.com/repos/djmannion/psychopy/events","assignees_url":"https://api.github.com/repos/djmannion/psychopy/assignees{/user}","branches_url":"https://api.github.com/repos/djmannion/psychopy/branches{/branch}","tags_url":"https://api.github.com/repos/djmannion/psychopy/tags","blobs_url":"https://api.github.com/repos/djmannion/psychopy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/djmannion/psychopy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/djmannion/psychopy/git/refs{/sha}","trees_url":"https://api.github.com/repos/djmannion/psychopy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/djmannion/psychopy/statuses/{sha}","languages_url":"https://api.github.com/repos/djmannion/psychopy/languages","stargazers_url":"https://api.github.com/repos/djmannion/psychopy/stargazers","contributors_url":"https://api.github.com/repos/djmannion/psychopy/contributors","subscribers_url":"https://api.github.com/repos/djmannion/psychopy/subscribers","subscription_url":"https://api.github.com/repos/djmannion/psychopy/subscription","commits_url":"https://api.github.com/repos/djmannion/psychopy/commits{/sha}","git_commits_url":"https://api.github.com/repos/djmannion/psychopy/git/commits{/sha}","comments_url":"https://api.github.com/repos/djmannion/psychopy/comments{/number}","issue_comment_url":"https://api.github.com/repos/djmannion/psychopy/issues/comments{/number}","contents_url":"https://api.github.com/repos/djmannion/psychopy/contents/{+path}","compare_url":"https://api.github.com/repos/djmannion/psychopy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/djmannion/psychopy/merges","archive_url":"https://api.github.com/repos/djmannion/psychopy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/djmannion/psychopy/downloads","issues_url":"https://api.github.com/repos/djmannion/psychopy/issues{/number}","pulls_url":"https://api.github.com/repos/djmannion/psychopy/pulls{/number}","milestones_url":"https://api.github.com/repos/djmannion/psychopy/milestones{/number}","notifications_url":"https://api.github.com/repos/djmannion/psychopy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/djmannion/psychopy/labels{/name}","releases_url":"https://api.github.com/repos/djmannion/psychopy/releases{/id}","deployments_url":"https://api.github.com/repos/djmannion/psychopy/deployments","created_at":"2012-01-23T14:36:22Z","updated_at":"2016-03-16T21:47:08Z","pushed_at":"2018-08-22T00:45:50Z","git_url":"git://github.com/djmannion/psychopy.git","ssh_url":"git@github.com:djmannion/psychopy.git","clone_url":"https://github.com/djmannion/psychopy.git","svn_url":"https://github.com/djmannion/psychopy","homepage":"http://www.psychopy.org","size":77499,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"psychopy:master","ref":"master","sha":"98750f3e3fd0cafb072e77e95905eebd67981a03","user":{"login":"psychopy","id":381042,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4MTA0Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/381042?v=4","gravatar_id":"","url":"https://api.github.com/users/psychopy","html_url":"https://github.com/psychopy","followers_url":"https://api.github.com/users/psychopy/followers","following_url":"https://api.github.com/users/psychopy/following{/other_user}","gists_url":"https://api.github.com/users/psychopy/gists{/gist_id}","starred_url":"https://api.github.com/users/psychopy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psychopy/subscriptions","organizations_url":"https://api.github.com/users/psychopy/orgs","repos_url":"https://api.github.com/users/psychopy/repos","events_url":"https://api.github.com/users/psychopy/events{/privacy}","received_events_url":"https://api.github.com/users/psychopy/received_events","type":"Organization","site_admin":false},"repo":{"id":879116,"node_id":"MDEwOlJlcG9zaXRvcnk4NzkxMTY=","name":"psychopy","full_name":"psychopy/psychopy","owner":{"login":"psychopy","id":381042,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4MTA0Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/381042?v=4","gravatar_id":"","url":"https://api.github.com/users/psychopy","html_url":"https://github.com/psychopy","followers_url":"https://api.github.com/users/psychopy/followers","following_url":"https://api.github.com/users/psychopy/following{/other_user}","gists_url":"https://api.github.com/users/psychopy/gists{/gist_id}","starred_url":"https://api.github.com/users/psychopy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psychopy/subscriptions","organizations_url":"https://api.github.com/users/psychopy/orgs","repos_url":"https://api.github.com/users/psychopy/repos","events_url":"https://api.github.com/users/psychopy/events{/privacy}","received_events_url":"https://api.github.com/users/psychopy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/psychopy/psychopy","description":"For running psychology and neuroscience experiments","fork":false,"url":"https://api.github.com/repos/psychopy/psychopy","forks_url":"https://api.github.com/repos/psychopy/psychopy/forks","keys_url":"https://api.github.com/repos/psychopy/psychopy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/psychopy/psychopy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/psychopy/psychopy/teams","hooks_url":"https://api.github.com/repos/psychopy/psychopy/hooks","issue_events_url":"https://api.github.com/repos/psychopy/psychopy/issues/events{/number}","events_url":"https://api.github.com/repos/psychopy/psychopy/events","assignees_url":"https://api.github.com/repos/psychopy/psychopy/assignees{/user}","branches_url":"https://api.github.com/repos/psychopy/psychopy/branches{/branch}","tags_url":"https://api.github.com/repos/psychopy/psychopy/tags","blobs_url":"https://api.github.com/repos/psychopy/psychopy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/psychopy/psychopy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/psychopy/psychopy/git/refs{/sha}","trees_url":"https://api.github.com/repos/psychopy/psychopy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/psychopy/psychopy/statuses/{sha}","languages_url":"https://api.github.com/repos/psychopy/psychopy/languages","stargazers_url":"https://api.github.com/repos/psychopy/psychopy/stargazers","contributors_url":"https://api.github.com/repos/psychopy/psychopy/contributors","subscribers_url":"https://api.github.com/repos/psychopy/psychopy/subscribers","subscription_url":"https://api.github.com/repos/psychopy/psychopy/subscription","commits_url":"https://api.github.com/repos/psychopy/psychopy/commits{/sha}","git_commits_url":"https://api.github.com/repos/psychopy/psychopy/git/commits{/sha}","comments_url":"https://api.github.com/repos/psychopy/psychopy/comments{/number}","issue_comment_url":"https://api.github.com/repos/psychopy/psychopy/issues/comments{/number}","contents_url":"https://api.github.com/repos/psychopy/psychopy/contents/{+path}","compare_url":"https://api.github.com/repos/psychopy/psychopy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/psychopy/psychopy/merges","archive_url":"https://api.github.com/repos/psychopy/psychopy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/psychopy/psychopy/downloads","issues_url":"https://api.github.com/repos/psychopy/psychopy/issues{/number}","pulls_url":"https://api.github.com/repos/psychopy/psychopy/pulls{/number}","milestones_url":"https://api.github.com/repos/psychopy/psychopy/milestones{/number}","notifications_url":"https://api.github.com/repos/psychopy/psychopy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/psychopy/psychopy/labels{/name}","releases_url":"https://api.github.com/repos/psychopy/psychopy/releases{/id}","deployments_url":"https://api.github.com/repos/psychopy/psychopy/deployments","created_at":"2010-09-01T17:00:04Z","updated_at":"2018-08-22T12:01:49Z","pushed_at":"2018-08-22T12:02:24Z","git_url":"git://github.com/psychopy/psychopy.git","ssh_url":"git@github.com:psychopy/psychopy.git","clone_url":"https://github.com/psychopy/psychopy.git","svn_url":"https://github.com/psychopy/psychopy","homepage":"http://www.psychopy.org","size":79349,"stargazers_count":516,"watchers_count":516,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":377,"mirror_url":null,"archived":false,"open_issues_count":170,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":377,"open_issues":170,"watchers":516,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/psychopy/psychopy/pulls/1972"},"html":{"href":"https://github.com/psychopy/psychopy/pull/1972"},"issue":{"href":"https://api.github.com/repos/psychopy/psychopy/issues/1972"},"comments":{"href":"https://api.github.com/repos/psychopy/psychopy/issues/1972/comments"},"review_comments":{"href":"https://api.github.com/repos/psychopy/psychopy/pulls/1972/comments"},"review_comment":{"href":"https://api.github.com/repos/psychopy/psychopy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/psychopy/psychopy/pulls/1972/commits"},"statuses":{"href":"https://api.github.com/repos/psychopy/psychopy/statuses/0a40b8010d985e98b1099d1cf3d7d60b4d676aa2"}},"author_association":"CONTRIBUTOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"peircej","id":380582,"node_id":"MDQ6VXNlcjM4MDU4Mg==","avatar_url":"https://avatars2.githubusercontent.com/u/380582?v=4","gravatar_id":"","url":"https://api.github.com/users/peircej","html_url":"https://github.com/peircej","followers_url":"https://api.github.com/users/peircej/followers","following_url":"https://api.github.com/users/peircej/following{/other_user}","gists_url":"https://api.github.com/users/peircej/gists{/gist_id}","starred_url":"https://api.github.com/users/peircej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peircej/subscriptions","organizations_url":"https://api.github.com/users/peircej/orgs","repos_url":"https://api.github.com/users/peircej/repos","events_url":"https://api.github.com/users/peircej/events{/privacy}","received_events_url":"https://api.github.com/users/peircej/received_events","type":"User","site_admin":false},"comments":3,"review_comments":0,"maintainer_can_modify":false,"commits":3,"additions":31,"deletions":3,"changed_files":2}}
{"actor":{"display_login":"peircej"}}