{"action":"created","comment":{"url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/pulls/comments/50023053","id":50023053,"diff_hunk":"@@ -1,6 +1,6 @@\n %\\chapter{使用技術}\n \\section{カメラ}\n-カメラ機能の実装の方法として``AVFoundation Framework\"を使うか``UIImagePickerController\"を使うか2パターンあった。最初に、``AVFoundation Framework\"というSwiftのFrameworkを使用して実装しようとした。このFrameworkは開発者がカメラの画素数やピントの調整のやり方などを全てマニュアルで制御しなくてはならなかった。とくにピントの調整においては、撮影の対象物とiPhoneのカメラの距離から自分で計算式を考えてピントが合うようにしなければならずうまく実装することができなかった。次に``AVFoundation Framework\"を使わず``UIImagePickerController\"というクラスを用いて実装した。このクラスを用いるとピントの調整や明るさの調整はアプリ側がオートで処理をしてくれるため簡単にカメラで写真をとる機能を実装することができた。そして、撮影した写真はUIImageとして保存されデータベースに書き込むことができる型ではなかったため、UIImageデータをNSDataに変換してアプリ内のデータベースに保存することにした。これにより、他のクラスで撮った画像を使用する場合もアクセスが可能になった。以下にそれぞれ核となるコードをピックアップして記述した。\n+カメラ機能の実装の方法として``AVFoundation Framework\"を使うか``UIImagePickerController\"を使うか2パターンあった。最初に、``AVFoundation Framework\"というSwiftのFrameworkを使用して実装しようとした。このFrameworkは開発者がカメラの画素数やピントの調整方法などを全て手動で制御しなくてはならなかった。特にピントの調整においては、撮影の対象物とiPhoneのカメラの距離から自分で計算式を考えてピントが合うようにしなければならないので実装することができなかった。次に``AVFoundation Framework\"を使わず``UIImagePickerController\"というクラスを用いて実装した。このクラスを用いるとピントの調整や明るさの調整はアプリ側が自動で処理をしてくれるため簡単にカメラで写真をとる機能を実装することができた。そして、撮影した写真はデータベースに書き込むことのできないUIImageであったため、UIImageデータをNSDataに変換してアプリ内のデータベースに保存することにした。これにより、撮影した写真を他のクラスから参照できるようになった。以下にそれぞれ核となるコードをピックアップして記述した。","path":"tech_camera.tex","position":4,"original_position":4,"commit_id":"da10e4d4a63a47d3e296b4f4ac557b8ca46b72c6","original_commit_id":"da10e4d4a63a47d3e296b4f4ac557b8ca46b72c6","user":{"login":"kentaiwami","id":12196135,"avatar_url":"https://avatars.githubusercontent.com/u/12196135?v=3","gravatar_id":"","url":"https://api.github.com/users/kentaiwami","html_url":"https://github.com/kentaiwami","followers_url":"https://api.github.com/users/kentaiwami/followers","following_url":"https://api.github.com/users/kentaiwami/following{/other_user}","gists_url":"https://api.github.com/users/kentaiwami/gists{/gist_id}","starred_url":"https://api.github.com/users/kentaiwami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kentaiwami/subscriptions","organizations_url":"https://api.github.com/users/kentaiwami/orgs","repos_url":"https://api.github.com/users/kentaiwami/repos","events_url":"https://api.github.com/users/kentaiwami/events{/privacy}","received_events_url":"https://api.github.com/users/kentaiwami/received_events","type":"User","site_admin":false},"body":"> ピントの調整や明るさの調整\r\nコメントがあったと思う。「ピントや明るさの調整」修正。\r\n","created_at":"2016-01-18T17:12:00Z","updated_at":"2016-01-18T17:12:00Z","html_url":"https://github.com/FUNPBL2015/Kan__groupreport/pull/58#discussion_r50023053","pull_request_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/pulls/58","_links":{"self":{"href":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/pulls/comments/50023053"},"html":{"href":"https://github.com/FUNPBL2015/Kan__groupreport/pull/58#discussion_r50023053"},"pull_request":{"href":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/pulls/58"}}},"pull_request":{"url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/pulls/58","id":56275106,"html_url":"https://github.com/FUNPBL2015/Kan__groupreport/pull/58","diff_url":"https://github.com/FUNPBL2015/Kan__groupreport/pull/58.diff","patch_url":"https://github.com/FUNPBL2015/Kan__groupreport/pull/58.patch","issue_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/issues/58","number":58,"state":"open","locked":false,"title":"池田分の変更","user":{"login":"ToshikiIkeda","id":12196141,"avatar_url":"https://avatars.githubusercontent.com/u/12196141?v=3","gravatar_id":"","url":"https://api.github.com/users/ToshikiIkeda","html_url":"https://github.com/ToshikiIkeda","followers_url":"https://api.github.com/users/ToshikiIkeda/followers","following_url":"https://api.github.com/users/ToshikiIkeda/following{/other_user}","gists_url":"https://api.github.com/users/ToshikiIkeda/gists{/gist_id}","starred_url":"https://api.github.com/users/ToshikiIkeda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ToshikiIkeda/subscriptions","organizations_url":"https://api.github.com/users/ToshikiIkeda/orgs","repos_url":"https://api.github.com/users/ToshikiIkeda/repos","events_url":"https://api.github.com/users/ToshikiIkeda/events{/privacy}","received_events_url":"https://api.github.com/users/ToshikiIkeda/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-17T10:42:46Z","updated_at":"2016-01-18T17:12:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a0139271767cd1fec80ee9e76c59ff1aa528037f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/pulls/58/commits","review_comments_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/pulls/58/comments","review_comment_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/pulls/comments{/number}","comments_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/issues/58/comments","statuses_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/statuses/da10e4d4a63a47d3e296b4f4ac557b8ca46b72c6","head":{"label":"FUNPBL2015:Toshiki","ref":"Toshiki","sha":"da10e4d4a63a47d3e296b4f4ac557b8ca46b72c6","user":{"login":"FUNPBL2015","id":12196161,"avatar_url":"https://avatars.githubusercontent.com/u/12196161?v=3","gravatar_id":"","url":"https://api.github.com/users/FUNPBL2015","html_url":"https://github.com/FUNPBL2015","followers_url":"https://api.github.com/users/FUNPBL2015/followers","following_url":"https://api.github.com/users/FUNPBL2015/following{/other_user}","gists_url":"https://api.github.com/users/FUNPBL2015/gists{/gist_id}","starred_url":"https://api.github.com/users/FUNPBL2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FUNPBL2015/subscriptions","organizations_url":"https://api.github.com/users/FUNPBL2015/orgs","repos_url":"https://api.github.com/users/FUNPBL2015/repos","events_url":"https://api.github.com/users/FUNPBL2015/events{/privacy}","received_events_url":"https://api.github.com/users/FUNPBL2015/received_events","type":"Organization","site_admin":false},"repo":{"id":48118220,"name":"Kan__groupreport","full_name":"FUNPBL2015/Kan__groupreport","owner":{"login":"FUNPBL2015","id":12196161,"avatar_url":"https://avatars.githubusercontent.com/u/12196161?v=3","gravatar_id":"","url":"https://api.github.com/users/FUNPBL2015","html_url":"https://github.com/FUNPBL2015","followers_url":"https://api.github.com/users/FUNPBL2015/followers","following_url":"https://api.github.com/users/FUNPBL2015/following{/other_user}","gists_url":"https://api.github.com/users/FUNPBL2015/gists{/gist_id}","starred_url":"https://api.github.com/users/FUNPBL2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FUNPBL2015/subscriptions","organizations_url":"https://api.github.com/users/FUNPBL2015/orgs","repos_url":"https://api.github.com/users/FUNPBL2015/repos","events_url":"https://api.github.com/users/FUNPBL2015/events{/privacy}","received_events_url":"https://api.github.com/users/FUNPBL2015/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/FUNPBL2015/Kan__groupreport","description":"","fork":false,"url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport","forks_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/forks","keys_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/teams","hooks_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/hooks","issue_events_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/issues/events{/number}","events_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/events","assignees_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/assignees{/user}","branches_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/branches{/branch}","tags_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/tags","blobs_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/git/refs{/sha}","trees_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/statuses/{sha}","languages_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/languages","stargazers_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/stargazers","contributors_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/contributors","subscribers_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/subscribers","subscription_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/subscription","commits_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/commits{/sha}","git_commits_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/git/commits{/sha}","comments_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/comments{/number}","issue_comment_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/issues/comments{/number}","contents_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/contents/{+path}","compare_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/merges","archive_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/downloads","issues_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/issues{/number}","pulls_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/pulls{/number}","milestones_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/milestones{/number}","notifications_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/labels{/name}","releases_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/releases{/id}","created_at":"2015-12-16T15:23:24Z","updated_at":"2016-01-12T01:34:12Z","pushed_at":"2016-01-18T16:36:27Z","git_url":"git://github.com/FUNPBL2015/Kan__groupreport.git","ssh_url":"git@github.com:FUNPBL2015/Kan__groupreport.git","clone_url":"https://github.com/FUNPBL2015/Kan__groupreport.git","svn_url":"https://github.com/FUNPBL2015/Kan__groupreport","homepage":null,"size":29402,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"FUNPBL2015:master","ref":"master","sha":"bc0cda430ba18561aee1487162ed945aea2af544","user":{"login":"FUNPBL2015","id":12196161,"avatar_url":"https://avatars.githubusercontent.com/u/12196161?v=3","gravatar_id":"","url":"https://api.github.com/users/FUNPBL2015","html_url":"https://github.com/FUNPBL2015","followers_url":"https://api.github.com/users/FUNPBL2015/followers","following_url":"https://api.github.com/users/FUNPBL2015/following{/other_user}","gists_url":"https://api.github.com/users/FUNPBL2015/gists{/gist_id}","starred_url":"https://api.github.com/users/FUNPBL2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FUNPBL2015/subscriptions","organizations_url":"https://api.github.com/users/FUNPBL2015/orgs","repos_url":"https://api.github.com/users/FUNPBL2015/repos","events_url":"https://api.github.com/users/FUNPBL2015/events{/privacy}","received_events_url":"https://api.github.com/users/FUNPBL2015/received_events","type":"Organization","site_admin":false},"repo":{"id":48118220,"name":"Kan__groupreport","full_name":"FUNPBL2015/Kan__groupreport","owner":{"login":"FUNPBL2015","id":12196161,"avatar_url":"https://avatars.githubusercontent.com/u/12196161?v=3","gravatar_id":"","url":"https://api.github.com/users/FUNPBL2015","html_url":"https://github.com/FUNPBL2015","followers_url":"https://api.github.com/users/FUNPBL2015/followers","following_url":"https://api.github.com/users/FUNPBL2015/following{/other_user}","gists_url":"https://api.github.com/users/FUNPBL2015/gists{/gist_id}","starred_url":"https://api.github.com/users/FUNPBL2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FUNPBL2015/subscriptions","organizations_url":"https://api.github.com/users/FUNPBL2015/orgs","repos_url":"https://api.github.com/users/FUNPBL2015/repos","events_url":"https://api.github.com/users/FUNPBL2015/events{/privacy}","received_events_url":"https://api.github.com/users/FUNPBL2015/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/FUNPBL2015/Kan__groupreport","description":"","fork":false,"url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport","forks_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/forks","keys_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/teams","hooks_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/hooks","issue_events_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/issues/events{/number}","events_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/events","assignees_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/assignees{/user}","branches_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/branches{/branch}","tags_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/tags","blobs_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/git/refs{/sha}","trees_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/statuses/{sha}","languages_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/languages","stargazers_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/stargazers","contributors_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/contributors","subscribers_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/subscribers","subscription_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/subscription","commits_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/commits{/sha}","git_commits_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/git/commits{/sha}","comments_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/comments{/number}","issue_comment_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/issues/comments{/number}","contents_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/contents/{+path}","compare_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/merges","archive_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/downloads","issues_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/issues{/number}","pulls_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/pulls{/number}","milestones_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/milestones{/number}","notifications_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/labels{/name}","releases_url":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/releases{/id}","created_at":"2015-12-16T15:23:24Z","updated_at":"2016-01-12T01:34:12Z","pushed_at":"2016-01-18T16:36:27Z","git_url":"git://github.com/FUNPBL2015/Kan__groupreport.git","ssh_url":"git@github.com:FUNPBL2015/Kan__groupreport.git","clone_url":"https://github.com/FUNPBL2015/Kan__groupreport.git","svn_url":"https://github.com/FUNPBL2015/Kan__groupreport","homepage":null,"size":29402,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/pulls/58"},"html":{"href":"https://github.com/FUNPBL2015/Kan__groupreport/pull/58"},"issue":{"href":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/issues/58"},"comments":{"href":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/issues/58/comments"},"review_comments":{"href":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/pulls/58/comments"},"review_comment":{"href":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/pulls/58/commits"},"statuses":{"href":"https://api.github.com/repos/FUNPBL2015/Kan__groupreport/statuses/da10e4d4a63a47d3e296b4f4ac557b8ca46b72c6"}}}}