{"action":"created","issue":{"url":"https://api.github.com/repos/Beep6581/RawTherapee/issues/3346","repository_url":"https://api.github.com/repos/Beep6581/RawTherapee","labels_url":"https://api.github.com/repos/Beep6581/RawTherapee/issues/3346/labels{/name}","comments_url":"https://api.github.com/repos/Beep6581/RawTherapee/issues/3346/comments","events_url":"https://api.github.com/repos/Beep6581/RawTherapee/issues/3346/events","html_url":"https://github.com/Beep6581/RawTherapee/issues/3346","id":159949947,"number":3346,"title":"Rework median defines","user":{"login":"Floessie","id":10133457,"avatar_url":"https://avatars.githubusercontent.com/u/10133457?v=3","gravatar_id":"","url":"https://api.github.com/users/Floessie","html_url":"https://github.com/Floessie","followers_url":"https://api.github.com/users/Floessie/followers","following_url":"https://api.github.com/users/Floessie/following{/other_user}","gists_url":"https://api.github.com/users/Floessie/gists{/gist_id}","starred_url":"https://api.github.com/users/Floessie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Floessie/subscriptions","organizations_url":"https://api.github.com/users/Floessie/orgs","repos_url":"https://api.github.com/users/Floessie/repos","events_url":"https://api.github.com/users/Floessie/events{/privacy}","received_events_url":"https://api.github.com/users/Floessie/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Beep6581/RawTherapee/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"Floessie","id":10133457,"avatar_url":"https://avatars.githubusercontent.com/u/10133457?v=3","gravatar_id":"","url":"https://api.github.com/users/Floessie","html_url":"https://github.com/Floessie","followers_url":"https://api.github.com/users/Floessie/followers","following_url":"https://api.github.com/users/Floessie/following{/other_user}","gists_url":"https://api.github.com/users/Floessie/gists{/gist_id}","starred_url":"https://api.github.com/users/Floessie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Floessie/subscriptions","organizations_url":"https://api.github.com/users/Floessie/orgs","repos_url":"https://api.github.com/users/Floessie/repos","events_url":"https://api.github.com/users/Floessie/events{/privacy}","received_events_url":"https://api.github.com/users/Floessie/received_events","type":"User","site_admin":false},"assignees":[{"login":"Floessie","id":10133457,"avatar_url":"https://avatars.githubusercontent.com/u/10133457?v=3","gravatar_id":"","url":"https://api.github.com/users/Floessie","html_url":"https://github.com/Floessie","followers_url":"https://api.github.com/users/Floessie/followers","following_url":"https://api.github.com/users/Floessie/following{/other_user}","gists_url":"https://api.github.com/users/Floessie/gists{/gist_id}","starred_url":"https://api.github.com/users/Floessie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Floessie/subscriptions","organizations_url":"https://api.github.com/users/Floessie/orgs","repos_url":"https://api.github.com/users/Floessie/repos","events_url":"https://api.github.com/users/Floessie/events{/privacy}","received_events_url":"https://api.github.com/users/Floessie/received_events","type":"User","site_admin":false}],"milestone":null,"comments":42,"created_at":"2016-06-13T13:27:40Z","updated_at":"2016-06-30T22:58:10Z","closed_at":null,"body":"In #3342 I proposed a cleaner solution for the median define in `rtengine/ffmanager.cc`. @heckflosse was quick to point to the other occurrences scattered across RT. An `rgrep '#define.*med[0-9]'` on current master reveals this:\r\n```\r\nrtengine/dirpyrLab_denoise.cc:#define med3(a,b,c) (a<b ? (b<c ? b : (a<c ? c : a)) : (a<c ? a : (b<c ? c : b)))\r\nrtengine/dirpyrLab_denoise.cc:#define med3x3(a0,a1,a2,a3,a4,a5,a6,a7,a8,median) { \\\r\nrtengine/ipwavelet.cc:#define med3(a0,a1,a2,a3,a4,a5,a6,a7,a8,median) { \\\r\nrtengine/ipwavelet.cc:#define med2(a0,a1,a2,a3,a4,median) { \\\r\nrtengine/ipretinex.cc:#define med3(a0,a1,a2,a3,a4,a5,a6,a7,a8,median) { \\\r\nrtengine/improcfun.h:#define med3(a0,a1,a2,a3,a4,a5,a6,a7,a8,median) { \\\r\nrtengine/rawimagesource.cc:#define med3x3(a0,a1,a2,a3,a4,a5,a6,a7,a8,median) { \\\r\nrtengine/rawimagesource.cc:#define med5(a0,a1,a2,a3,a4,median) { \\\r\nrtengine/FTblockDN.cc:#define med2(a0,a1,a2,a3,a4,median) { \\\r\nrtengine/FTblockDN.cc:#define med5(a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,median) { \\\r\n```\r\n\r\nThe naming should be changed to correspond to the number of inputs, so `med2` becomes `med4` and `med5` becomes `med25` for example.\r\n\r\nFurthermore, at least `med25` could benefit from [`std::nth_element()`](http://en.cppreference.com/w/cpp/algorithm/nth_element).\r\n\r\nI'm thinking about providing templates like the one in #3342 and additionally (a) version(s) that take(s) a `std::array<T, N>`."},"comment":{"url":"https://api.github.com/repos/Beep6581/RawTherapee/issues/comments/229812015","html_url":"https://github.com/Beep6581/RawTherapee/issues/3346#issuecomment-229812015","issue_url":"https://api.github.com/repos/Beep6581/RawTherapee/issues/3346","id":229812015,"user":{"login":"heckflosse","id":13733487,"avatar_url":"https://avatars.githubusercontent.com/u/13733487?v=3","gravatar_id":"","url":"https://api.github.com/users/heckflosse","html_url":"https://github.com/heckflosse","followers_url":"https://api.github.com/users/heckflosse/followers","following_url":"https://api.github.com/users/heckflosse/following{/other_user}","gists_url":"https://api.github.com/users/heckflosse/gists{/gist_id}","starred_url":"https://api.github.com/users/heckflosse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heckflosse/subscriptions","organizations_url":"https://api.github.com/users/heckflosse/orgs","repos_url":"https://api.github.com/users/heckflosse/repos","events_url":"https://api.github.com/users/heckflosse/events{/privacy}","received_events_url":"https://api.github.com/users/heckflosse/received_events","type":"User","site_admin":false},"created_at":"2016-06-30T22:58:10Z","updated_at":"2016-06-30T22:58:10Z","body":"@Floessie After looking at the amount of work you did (especially for median49 and median81) I really have to take my hat off to you :+1: "}}
{"actor":{"display_login":"heckflosse"}}