{"action":"created","comment":{"url":"https://api.github.com/repos/xorserer/Playground/pulls/comments/47776724","id":47776724,"diff_hunk":"@@ -0,0 +1,91 @@\n+//\n+//  Copyright (c) 2015 Lightricks. All rights reserved.\n+//  Created by Ophir on 9/25/15.\n+//\n+\n+#import \"TMProcessTextureToFrameBuffer.h\"\n+\n+#import \"TMScreenGeometry.h\"\n+#import \"TMProgram.h\"\n+\n+@interface TMProcessTextureToFrameBuffer()\n+\n+/// The program handler:\n+@property (strong, nonatomic) TMProgram *program;\n+\n+/// Shader pixel coordinantes handler.\n+@property (nonatomic) GLuint positionSlot;\n+\n+/// Shader texture coordinantes handler.\n+@property (nonatomic) GLuint texCoordSlot;\n+\n+/// Shader texture handler.\n+@property (nonatomic) GLuint textureUniform;\n+\n+/// Shader matrix model handler.\n+@property (nonatomic) GLuint modelView;\n+\n+/// Stores the initial texture.\n+@property (strong, nonatomic) TMTexture *initialImageTexture;\n+\n+/// First \\c draw call, used to store the initial texture.\n+@property (nonatomic) BOOL firstDraw;\n+\n+/// The \\c TMFrameBuffer to draw to.\n+@property (strong, nonatomic) TMFrameBuffer *frameBuffer;\n+\n+/// Geometry for the shader elements.\n+@property (strong, nonatomic)TMScreenGeometry *geometry;\n+\n+@end\n+\n+@implementation TMProcessTextureToFrameBuffer\n+\n+- (instancetype) initWithProgram:(TMProgram *)program frameBuffer:(TMFrameBuffer *)frameBuffer{\n+    if (self = [super init]) {\n+      _program = program;\n+      _geometry = [[TMScreenGeometry alloc] init];\n+      self.frameBuffer = frameBuffer;\n+    }\n+    return self;\n+}\n+\n+- (void)draw:(TMTexture *)texture {\n+  [self bindProgram];\n+  [self bindTexture:texture];\n+  glClearColor(1.0, 1.0, 1.0, 1.0);\n+  glClear(GL_COLOR_BUFFER_BIT);\n+  glDrawElements(GL_TRIANGLES, [self.geometry numberOfVertices],\n+                 GL_UNSIGNED_BYTE, 0);\n+}\n+\n+- (void)bindProgram {","path":"ToneMappingGL/ToneMappingGL/TMProcessTextureToFrameBuffer.m","position":62,"original_position":62,"commit_id":"0df7cf4aad812421b55f63f6faba7b2fd9ccee2c","original_commit_id":"0df7cf4aad812421b55f63f6faba7b2fd9ccee2c","user":{"login":"xorserer","id":5460245,"avatar_url":"https://avatars.githubusercontent.com/u/5460245?v=3","gravatar_id":"","url":"https://api.github.com/users/xorserer","html_url":"https://github.com/xorserer","followers_url":"https://api.github.com/users/xorserer/followers","following_url":"https://api.github.com/users/xorserer/following{/other_user}","gists_url":"https://api.github.com/users/xorserer/gists{/gist_id}","starred_url":"https://api.github.com/users/xorserer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xorserer/subscriptions","organizations_url":"https://api.github.com/users/xorserer/orgs","repos_url":"https://api.github.com/users/xorserer/repos","events_url":"https://api.github.com/users/xorserer/events{/privacy}","received_events_url":"https://api.github.com/users/xorserer/received_events","type":"User","site_admin":false},"body":"This method (and the next) are duplications from the previous processor, no? Why not add them to `TMProgram` and `TMTexture` instead?","created_at":"2015-12-16T13:47:24Z","updated_at":"2015-12-16T13:47:24Z","html_url":"https://github.com/xorserer/Playground/pull/8#discussion_r47776724","pull_request_url":"https://api.github.com/repos/xorserer/Playground/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/xorserer/Playground/pulls/comments/47776724"},"html":{"href":"https://github.com/xorserer/Playground/pull/8#discussion_r47776724"},"pull_request":{"href":"https://api.github.com/repos/xorserer/Playground/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/xorserer/Playground/pulls/8","id":51641197,"html_url":"https://github.com/xorserer/Playground/pull/8","diff_url":"https://github.com/xorserer/Playground/pull/8.diff","patch_url":"https://github.com/xorserer/Playground/pull/8.patch","issue_url":"https://api.github.com/repos/xorserer/Playground/issues/8","number":8,"state":"open","locked":false,"title":"tone-mapper","user":{"login":"ophir88","id":6900539,"avatar_url":"https://avatars.githubusercontent.com/u/6900539?v=3","gravatar_id":"","url":"https://api.github.com/users/ophir88","html_url":"https://github.com/ophir88","followers_url":"https://api.github.com/users/ophir88/followers","following_url":"https://api.github.com/users/ophir88/following{/other_user}","gists_url":"https://api.github.com/users/ophir88/gists{/gist_id}","starred_url":"https://api.github.com/users/ophir88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ophir88/subscriptions","organizations_url":"https://api.github.com/users/ophir88/orgs","repos_url":"https://api.github.com/users/ophir88/repos","events_url":"https://api.github.com/users/ophir88/events{/privacy}","received_events_url":"https://api.github.com/users/ophir88/received_events","type":"User","site_admin":false},"body":"ready for round 1","created_at":"2015-11-24T10:29:20Z","updated_at":"2015-12-16T13:47:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1fa8a9fa49d64eb0d122fd65881984d282394694","assignee":{"login":"xorserer","id":5460245,"avatar_url":"https://avatars.githubusercontent.com/u/5460245?v=3","gravatar_id":"","url":"https://api.github.com/users/xorserer","html_url":"https://github.com/xorserer","followers_url":"https://api.github.com/users/xorserer/followers","following_url":"https://api.github.com/users/xorserer/following{/other_user}","gists_url":"https://api.github.com/users/xorserer/gists{/gist_id}","starred_url":"https://api.github.com/users/xorserer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xorserer/subscriptions","organizations_url":"https://api.github.com/users/xorserer/orgs","repos_url":"https://api.github.com/users/xorserer/repos","events_url":"https://api.github.com/users/xorserer/events{/privacy}","received_events_url":"https://api.github.com/users/xorserer/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/xorserer/Playground/pulls/8/commits","review_comments_url":"https://api.github.com/repos/xorserer/Playground/pulls/8/comments","review_comment_url":"https://api.github.com/repos/xorserer/Playground/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xorserer/Playground/issues/8/comments","statuses_url":"https://api.github.com/repos/xorserer/Playground/statuses/0df7cf4aad812421b55f63f6faba7b2fd9ccee2c","head":{"label":"ophir88:PR1","ref":"PR1","sha":"0df7cf4aad812421b55f63f6faba7b2fd9ccee2c","user":{"login":"ophir88","id":6900539,"avatar_url":"https://avatars.githubusercontent.com/u/6900539?v=3","gravatar_id":"","url":"https://api.github.com/users/ophir88","html_url":"https://github.com/ophir88","followers_url":"https://api.github.com/users/ophir88/followers","following_url":"https://api.github.com/users/ophir88/following{/other_user}","gists_url":"https://api.github.com/users/ophir88/gists{/gist_id}","starred_url":"https://api.github.com/users/ophir88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ophir88/subscriptions","organizations_url":"https://api.github.com/users/ophir88/orgs","repos_url":"https://api.github.com/users/ophir88/repos","events_url":"https://api.github.com/users/ophir88/events{/privacy}","received_events_url":"https://api.github.com/users/ophir88/received_events","type":"User","site_admin":false},"repo":{"id":44055734,"name":"Playground","full_name":"ophir88/Playground","owner":{"login":"ophir88","id":6900539,"avatar_url":"https://avatars.githubusercontent.com/u/6900539?v=3","gravatar_id":"","url":"https://api.github.com/users/ophir88","html_url":"https://github.com/ophir88","followers_url":"https://api.github.com/users/ophir88/followers","following_url":"https://api.github.com/users/ophir88/following{/other_user}","gists_url":"https://api.github.com/users/ophir88/gists{/gist_id}","starred_url":"https://api.github.com/users/ophir88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ophir88/subscriptions","organizations_url":"https://api.github.com/users/ophir88/orgs","repos_url":"https://api.github.com/users/ophir88/repos","events_url":"https://api.github.com/users/ophir88/events{/privacy}","received_events_url":"https://api.github.com/users/ophir88/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ophir88/Playground","description":"Repository for learning about GitHub & testing new stuff","fork":true,"url":"https://api.github.com/repos/ophir88/Playground","forks_url":"https://api.github.com/repos/ophir88/Playground/forks","keys_url":"https://api.github.com/repos/ophir88/Playground/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ophir88/Playground/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ophir88/Playground/teams","hooks_url":"https://api.github.com/repos/ophir88/Playground/hooks","issue_events_url":"https://api.github.com/repos/ophir88/Playground/issues/events{/number}","events_url":"https://api.github.com/repos/ophir88/Playground/events","assignees_url":"https://api.github.com/repos/ophir88/Playground/assignees{/user}","branches_url":"https://api.github.com/repos/ophir88/Playground/branches{/branch}","tags_url":"https://api.github.com/repos/ophir88/Playground/tags","blobs_url":"https://api.github.com/repos/ophir88/Playground/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ophir88/Playground/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ophir88/Playground/git/refs{/sha}","trees_url":"https://api.github.com/repos/ophir88/Playground/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ophir88/Playground/statuses/{sha}","languages_url":"https://api.github.com/repos/ophir88/Playground/languages","stargazers_url":"https://api.github.com/repos/ophir88/Playground/stargazers","contributors_url":"https://api.github.com/repos/ophir88/Playground/contributors","subscribers_url":"https://api.github.com/repos/ophir88/Playground/subscribers","subscription_url":"https://api.github.com/repos/ophir88/Playground/subscription","commits_url":"https://api.github.com/repos/ophir88/Playground/commits{/sha}","git_commits_url":"https://api.github.com/repos/ophir88/Playground/git/commits{/sha}","comments_url":"https://api.github.com/repos/ophir88/Playground/comments{/number}","issue_comment_url":"https://api.github.com/repos/ophir88/Playground/issues/comments{/number}","contents_url":"https://api.github.com/repos/ophir88/Playground/contents/{+path}","compare_url":"https://api.github.com/repos/ophir88/Playground/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ophir88/Playground/merges","archive_url":"https://api.github.com/repos/ophir88/Playground/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ophir88/Playground/downloads","issues_url":"https://api.github.com/repos/ophir88/Playground/issues{/number}","pulls_url":"https://api.github.com/repos/ophir88/Playground/pulls{/number}","milestones_url":"https://api.github.com/repos/ophir88/Playground/milestones{/number}","notifications_url":"https://api.github.com/repos/ophir88/Playground/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ophir88/Playground/labels{/name}","releases_url":"https://api.github.com/repos/ophir88/Playground/releases{/id}","created_at":"2015-10-11T14:39:48Z","updated_at":"2015-10-11T14:39:50Z","pushed_at":"2015-12-16T09:04:57Z","git_url":"git://github.com/ophir88/Playground.git","ssh_url":"git@github.com:ophir88/Playground.git","clone_url":"https://github.com/ophir88/Playground.git","svn_url":"https://github.com/ophir88/Playground","homepage":null,"size":262,"stargazers_count":0,"watchers_count":0,"language":"Objective-C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"xorserer:develop","ref":"develop","sha":"fcc51fa6dc8b6feceb41e1d0a5238c8878a69726","user":{"login":"xorserer","id":5460245,"avatar_url":"https://avatars.githubusercontent.com/u/5460245?v=3","gravatar_id":"","url":"https://api.github.com/users/xorserer","html_url":"https://github.com/xorserer","followers_url":"https://api.github.com/users/xorserer/followers","following_url":"https://api.github.com/users/xorserer/following{/other_user}","gists_url":"https://api.github.com/users/xorserer/gists{/gist_id}","starred_url":"https://api.github.com/users/xorserer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xorserer/subscriptions","organizations_url":"https://api.github.com/users/xorserer/orgs","repos_url":"https://api.github.com/users/xorserer/repos","events_url":"https://api.github.com/users/xorserer/events{/privacy}","received_events_url":"https://api.github.com/users/xorserer/received_events","type":"User","site_admin":false},"repo":{"id":33937810,"name":"Playground","full_name":"xorserer/Playground","owner":{"login":"xorserer","id":5460245,"avatar_url":"https://avatars.githubusercontent.com/u/5460245?v=3","gravatar_id":"","url":"https://api.github.com/users/xorserer","html_url":"https://github.com/xorserer","followers_url":"https://api.github.com/users/xorserer/followers","following_url":"https://api.github.com/users/xorserer/following{/other_user}","gists_url":"https://api.github.com/users/xorserer/gists{/gist_id}","starred_url":"https://api.github.com/users/xorserer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xorserer/subscriptions","organizations_url":"https://api.github.com/users/xorserer/orgs","repos_url":"https://api.github.com/users/xorserer/repos","events_url":"https://api.github.com/users/xorserer/events{/privacy}","received_events_url":"https://api.github.com/users/xorserer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xorserer/Playground","description":"Repository for learning about GitHub & testing new stuff","fork":false,"url":"https://api.github.com/repos/xorserer/Playground","forks_url":"https://api.github.com/repos/xorserer/Playground/forks","keys_url":"https://api.github.com/repos/xorserer/Playground/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xorserer/Playground/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xorserer/Playground/teams","hooks_url":"https://api.github.com/repos/xorserer/Playground/hooks","issue_events_url":"https://api.github.com/repos/xorserer/Playground/issues/events{/number}","events_url":"https://api.github.com/repos/xorserer/Playground/events","assignees_url":"https://api.github.com/repos/xorserer/Playground/assignees{/user}","branches_url":"https://api.github.com/repos/xorserer/Playground/branches{/branch}","tags_url":"https://api.github.com/repos/xorserer/Playground/tags","blobs_url":"https://api.github.com/repos/xorserer/Playground/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xorserer/Playground/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xorserer/Playground/git/refs{/sha}","trees_url":"https://api.github.com/repos/xorserer/Playground/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xorserer/Playground/statuses/{sha}","languages_url":"https://api.github.com/repos/xorserer/Playground/languages","stargazers_url":"https://api.github.com/repos/xorserer/Playground/stargazers","contributors_url":"https://api.github.com/repos/xorserer/Playground/contributors","subscribers_url":"https://api.github.com/repos/xorserer/Playground/subscribers","subscription_url":"https://api.github.com/repos/xorserer/Playground/subscription","commits_url":"https://api.github.com/repos/xorserer/Playground/commits{/sha}","git_commits_url":"https://api.github.com/repos/xorserer/Playground/git/commits{/sha}","comments_url":"https://api.github.com/repos/xorserer/Playground/comments{/number}","issue_comment_url":"https://api.github.com/repos/xorserer/Playground/issues/comments{/number}","contents_url":"https://api.github.com/repos/xorserer/Playground/contents/{+path}","compare_url":"https://api.github.com/repos/xorserer/Playground/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xorserer/Playground/merges","archive_url":"https://api.github.com/repos/xorserer/Playground/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xorserer/Playground/downloads","issues_url":"https://api.github.com/repos/xorserer/Playground/issues{/number}","pulls_url":"https://api.github.com/repos/xorserer/Playground/pulls{/number}","milestones_url":"https://api.github.com/repos/xorserer/Playground/milestones{/number}","notifications_url":"https://api.github.com/repos/xorserer/Playground/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xorserer/Playground/labels{/name}","releases_url":"https://api.github.com/repos/xorserer/Playground/releases{/id}","created_at":"2015-04-14T14:47:53Z","updated_at":"2015-12-02T09:14:31Z","pushed_at":"2015-12-16T09:04:58Z","git_url":"git://github.com/xorserer/Playground.git","ssh_url":"git@github.com:xorserer/Playground.git","clone_url":"https://github.com/xorserer/Playground.git","svn_url":"https://github.com/xorserer/Playground","homepage":null,"size":253,"stargazers_count":0,"watchers_count":0,"language":"Objective-C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/xorserer/Playground/pulls/8"},"html":{"href":"https://github.com/xorserer/Playground/pull/8"},"issue":{"href":"https://api.github.com/repos/xorserer/Playground/issues/8"},"comments":{"href":"https://api.github.com/repos/xorserer/Playground/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/xorserer/Playground/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/xorserer/Playground/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xorserer/Playground/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/xorserer/Playground/statuses/0df7cf4aad812421b55f63f6faba7b2fd9ccee2c"}}}}