{"action":"created","comment":{"url":"https://api.github.com/repos/opencv/opencv/pulls/comments/173798864","pull_request_review_id":103045286,"id":173798864,"diff_hunk":"@@ -0,0 +1,676 @@\n+// This file is part of OpenCV project.\n+// It is subject to the license terms in the LICENSE file found in the top-level directory\n+// of this distribution and at http://opencv.org/license.html\n+\n+#include \"precomp.hpp\"\n+#include <limits>\n+#include \"opencl_kernels_imgproc.hpp\"\n+#include \"hal_replacement.hpp\"\n+#include \"opencv2/core/hal/intrin.hpp\"\n+#include \"opencv2/core/softfloat.hpp\"\n+\n+#define  CV_DESCALE(x,n)     (((x) + (1 << ((n)-1))) >> (n))\n+\n+namespace cv\n+{\n+\n+//constants for conversion from/to RGB and Gray, YUV, YCrCb according to BT.601\n+const float B2YF = 0.114f;\n+const float G2YF = 0.587f;\n+const float R2YF = 0.299f;\n+\n+enum\n+{\n+    yuv_shift = 14,\n+    xyz_shift = 12,\n+    R2Y = 4899, // == R2YF*16384\n+    G2Y = 9617, // == G2YF*16384\n+    B2Y = 1868, // == B2YF*16384\n+    BLOCK_SIZE = 256\n+};\n+\n+template<typename _Tp> struct ColorChannel\n+{\n+    typedef float worktype_f;\n+    static _Tp max() { return std::numeric_limits<_Tp>::max(); }\n+    static _Tp half() { return (_Tp)(max()/2 + 1); }\n+};\n+\n+template<> struct ColorChannel<float>\n+{\n+    typedef float worktype_f;\n+    static float max() { return 1.f; }\n+    static float half() { return 0.5f; }\n+};\n+\n+/*template<> struct ColorChannel<double>\n+{\n+    typedef double worktype_f;\n+    static double max() { return 1.; }\n+    static double half() { return 0.5; }\n+};*/\n+\n+//\n+// Helper functions\n+//\n+\n+namespace {\n+\n+inline bool isHSV(int code)\n+{\n+    using namespace cv;\n+    switch(code)\n+    {\n+    case COLOR_HSV2BGR: case COLOR_HSV2RGB: case COLOR_HSV2BGR_FULL: case COLOR_HSV2RGB_FULL:\n+    case COLOR_BGR2HSV: case COLOR_RGB2HSV: case COLOR_BGR2HSV_FULL: case COLOR_RGB2HSV_FULL:\n+        return true;\n+    default:\n+        return false;\n+    }\n+}\n+\n+inline bool isLab(int code)\n+{\n+    using namespace cv;\n+    switch (code)\n+    {\n+    case COLOR_Lab2BGR: case COLOR_Lab2RGB: case COLOR_Lab2LBGR: case COLOR_Lab2LRGB:\n+    case COLOR_BGR2Lab: case COLOR_RGB2Lab: case COLOR_LBGR2Lab: case COLOR_LRGB2Lab:\n+        return true;\n+    default:\n+        return false;\n+    }\n+}\n+\n+inline bool issRGB(int code)","path":"modules/imgproc/src/color.hpp","position":null,"original_position":85,"commit_id":"049f508584c9595f230743ec82a97015f4963ba0","original_commit_id":"69497cbd22cac431ceb640702b9c655171b22501","user":{"login":"alalek","id":4981219,"avatar_url":"https://avatars0.githubusercontent.com/u/4981219?v=4","gravatar_id":"","url":"https://api.github.com/users/alalek","html_url":"https://github.com/alalek","followers_url":"https://api.github.com/users/alalek/followers","following_url":"https://api.github.com/users/alalek/following{/other_user}","gists_url":"https://api.github.com/users/alalek/gists{/gist_id}","starred_url":"https://api.github.com/users/alalek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alalek/subscriptions","organizations_url":"https://api.github.com/users/alalek/orgs","repos_url":"https://api.github.com/users/alalek/repos","events_url":"https://api.github.com/users/alalek/events{/privacy}","received_events_url":"https://api.github.com/users/alalek/received_events","type":"User","site_admin":false},"body":"`is_sRGB` should be fine","created_at":"2018-03-12T13:40:35Z","updated_at":"2018-03-12T13:40:35Z","html_url":"https://github.com/opencv/opencv/pull/10869#discussion_r173798864","pull_request_url":"https://api.github.com/repos/opencv/opencv/pulls/10869","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/opencv/opencv/pulls/comments/173798864"},"html":{"href":"https://github.com/opencv/opencv/pull/10869#discussion_r173798864"},"pull_request":{"href":"https://api.github.com/repos/opencv/opencv/pulls/10869"}},"in_reply_to_id":173755299},"pull_request":{"url":"https://api.github.com/repos/opencv/opencv/pulls/10869","id":169178088,"html_url":"https://github.com/opencv/opencv/pull/10869","diff_url":"https://github.com/opencv/opencv/pull/10869.diff","patch_url":"https://github.com/opencv/opencv/pull/10869.patch","issue_url":"https://api.github.com/repos/opencv/opencv/issues/10869","number":10869,"state":"open","locked":false,"title":"color.cpp split","user":{"login":"savuor","id":10323511,"avatar_url":"https://avatars3.githubusercontent.com/u/10323511?v=4","gravatar_id":"","url":"https://api.github.com/users/savuor","html_url":"https://github.com/savuor","followers_url":"https://api.github.com/users/savuor/followers","following_url":"https://api.github.com/users/savuor/following{/other_user}","gists_url":"https://api.github.com/users/savuor/gists{/gist_id}","starred_url":"https://api.github.com/users/savuor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/savuor/subscriptions","organizations_url":"https://api.github.com/users/savuor/orgs","repos_url":"https://api.github.com/users/savuor/repos","events_url":"https://api.github.com/users/savuor/events{/privacy}","received_events_url":"https://api.github.com/users/savuor/received_events","type":"User","site_admin":false},"body":"### This pullrequest changes\r\n\r\n* color.cpp and cvtcolor.cl are split to several files by color spaces families\r\n* each color conversion has its own interface\r\n\r\n### To be discussed\r\n\r\n* new functions interfaces and what of them are to be exposed to user","created_at":"2018-02-14T17:48:04Z","updated_at":"2018-03-12T13:40:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"76152545040a7dd4bdad31cf7a61aaa6ec2a48cb","assignee":null,"assignees":[],"requested_reviewers":[{"login":"mshabunin","id":3304494,"avatar_url":"https://avatars0.githubusercontent.com/u/3304494?v=4","gravatar_id":"","url":"https://api.github.com/users/mshabunin","html_url":"https://github.com/mshabunin","followers_url":"https://api.github.com/users/mshabunin/followers","following_url":"https://api.github.com/users/mshabunin/following{/other_user}","gists_url":"https://api.github.com/users/mshabunin/gists{/gist_id}","starred_url":"https://api.github.com/users/mshabunin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mshabunin/subscriptions","organizations_url":"https://api.github.com/users/mshabunin/orgs","repos_url":"https://api.github.com/users/mshabunin/repos","events_url":"https://api.github.com/users/mshabunin/events{/privacy}","received_events_url":"https://api.github.com/users/mshabunin/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/opencv/opencv/pulls/10869/commits","review_comments_url":"https://api.github.com/repos/opencv/opencv/pulls/10869/comments","review_comment_url":"https://api.github.com/repos/opencv/opencv/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opencv/opencv/issues/10869/comments","statuses_url":"https://api.github.com/repos/opencv/opencv/statuses/049f508584c9595f230743ec82a97015f4963ba0","head":{"label":"savuor:color_cpp_split","ref":"color_cpp_split","sha":"049f508584c9595f230743ec82a97015f4963ba0","user":{"login":"savuor","id":10323511,"avatar_url":"https://avatars3.githubusercontent.com/u/10323511?v=4","gravatar_id":"","url":"https://api.github.com/users/savuor","html_url":"https://github.com/savuor","followers_url":"https://api.github.com/users/savuor/followers","following_url":"https://api.github.com/users/savuor/following{/other_user}","gists_url":"https://api.github.com/users/savuor/gists{/gist_id}","starred_url":"https://api.github.com/users/savuor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/savuor/subscriptions","organizations_url":"https://api.github.com/users/savuor/orgs","repos_url":"https://api.github.com/users/savuor/repos","events_url":"https://api.github.com/users/savuor/events{/privacy}","received_events_url":"https://api.github.com/users/savuor/received_events","type":"User","site_admin":false},"repo":{"id":60094359,"name":"opencv","full_name":"savuor/opencv","owner":{"login":"savuor","id":10323511,"avatar_url":"https://avatars3.githubusercontent.com/u/10323511?v=4","gravatar_id":"","url":"https://api.github.com/users/savuor","html_url":"https://github.com/savuor","followers_url":"https://api.github.com/users/savuor/followers","following_url":"https://api.github.com/users/savuor/following{/other_user}","gists_url":"https://api.github.com/users/savuor/gists{/gist_id}","starred_url":"https://api.github.com/users/savuor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/savuor/subscriptions","organizations_url":"https://api.github.com/users/savuor/orgs","repos_url":"https://api.github.com/users/savuor/repos","events_url":"https://api.github.com/users/savuor/events{/privacy}","received_events_url":"https://api.github.com/users/savuor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/savuor/opencv","description":"Open Source Computer Vision Library","fork":true,"url":"https://api.github.com/repos/savuor/opencv","forks_url":"https://api.github.com/repos/savuor/opencv/forks","keys_url":"https://api.github.com/repos/savuor/opencv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/savuor/opencv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/savuor/opencv/teams","hooks_url":"https://api.github.com/repos/savuor/opencv/hooks","issue_events_url":"https://api.github.com/repos/savuor/opencv/issues/events{/number}","events_url":"https://api.github.com/repos/savuor/opencv/events","assignees_url":"https://api.github.com/repos/savuor/opencv/assignees{/user}","branches_url":"https://api.github.com/repos/savuor/opencv/branches{/branch}","tags_url":"https://api.github.com/repos/savuor/opencv/tags","blobs_url":"https://api.github.com/repos/savuor/opencv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/savuor/opencv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/savuor/opencv/git/refs{/sha}","trees_url":"https://api.github.com/repos/savuor/opencv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/savuor/opencv/statuses/{sha}","languages_url":"https://api.github.com/repos/savuor/opencv/languages","stargazers_url":"https://api.github.com/repos/savuor/opencv/stargazers","contributors_url":"https://api.github.com/repos/savuor/opencv/contributors","subscribers_url":"https://api.github.com/repos/savuor/opencv/subscribers","subscription_url":"https://api.github.com/repos/savuor/opencv/subscription","commits_url":"https://api.github.com/repos/savuor/opencv/commits{/sha}","git_commits_url":"https://api.github.com/repos/savuor/opencv/git/commits{/sha}","comments_url":"https://api.github.com/repos/savuor/opencv/comments{/number}","issue_comment_url":"https://api.github.com/repos/savuor/opencv/issues/comments{/number}","contents_url":"https://api.github.com/repos/savuor/opencv/contents/{+path}","compare_url":"https://api.github.com/repos/savuor/opencv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/savuor/opencv/merges","archive_url":"https://api.github.com/repos/savuor/opencv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/savuor/opencv/downloads","issues_url":"https://api.github.com/repos/savuor/opencv/issues{/number}","pulls_url":"https://api.github.com/repos/savuor/opencv/pulls{/number}","milestones_url":"https://api.github.com/repos/savuor/opencv/milestones{/number}","notifications_url":"https://api.github.com/repos/savuor/opencv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/savuor/opencv/labels{/name}","releases_url":"https://api.github.com/repos/savuor/opencv/releases{/id}","deployments_url":"https://api.github.com/repos/savuor/opencv/deployments","created_at":"2016-05-31T13:59:50Z","updated_at":"2016-05-31T14:00:02Z","pushed_at":"2018-03-12T13:39:07Z","git_url":"git://github.com/savuor/opencv.git","ssh_url":"git@github.com:savuor/opencv.git","clone_url":"https://github.com/savuor/opencv.git","svn_url":"https://github.com/savuor/opencv","homepage":"opencv.org","size":450931,"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":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"opencv:master","ref":"master","sha":"f61076a5d8d5b67b91b67a1a0f56035c042efea2","user":{"login":"opencv","id":5009934,"avatar_url":"https://avatars3.githubusercontent.com/u/5009934?v=4","gravatar_id":"","url":"https://api.github.com/users/opencv","html_url":"https://github.com/opencv","followers_url":"https://api.github.com/users/opencv/followers","following_url":"https://api.github.com/users/opencv/following{/other_user}","gists_url":"https://api.github.com/users/opencv/gists{/gist_id}","starred_url":"https://api.github.com/users/opencv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencv/subscriptions","organizations_url":"https://api.github.com/users/opencv/orgs","repos_url":"https://api.github.com/users/opencv/repos","events_url":"https://api.github.com/users/opencv/events{/privacy}","received_events_url":"https://api.github.com/users/opencv/received_events","type":"Organization","site_admin":false},"repo":{"id":5108051,"name":"opencv","full_name":"opencv/opencv","owner":{"login":"opencv","id":5009934,"avatar_url":"https://avatars3.githubusercontent.com/u/5009934?v=4","gravatar_id":"","url":"https://api.github.com/users/opencv","html_url":"https://github.com/opencv","followers_url":"https://api.github.com/users/opencv/followers","following_url":"https://api.github.com/users/opencv/following{/other_user}","gists_url":"https://api.github.com/users/opencv/gists{/gist_id}","starred_url":"https://api.github.com/users/opencv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencv/subscriptions","organizations_url":"https://api.github.com/users/opencv/orgs","repos_url":"https://api.github.com/users/opencv/repos","events_url":"https://api.github.com/users/opencv/events{/privacy}","received_events_url":"https://api.github.com/users/opencv/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opencv/opencv","description":"Open Source Computer Vision Library","fork":false,"url":"https://api.github.com/repos/opencv/opencv","forks_url":"https://api.github.com/repos/opencv/opencv/forks","keys_url":"https://api.github.com/repos/opencv/opencv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opencv/opencv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opencv/opencv/teams","hooks_url":"https://api.github.com/repos/opencv/opencv/hooks","issue_events_url":"https://api.github.com/repos/opencv/opencv/issues/events{/number}","events_url":"https://api.github.com/repos/opencv/opencv/events","assignees_url":"https://api.github.com/repos/opencv/opencv/assignees{/user}","branches_url":"https://api.github.com/repos/opencv/opencv/branches{/branch}","tags_url":"https://api.github.com/repos/opencv/opencv/tags","blobs_url":"https://api.github.com/repos/opencv/opencv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opencv/opencv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opencv/opencv/git/refs{/sha}","trees_url":"https://api.github.com/repos/opencv/opencv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opencv/opencv/statuses/{sha}","languages_url":"https://api.github.com/repos/opencv/opencv/languages","stargazers_url":"https://api.github.com/repos/opencv/opencv/stargazers","contributors_url":"https://api.github.com/repos/opencv/opencv/contributors","subscribers_url":"https://api.github.com/repos/opencv/opencv/subscribers","subscription_url":"https://api.github.com/repos/opencv/opencv/subscription","commits_url":"https://api.github.com/repos/opencv/opencv/commits{/sha}","git_commits_url":"https://api.github.com/repos/opencv/opencv/git/commits{/sha}","comments_url":"https://api.github.com/repos/opencv/opencv/comments{/number}","issue_comment_url":"https://api.github.com/repos/opencv/opencv/issues/comments{/number}","contents_url":"https://api.github.com/repos/opencv/opencv/contents/{+path}","compare_url":"https://api.github.com/repos/opencv/opencv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opencv/opencv/merges","archive_url":"https://api.github.com/repos/opencv/opencv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opencv/opencv/downloads","issues_url":"https://api.github.com/repos/opencv/opencv/issues{/number}","pulls_url":"https://api.github.com/repos/opencv/opencv/pulls{/number}","milestones_url":"https://api.github.com/repos/opencv/opencv/milestones{/number}","notifications_url":"https://api.github.com/repos/opencv/opencv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opencv/opencv/labels{/name}","releases_url":"https://api.github.com/repos/opencv/opencv/releases{/id}","deployments_url":"https://api.github.com/repos/opencv/opencv/deployments","created_at":"2012-07-19T09:40:17Z","updated_at":"2018-03-12T13:23:36Z","pushed_at":"2018-03-12T13:39:11Z","git_url":"git://github.com/opencv/opencv.git","ssh_url":"git@github.com:opencv/opencv.git","clone_url":"https://github.com/opencv/opencv.git","svn_url":"https://github.com/opencv/opencv","homepage":"https://opencv.org","size":450834,"stargazers_count":22820,"watchers_count":22820,"language":"C++","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16437,"mirror_url":null,"archived":false,"open_issues_count":1382,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":16437,"open_issues":1382,"watchers":22820,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opencv/opencv/pulls/10869"},"html":{"href":"https://github.com/opencv/opencv/pull/10869"},"issue":{"href":"https://api.github.com/repos/opencv/opencv/issues/10869"},"comments":{"href":"https://api.github.com/repos/opencv/opencv/issues/10869/comments"},"review_comments":{"href":"https://api.github.com/repos/opencv/opencv/pulls/10869/comments"},"review_comment":{"href":"https://api.github.com/repos/opencv/opencv/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opencv/opencv/pulls/10869/commits"},"statuses":{"href":"https://api.github.com/repos/opencv/opencv/statuses/049f508584c9595f230743ec82a97015f4963ba0"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"alalek"}}