{"action":"created","comment":{"url":"https://api.github.com/repos/appleseedhq/appleseed/pulls/comments/234216721","pull_request_review_id":175804019,"id":234216721,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNDIxNjcyMQ==","diff_hunk":"@@ -0,0 +1,170 @@\n+\n+//\n+// This source file is part of appleseed.\n+// Visit https://appleseedhq.net/ for additional information and resources.\n+//\n+// This software is released under the MIT license.\n+//\n+// Copyright (c) 2018 Kevin Masson, The appleseedhq Organization\n+//\n+// Permission is hereby granted, free of charge, to any person obtaining a copy\n+// of this software and associated documentation files (the \"Software\"), to deal\n+// in the Software without restriction, including without limitation the rights\n+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+// copies of the Software, and to permit persons to whom the Software is\n+// furnished to do so, subject to the following conditions:\n+//\n+// The above copyright notice and this permission notice shall be included in\n+// all copies or substantial portions of the Software.\n+//\n+// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n+// THE SOFTWARE.\n+//\n+\n+// Interface header.\n+#include \"pixelvariationaov.h\"\n+\n+// appleseed.renderer headers.\n+#include \"renderer/kernel/rendering/pixelcontext.h\"\n+#include \"renderer/kernel/shading/shadingresult.h\"\n+#include \"renderer/modeling/aov/aov.h\"\n+#include \"renderer/kernel/aov/aovaccumulator.h\"\n+#include \"renderer/modeling/frame/frame.h\"\n+\n+// appleseed.foundation headers.\n+#include \"foundation/image/color.h\"\n+#include \"foundation/image/image.h\"\n+#include \"foundation/utility/api/apistring.h\"\n+#include \"foundation/utility/api/specializedapiarrays.h\"\n+#include \"foundation/utility/containers/dictionary.h\"\n+\n+// Standard headers.\n+#include <cstddef>\n+#include <memory>\n+#include <string>\n+\n+using namespace foundation;\n+using namespace std;\n+\n+namespace renderer\n+{\n+\n+namespace\n+{\n+    //\n+    // Pixel Variation AOV.\n+    //\n+\n+    const char* PixelVariationAOVModel = \"pixel_variation_aov\";\n+\n+    class PixelVariationAOV\n+      : public UnfilteredAOV\n+    {\n+      public:\n+        explicit PixelVariationAOV(const ParamArray& params)\n+          : UnfilteredAOV(\"pixel_variation\", params)\n+        {\n+        }\n+\n+        void post_process_image(const Frame& frame) override\n+        {\n+            static const Color3f Blue(0.0f, 0.0f, 1.0f);\n+            static const Color3f Red(1.0f, 0.0f, 0.0f);\n+\n+            const AABB2u& crop_window = frame.get_crop_window();\n+\n+            // Find the maximum variation.\n+            float max_variation = 0.0f;\n+\n+            for (size_t y = crop_window.min.y; y <= crop_window.max.y; ++y)\n+            {\n+                for (size_t x = crop_window.min.x; x <= crop_window.max.x; ++x)\n+                {\n+                    Color3f color;\n+                    m_image->get_pixel(x, y, color);\n+                    max_variation = max(color[0], max_variation);\n+                }\n+            }\n+\n+            // Normalize if a maximum was found.\n+            if (max_variation != 0.0f)\n+            {\n+                for (size_t y = crop_window.min.y; y <= crop_window.max.y; ++y)\n+                {\n+                    for (size_t x = crop_window.min.x; x <= crop_window.max.x; ++x)\n+                    {\n+                        Color3f color;\n+                        m_image->get_pixel(x, y, color);\n+\n+                        const float c = fit(color[0], 0.0f, max_variation, 0.0f, 1.0f);\n+                        assert(c >= 0.0f && c <= 1.0f);\n+                        m_image->set_pixel(x, y, lerp(Blue, Red, c));\n+                    }\n+                }\n+            }\n+            else\n+            {\n+                for (size_t y = crop_window.min.y; y <= crop_window.max.y; ++y)\n+                {\n+                    for (size_t x = crop_window.min.x; x <= crop_window.max.x; ++x)\n+                    {\n+                        m_image->set_pixel(x, y, Blue);\n+                    }\n+                }\n+            }\n+        }\n+\n+        const char* get_model() const override\n+        {\n+            return PixelVariationAOVModel;\n+        }\n+\n+      protected:\n+        auto_release_ptr<AOVAccumulator> create_accumulator() const override\n+        {\n+            return auto_release_ptr<AOVAccumulator>(\n+                new AOVAccumulator());\n+        }\n+    };\n+}\n+","path":"src/appleseed/renderer/modeling/aov/pixelvariationaov.cpp","position":135,"original_position":135,"commit_id":"367eddd3a2cc8dfd5e43983d01bbb8c4b0ba8856","original_commit_id":"367eddd3a2cc8dfd5e43983d01bbb8c4b0ba8856","user":{"login":"dictoon","id":321290,"node_id":"MDQ6VXNlcjMyMTI5MA==","avatar_url":"https://avatars1.githubusercontent.com/u/321290?v=4","gravatar_id":"","url":"https://api.github.com/users/dictoon","html_url":"https://github.com/dictoon","followers_url":"https://api.github.com/users/dictoon/followers","following_url":"https://api.github.com/users/dictoon/following{/other_user}","gists_url":"https://api.github.com/users/dictoon/gists{/gist_id}","starred_url":"https://api.github.com/users/dictoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dictoon/subscriptions","organizations_url":"https://api.github.com/users/dictoon/orgs","repos_url":"https://api.github.com/users/dictoon/repos","events_url":"https://api.github.com/users/dictoon/events{/privacy}","received_events_url":"https://api.github.com/users/dictoon/received_events","type":"User","site_admin":false},"body":"Insert an additional blank line before block comment.","created_at":"2018-11-16T14:10:25Z","updated_at":"2018-11-16T14:12:12Z","html_url":"https://github.com/appleseedhq/appleseed/pull/2302#discussion_r234216721","pull_request_url":"https://api.github.com/repos/appleseedhq/appleseed/pulls/2302","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/appleseedhq/appleseed/pulls/comments/234216721"},"html":{"href":"https://github.com/appleseedhq/appleseed/pull/2302#discussion_r234216721"},"pull_request":{"href":"https://api.github.com/repos/appleseedhq/appleseed/pulls/2302"}}},"pull_request":{"url":"https://api.github.com/repos/appleseedhq/appleseed/pulls/2302","id":231528296,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMxNTI4Mjk2","html_url":"https://github.com/appleseedhq/appleseed/pull/2302","diff_url":"https://github.com/appleseedhq/appleseed/pull/2302.diff","patch_url":"https://github.com/appleseedhq/appleseed/pull/2302.patch","issue_url":"https://api.github.com/repos/appleseedhq/appleseed/issues/2302","number":2302,"state":"open","locked":false,"title":"Refactor AOV and tile bbox code","user":{"login":"oktomus","id":4656466,"node_id":"MDQ6VXNlcjQ2NTY0NjY=","avatar_url":"https://avatars0.githubusercontent.com/u/4656466?v=4","gravatar_id":"","url":"https://api.github.com/users/oktomus","html_url":"https://github.com/oktomus","followers_url":"https://api.github.com/users/oktomus/followers","following_url":"https://api.github.com/users/oktomus/following{/other_user}","gists_url":"https://api.github.com/users/oktomus/gists{/gist_id}","starred_url":"https://api.github.com/users/oktomus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oktomus/subscriptions","organizations_url":"https://api.github.com/users/oktomus/orgs","repos_url":"https://api.github.com/users/oktomus/repos","events_url":"https://api.github.com/users/oktomus/events{/privacy}","received_events_url":"https://api.github.com/users/oktomus/received_events","type":"User","site_admin":false},"body":"Refactor tile bounding box creation code. \r\nRefactor AOV and AOVAccumulator code\r\n\r\n- Add *protected* field where it's missing.\r\n- Split the *diagnosticaov* file into multiple files.\r\n- Make AOV model name variables consistent.\r\n- Fix channel count for AOVs.\r\n- Ignore distance to pixel's center in unfiltered AOVs.\r\n- Handle multiple passes with Pixel Sample Count AOV.\r\n- Handle multiple passes with Pixel Variation AOV.\r\n- Ignore pixels outside of the crop window in the Invalid Samples AOV.\r\n- Fill the Invalid Samples AOV in *post_process*.\r\n- This closes #2127.","created_at":"2018-11-16T13:21:19Z","updated_at":"2018-11-16T14:12:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a087c0157edb627ec6a2b491322fc49229d44b98","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":997215544,"node_id":"MDU6TGFiZWw5OTcyMTU1NDQ=","url":"https://api.github.com/repos/appleseedhq/appleseed/labels/PR-Rebase","name":"PR-Rebase","color":"44fcd1","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/appleseedhq/appleseed/pulls/2302/commits","review_comments_url":"https://api.github.com/repos/appleseedhq/appleseed/pulls/2302/comments","review_comment_url":"https://api.github.com/repos/appleseedhq/appleseed/pulls/comments{/number}","comments_url":"https://api.github.com/repos/appleseedhq/appleseed/issues/2302/comments","statuses_url":"https://api.github.com/repos/appleseedhq/appleseed/statuses/367eddd3a2cc8dfd5e43983d01bbb8c4b0ba8856","head":{"label":"oktomus:feature/aov-refactoring","ref":"feature/aov-refactoring","sha":"367eddd3a2cc8dfd5e43983d01bbb8c4b0ba8856","user":{"login":"oktomus","id":4656466,"node_id":"MDQ6VXNlcjQ2NTY0NjY=","avatar_url":"https://avatars0.githubusercontent.com/u/4656466?v=4","gravatar_id":"","url":"https://api.github.com/users/oktomus","html_url":"https://github.com/oktomus","followers_url":"https://api.github.com/users/oktomus/followers","following_url":"https://api.github.com/users/oktomus/following{/other_user}","gists_url":"https://api.github.com/users/oktomus/gists{/gist_id}","starred_url":"https://api.github.com/users/oktomus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oktomus/subscriptions","organizations_url":"https://api.github.com/users/oktomus/orgs","repos_url":"https://api.github.com/users/oktomus/repos","events_url":"https://api.github.com/users/oktomus/events{/privacy}","received_events_url":"https://api.github.com/users/oktomus/received_events","type":"User","site_admin":false},"repo":{"id":122386792,"node_id":"MDEwOlJlcG9zaXRvcnkxMjIzODY3OTI=","name":"appleseed","full_name":"oktomus/appleseed","private":false,"owner":{"login":"oktomus","id":4656466,"node_id":"MDQ6VXNlcjQ2NTY0NjY=","avatar_url":"https://avatars0.githubusercontent.com/u/4656466?v=4","gravatar_id":"","url":"https://api.github.com/users/oktomus","html_url":"https://github.com/oktomus","followers_url":"https://api.github.com/users/oktomus/followers","following_url":"https://api.github.com/users/oktomus/following{/other_user}","gists_url":"https://api.github.com/users/oktomus/gists{/gist_id}","starred_url":"https://api.github.com/users/oktomus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oktomus/subscriptions","organizations_url":"https://api.github.com/users/oktomus/orgs","repos_url":"https://api.github.com/users/oktomus/repos","events_url":"https://api.github.com/users/oktomus/events{/privacy}","received_events_url":"https://api.github.com/users/oktomus/received_events","type":"User","site_admin":false},"html_url":"https://github.com/oktomus/appleseed","description":"A modern open source rendering engine for animation and visual effects","fork":true,"url":"https://api.github.com/repos/oktomus/appleseed","forks_url":"https://api.github.com/repos/oktomus/appleseed/forks","keys_url":"https://api.github.com/repos/oktomus/appleseed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oktomus/appleseed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oktomus/appleseed/teams","hooks_url":"https://api.github.com/repos/oktomus/appleseed/hooks","issue_events_url":"https://api.github.com/repos/oktomus/appleseed/issues/events{/number}","events_url":"https://api.github.com/repos/oktomus/appleseed/events","assignees_url":"https://api.github.com/repos/oktomus/appleseed/assignees{/user}","branches_url":"https://api.github.com/repos/oktomus/appleseed/branches{/branch}","tags_url":"https://api.github.com/repos/oktomus/appleseed/tags","blobs_url":"https://api.github.com/repos/oktomus/appleseed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oktomus/appleseed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oktomus/appleseed/git/refs{/sha}","trees_url":"https://api.github.com/repos/oktomus/appleseed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oktomus/appleseed/statuses/{sha}","languages_url":"https://api.github.com/repos/oktomus/appleseed/languages","stargazers_url":"https://api.github.com/repos/oktomus/appleseed/stargazers","contributors_url":"https://api.github.com/repos/oktomus/appleseed/contributors","subscribers_url":"https://api.github.com/repos/oktomus/appleseed/subscribers","subscription_url":"https://api.github.com/repos/oktomus/appleseed/subscription","commits_url":"https://api.github.com/repos/oktomus/appleseed/commits{/sha}","git_commits_url":"https://api.github.com/repos/oktomus/appleseed/git/commits{/sha}","comments_url":"https://api.github.com/repos/oktomus/appleseed/comments{/number}","issue_comment_url":"https://api.github.com/repos/oktomus/appleseed/issues/comments{/number}","contents_url":"https://api.github.com/repos/oktomus/appleseed/contents/{+path}","compare_url":"https://api.github.com/repos/oktomus/appleseed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oktomus/appleseed/merges","archive_url":"https://api.github.com/repos/oktomus/appleseed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oktomus/appleseed/downloads","issues_url":"https://api.github.com/repos/oktomus/appleseed/issues{/number}","pulls_url":"https://api.github.com/repos/oktomus/appleseed/pulls{/number}","milestones_url":"https://api.github.com/repos/oktomus/appleseed/milestones{/number}","notifications_url":"https://api.github.com/repos/oktomus/appleseed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oktomus/appleseed/labels{/name}","releases_url":"https://api.github.com/repos/oktomus/appleseed/releases{/id}","deployments_url":"https://api.github.com/repos/oktomus/appleseed/deployments","created_at":"2018-02-21T20:02:17Z","updated_at":"2018-07-30T13:47:31Z","pushed_at":"2018-11-16T13:22:12Z","git_url":"git://github.com/oktomus/appleseed.git","ssh_url":"git@github.com:oktomus/appleseed.git","clone_url":"https://github.com/oktomus/appleseed.git","svn_url":"https://github.com/oktomus/appleseed","homepage":"http://appleseedhq.net/","size":1316927,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"appleseedhq:master","ref":"master","sha":"a1e7800c05fd2678dd4edbc28c1cab5d72fd36a7","user":{"login":"appleseedhq","id":6373510,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYzNzM1MTA=","avatar_url":"https://avatars3.githubusercontent.com/u/6373510?v=4","gravatar_id":"","url":"https://api.github.com/users/appleseedhq","html_url":"https://github.com/appleseedhq","followers_url":"https://api.github.com/users/appleseedhq/followers","following_url":"https://api.github.com/users/appleseedhq/following{/other_user}","gists_url":"https://api.github.com/users/appleseedhq/gists{/gist_id}","starred_url":"https://api.github.com/users/appleseedhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appleseedhq/subscriptions","organizations_url":"https://api.github.com/users/appleseedhq/orgs","repos_url":"https://api.github.com/users/appleseedhq/repos","events_url":"https://api.github.com/users/appleseedhq/events{/privacy}","received_events_url":"https://api.github.com/users/appleseedhq/received_events","type":"Organization","site_admin":false},"repo":{"id":753784,"node_id":"MDEwOlJlcG9zaXRvcnk3NTM3ODQ=","name":"appleseed","full_name":"appleseedhq/appleseed","private":false,"owner":{"login":"appleseedhq","id":6373510,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYzNzM1MTA=","avatar_url":"https://avatars3.githubusercontent.com/u/6373510?v=4","gravatar_id":"","url":"https://api.github.com/users/appleseedhq","html_url":"https://github.com/appleseedhq","followers_url":"https://api.github.com/users/appleseedhq/followers","following_url":"https://api.github.com/users/appleseedhq/following{/other_user}","gists_url":"https://api.github.com/users/appleseedhq/gists{/gist_id}","starred_url":"https://api.github.com/users/appleseedhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appleseedhq/subscriptions","organizations_url":"https://api.github.com/users/appleseedhq/orgs","repos_url":"https://api.github.com/users/appleseedhq/repos","events_url":"https://api.github.com/users/appleseedhq/events{/privacy}","received_events_url":"https://api.github.com/users/appleseedhq/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/appleseedhq/appleseed","description":"A modern open source rendering engine for animation and visual effects","fork":false,"url":"https://api.github.com/repos/appleseedhq/appleseed","forks_url":"https://api.github.com/repos/appleseedhq/appleseed/forks","keys_url":"https://api.github.com/repos/appleseedhq/appleseed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/appleseedhq/appleseed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/appleseedhq/appleseed/teams","hooks_url":"https://api.github.com/repos/appleseedhq/appleseed/hooks","issue_events_url":"https://api.github.com/repos/appleseedhq/appleseed/issues/events{/number}","events_url":"https://api.github.com/repos/appleseedhq/appleseed/events","assignees_url":"https://api.github.com/repos/appleseedhq/appleseed/assignees{/user}","branches_url":"https://api.github.com/repos/appleseedhq/appleseed/branches{/branch}","tags_url":"https://api.github.com/repos/appleseedhq/appleseed/tags","blobs_url":"https://api.github.com/repos/appleseedhq/appleseed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/appleseedhq/appleseed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/appleseedhq/appleseed/git/refs{/sha}","trees_url":"https://api.github.com/repos/appleseedhq/appleseed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/appleseedhq/appleseed/statuses/{sha}","languages_url":"https://api.github.com/repos/appleseedhq/appleseed/languages","stargazers_url":"https://api.github.com/repos/appleseedhq/appleseed/stargazers","contributors_url":"https://api.github.com/repos/appleseedhq/appleseed/contributors","subscribers_url":"https://api.github.com/repos/appleseedhq/appleseed/subscribers","subscription_url":"https://api.github.com/repos/appleseedhq/appleseed/subscription","commits_url":"https://api.github.com/repos/appleseedhq/appleseed/commits{/sha}","git_commits_url":"https://api.github.com/repos/appleseedhq/appleseed/git/commits{/sha}","comments_url":"https://api.github.com/repos/appleseedhq/appleseed/comments{/number}","issue_comment_url":"https://api.github.com/repos/appleseedhq/appleseed/issues/comments{/number}","contents_url":"https://api.github.com/repos/appleseedhq/appleseed/contents/{+path}","compare_url":"https://api.github.com/repos/appleseedhq/appleseed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/appleseedhq/appleseed/merges","archive_url":"https://api.github.com/repos/appleseedhq/appleseed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/appleseedhq/appleseed/downloads","issues_url":"https://api.github.com/repos/appleseedhq/appleseed/issues{/number}","pulls_url":"https://api.github.com/repos/appleseedhq/appleseed/pulls{/number}","milestones_url":"https://api.github.com/repos/appleseedhq/appleseed/milestones{/number}","notifications_url":"https://api.github.com/repos/appleseedhq/appleseed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/appleseedhq/appleseed/labels{/name}","releases_url":"https://api.github.com/repos/appleseedhq/appleseed/releases{/id}","deployments_url":"https://api.github.com/repos/appleseedhq/appleseed/deployments","created_at":"2010-07-02T16:33:51Z","updated_at":"2018-11-16T10:20:34Z","pushed_at":"2018-11-16T13:22:13Z","git_url":"git://github.com/appleseedhq/appleseed.git","ssh_url":"git@github.com:appleseedhq/appleseed.git","clone_url":"https://github.com/appleseedhq/appleseed.git","svn_url":"https://github.com/appleseedhq/appleseed","homepage":"https://appleseedhq.net/","size":1316769,"stargazers_count":1149,"watchers_count":1149,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":198,"mirror_url":null,"archived":false,"open_issues_count":379,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":198,"open_issues":379,"watchers":1149,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/appleseedhq/appleseed/pulls/2302"},"html":{"href":"https://github.com/appleseedhq/appleseed/pull/2302"},"issue":{"href":"https://api.github.com/repos/appleseedhq/appleseed/issues/2302"},"comments":{"href":"https://api.github.com/repos/appleseedhq/appleseed/issues/2302/comments"},"review_comments":{"href":"https://api.github.com/repos/appleseedhq/appleseed/pulls/2302/comments"},"review_comment":{"href":"https://api.github.com/repos/appleseedhq/appleseed/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/appleseedhq/appleseed/pulls/2302/commits"},"statuses":{"href":"https://api.github.com/repos/appleseedhq/appleseed/statuses/367eddd3a2cc8dfd5e43983d01bbb8c4b0ba8856"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"dictoon"}}