{"action":"created","comment":{"url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls/comments/25570358","id":25570358,"diff_hunk":"@@ -0,0 +1,58 @@\n+/* *****************************************************************************\n+ * A.L.E (Arcade Learning Environment)\n+ * Copyright (c) 2009-2013 by Yavar Naddaf, Joel Veness, Marc G. Bellemare and \n+ *   the Reinforcement Learning and Artificial Intelligence Laboratory\n+ * Released under the GNU General Public License; see License.txt for details. \n+ *\n+ * Based on: Stella  --  \"An Atari 2600 VCS Emulator\"\n+ * Copyright (c) 1995-2007 by Bradford W. Mott and the Stella team\n+ *\n+ * *****************************************************************************\n+ *  ScreenExporter.hpp \n+ *\n+ *  A class for exporting Atari 2600 frames as PNGs.\n+ *\n+ **************************************************************************** */\n+\n+#ifndef __SCREEN_EXPORTER_HPP__\n+#define __SCREEN_EXPORTER_HPP__ \n+\n+#include <string>\n+#include \"display_screen.h\"\n+#include \"ale_screen.hpp\"\n+\n+class ScreenExporter {\n+\n+    public:\n+\n+        /** Creates a new ScreenExporter which can be used to save screens using save(filename). */ \n+        ScreenExporter(ColourPalette &palette);\n+\n+        /** Creates a new ScreenExporter which will save frames successively as basename + ######, where\n+            ###### is an integer between 000000 and 999999. */\n+        ScreenExporter(ColourPalette &palette, const std::string &basename);\n+\n+        /** Save the given screen to the given filename. No paths are created. */\n+        void save(const ALEScreen &screen, const std::string &filename) const;\n+\n+        /** Save the given screen according to our own internal numbering. */\n+        void saveNext(const ALEScreen &screen);\n+\n+    private:\n+\n+        ColourPalette &m_palette;\n+\n+        /** The next frame number. */\n+        int m_frame_number;\n+\n+        /** The width of the frame number when constructing filenames (set to 6). */\n+        int m_frame_field_width;\n+\n+        /** The base path, to which we append the frame number. */\n+        std::string m_basename;","path":"src/common/ScreenExporter.hpp","position":52,"original_position":52,"commit_id":"7fb8e202dca65b66eea9876a6757ea7c395b15e1","original_commit_id":"7fb8e202dca65b66eea9876a6757ea7c395b15e1","user":{"login":"mhauskn","id":19769,"avatar_url":"https://avatars.githubusercontent.com/u/19769?v=3","gravatar_id":"","url":"https://api.github.com/users/mhauskn","html_url":"https://github.com/mhauskn","followers_url":"https://api.github.com/users/mhauskn/followers","following_url":"https://api.github.com/users/mhauskn/following{/other_user}","gists_url":"https://api.github.com/users/mhauskn/gists{/gist_id}","starred_url":"https://api.github.com/users/mhauskn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhauskn/subscriptions","organizations_url":"https://api.github.com/users/mhauskn/orgs","repos_url":"https://api.github.com/users/mhauskn/repos","events_url":"https://api.github.com/users/mhauskn/events{/privacy}","received_events_url":"https://api.github.com/users/mhauskn/received_events","type":"User","site_admin":false},"body":"Maybe we should call this a basepath throughout. Before I read the .cpp file, I was a bit confused that it should be a file path.","created_at":"2015-03-01T19:32:09Z","updated_at":"2015-03-01T19:32:09Z","html_url":"https://github.com/mgbellemare/Arcade-Learning-Environment/pull/46#discussion_r25570358","pull_request_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls/46","_links":{"self":{"href":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls/comments/25570358"},"html":{"href":"https://github.com/mgbellemare/Arcade-Learning-Environment/pull/46#discussion_r25570358"},"pull_request":{"href":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls/46"}}},"pull_request":{"url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls/46","id":30246440,"html_url":"https://github.com/mgbellemare/Arcade-Learning-Environment/pull/46","diff_url":"https://github.com/mgbellemare/Arcade-Learning-Environment/pull/46.diff","patch_url":"https://github.com/mgbellemare/Arcade-Learning-Environment/pull/46.patch","issue_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/issues/46","number":46,"state":"open","locked":false,"title":"Goodbye export screen","user":{"login":"mgbellemare","id":2350286,"avatar_url":"https://avatars.githubusercontent.com/u/2350286?v=3","gravatar_id":"","url":"https://api.github.com/users/mgbellemare","html_url":"https://github.com/mgbellemare","followers_url":"https://api.github.com/users/mgbellemare/followers","following_url":"https://api.github.com/users/mgbellemare/following{/other_user}","gists_url":"https://api.github.com/users/mgbellemare/gists{/gist_id}","starred_url":"https://api.github.com/users/mgbellemare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgbellemare/subscriptions","organizations_url":"https://api.github.com/users/mgbellemare/orgs","repos_url":"https://api.github.com/users/mgbellemare/repos","events_url":"https://api.github.com/users/mgbellemare/events{/privacy}","received_events_url":"https://api.github.com/users/mgbellemare/received_events","type":"User","site_admin":false},"body":"I've added code to crunch out png frames, and finally slain ExportScreen. There are two ways to use this:\r\n\r\n1. Either to save a single frame (e.g., via AleInterface::saveScreenPNG()), or\r\n2. To save a sequence of frames, via ScreenExporter::saveNext().\r\n\r\nThe interface is still a bit clunky, but you can try it out with the following three lines of code:\r\n    #include \"common/ScreenExporter.hpp\"\r\n    std::auto_ptr<ScreenExporter> exporter(ale.createScreenExporter(\"/tmp/frame/frame\"));\r\n    exporter->saveNext(ale.getScreen());\r\n\r\nwhere the last line should be called after every step of the ALE.","created_at":"2015-03-01T18:47:57Z","updated_at":"2015-03-01T19:32:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5c619961403fff046e1dbef20ae70b9d8229fd18","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls/46/commits","review_comments_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls/46/comments","review_comment_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/issues/46/comments","statuses_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/statuses/7fb8e202dca65b66eea9876a6757ea7c395b15e1","head":{"label":"mgbellemare:goodbye-export-screen","ref":"goodbye-export-screen","sha":"7fb8e202dca65b66eea9876a6757ea7c395b15e1","user":{"login":"mgbellemare","id":2350286,"avatar_url":"https://avatars.githubusercontent.com/u/2350286?v=3","gravatar_id":"","url":"https://api.github.com/users/mgbellemare","html_url":"https://github.com/mgbellemare","followers_url":"https://api.github.com/users/mgbellemare/followers","following_url":"https://api.github.com/users/mgbellemare/following{/other_user}","gists_url":"https://api.github.com/users/mgbellemare/gists{/gist_id}","starred_url":"https://api.github.com/users/mgbellemare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgbellemare/subscriptions","organizations_url":"https://api.github.com/users/mgbellemare/orgs","repos_url":"https://api.github.com/users/mgbellemare/repos","events_url":"https://api.github.com/users/mgbellemare/events{/privacy}","received_events_url":"https://api.github.com/users/mgbellemare/received_events","type":"User","site_admin":false},"repo":{"id":5816654,"name":"Arcade-Learning-Environment","full_name":"mgbellemare/Arcade-Learning-Environment","owner":{"login":"mgbellemare","id":2350286,"avatar_url":"https://avatars.githubusercontent.com/u/2350286?v=3","gravatar_id":"","url":"https://api.github.com/users/mgbellemare","html_url":"https://github.com/mgbellemare","followers_url":"https://api.github.com/users/mgbellemare/followers","following_url":"https://api.github.com/users/mgbellemare/following{/other_user}","gists_url":"https://api.github.com/users/mgbellemare/gists{/gist_id}","starred_url":"https://api.github.com/users/mgbellemare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgbellemare/subscriptions","organizations_url":"https://api.github.com/users/mgbellemare/orgs","repos_url":"https://api.github.com/users/mgbellemare/repos","events_url":"https://api.github.com/users/mgbellemare/events{/privacy}","received_events_url":"https://api.github.com/users/mgbellemare/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mgbellemare/Arcade-Learning-Environment","description":"The Arcade Learning Environment (ALE) -- a platform for AI research.","fork":false,"url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment","forks_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/forks","keys_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/teams","hooks_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/hooks","issue_events_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/issues/events{/number}","events_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/events","assignees_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/assignees{/user}","branches_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/branches{/branch}","tags_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/tags","blobs_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/git/refs{/sha}","trees_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/statuses/{sha}","languages_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/languages","stargazers_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/stargazers","contributors_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/contributors","subscribers_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/subscribers","subscription_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/subscription","commits_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/commits{/sha}","git_commits_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/git/commits{/sha}","comments_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/comments{/number}","issue_comment_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/issues/comments{/number}","contents_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/contents/{+path}","compare_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/merges","archive_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/downloads","issues_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/issues{/number}","pulls_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls{/number}","milestones_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/milestones{/number}","notifications_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/labels{/name}","releases_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/releases{/id}","created_at":"2012-09-15T01:42:13Z","updated_at":"2015-02-26T22:04:31Z","pushed_at":"2015-03-01T18:43:01Z","git_url":"git://github.com/mgbellemare/Arcade-Learning-Environment.git","ssh_url":"git@github.com:mgbellemare/Arcade-Learning-Environment.git","clone_url":"https://github.com/mgbellemare/Arcade-Learning-Environment.git","svn_url":"https://github.com/mgbellemare/Arcade-Learning-Environment","homepage":null,"size":2985,"stargazers_count":37,"watchers_count":37,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":4,"forks":21,"open_issues":4,"watchers":37,"default_branch":"master"}},"base":{"label":"mgbellemare:dev","ref":"dev","sha":"80776c18606afda4607ab31cee92739fef8f238c","user":{"login":"mgbellemare","id":2350286,"avatar_url":"https://avatars.githubusercontent.com/u/2350286?v=3","gravatar_id":"","url":"https://api.github.com/users/mgbellemare","html_url":"https://github.com/mgbellemare","followers_url":"https://api.github.com/users/mgbellemare/followers","following_url":"https://api.github.com/users/mgbellemare/following{/other_user}","gists_url":"https://api.github.com/users/mgbellemare/gists{/gist_id}","starred_url":"https://api.github.com/users/mgbellemare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgbellemare/subscriptions","organizations_url":"https://api.github.com/users/mgbellemare/orgs","repos_url":"https://api.github.com/users/mgbellemare/repos","events_url":"https://api.github.com/users/mgbellemare/events{/privacy}","received_events_url":"https://api.github.com/users/mgbellemare/received_events","type":"User","site_admin":false},"repo":{"id":5816654,"name":"Arcade-Learning-Environment","full_name":"mgbellemare/Arcade-Learning-Environment","owner":{"login":"mgbellemare","id":2350286,"avatar_url":"https://avatars.githubusercontent.com/u/2350286?v=3","gravatar_id":"","url":"https://api.github.com/users/mgbellemare","html_url":"https://github.com/mgbellemare","followers_url":"https://api.github.com/users/mgbellemare/followers","following_url":"https://api.github.com/users/mgbellemare/following{/other_user}","gists_url":"https://api.github.com/users/mgbellemare/gists{/gist_id}","starred_url":"https://api.github.com/users/mgbellemare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgbellemare/subscriptions","organizations_url":"https://api.github.com/users/mgbellemare/orgs","repos_url":"https://api.github.com/users/mgbellemare/repos","events_url":"https://api.github.com/users/mgbellemare/events{/privacy}","received_events_url":"https://api.github.com/users/mgbellemare/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mgbellemare/Arcade-Learning-Environment","description":"The Arcade Learning Environment (ALE) -- a platform for AI research.","fork":false,"url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment","forks_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/forks","keys_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/teams","hooks_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/hooks","issue_events_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/issues/events{/number}","events_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/events","assignees_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/assignees{/user}","branches_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/branches{/branch}","tags_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/tags","blobs_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/git/refs{/sha}","trees_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/statuses/{sha}","languages_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/languages","stargazers_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/stargazers","contributors_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/contributors","subscribers_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/subscribers","subscription_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/subscription","commits_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/commits{/sha}","git_commits_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/git/commits{/sha}","comments_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/comments{/number}","issue_comment_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/issues/comments{/number}","contents_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/contents/{+path}","compare_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/merges","archive_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/downloads","issues_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/issues{/number}","pulls_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls{/number}","milestones_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/milestones{/number}","notifications_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/labels{/name}","releases_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/releases{/id}","created_at":"2012-09-15T01:42:13Z","updated_at":"2015-02-26T22:04:31Z","pushed_at":"2015-03-01T18:43:01Z","git_url":"git://github.com/mgbellemare/Arcade-Learning-Environment.git","ssh_url":"git@github.com:mgbellemare/Arcade-Learning-Environment.git","clone_url":"https://github.com/mgbellemare/Arcade-Learning-Environment.git","svn_url":"https://github.com/mgbellemare/Arcade-Learning-Environment","homepage":null,"size":2985,"stargazers_count":37,"watchers_count":37,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":4,"forks":21,"open_issues":4,"watchers":37,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls/46"},"html":{"href":"https://github.com/mgbellemare/Arcade-Learning-Environment/pull/46"},"issue":{"href":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/issues/46"},"comments":{"href":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/issues/46/comments"},"review_comments":{"href":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls/46/comments"},"review_comment":{"href":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls/46/commits"},"statuses":{"href":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/statuses/7fb8e202dca65b66eea9876a6757ea7c395b15e1"}}}}