{"action":"created","comment":{"url":"https://api.github.com/repos/mapsme/omim/pulls/comments/77302667","id":77302667,"diff_hunk":"@@ -0,0 +1,127 @@\n+#include \"map/generate_chart.hpp\"\n+\n+//#include \"coding/png_memory_encoder.hpp\"\n+\n+#include \"base/assert.hpp\"\n+\n+#include \"std/fstream.hpp\"\n+\n+#include \"3party/agg/agg_conv_stroke.h\"\n+#include \"3party/agg/agg_path_storage.h\"\n+#include \"3party/agg/agg_pixfmt_rgba.h\"\n+#include \"3party/agg/agg_rasterizer_scanline_aa.h\"\n+#include \"3party/agg/agg_renderer_primitives.h\"\n+#include \"3party/agg/agg_renderer_scanline.h\"\n+#include \"3party/agg/agg_scanline_p.h\"\n+\n+namespace\n+{\n+template <class TColor, class TOrder>\n+struct TBlendAdaptor\n+{\n+  using order_type = TOrder;\n+  using color_type = TColor;\n+  using TValueType = typename color_type::value_type;\n+  using TCalcType = typename color_type::calc_type;\n+\n+  enum EBaseScale\n+  {\n+    SCALE_SHIFT = color_type::base_shift,\n+    SCALE_MASK = color_type::base_mask,\n+  };\n+\n+  static AGG_INLINE void blend_pix(unsigned op, TValueType * p, unsigned cr, unsigned cg,\n+                                   unsigned cb, unsigned ca, unsigned cover)\n+  {\n+    using TBlendTable = agg::comp_op_table_rgba<TColor, TOrder>;\n+    if (p[TOrder::A])\n+    {\n+      TBlendTable::g_comp_op_func[op](p, (cr * ca + SCALE_MASK) >> SCALE_SHIFT, (cg * ca + SCALE_MASK) >> SCALE_SHIFT,\n+                                      (cb * ca + SCALE_MASK) >> SCALE_SHIFT, ca, cover);\n+    }\n+    else\n+    {\n+      TBlendTable::g_comp_op_func[op](p, cr, cg, cb, ca, cover);\n+    }\n+  }\n+};\n+}  // namespace\n+\n+bool GenerateChart(size_t width, size_t height, vector<m2::PointD> const & geometry,\n+                   vector<uint8_t> & frameBuffer)\n+{\n+  agg::rgba8 const kBackgroundColor(255, 255, 255, 255);\n+  agg::rgba8 const kLineColor(0, 100, 100, 255);\n+  double constexpr kLineWidth = 2;\n+  uint32_t constexpr kBPP = 4;\n+\n+  if (width == 0 || height == 0 || geometry.empty())\n+  {\n+    ASSERT(false, ());","path":"map/generate_chart.cpp","position":60,"original_position":60,"commit_id":"9c3fe719208fe398ef05b5fdd6ff66326de638fa","original_commit_id":"9c3fe719208fe398ef05b5fdd6ff66326de638fa","user":{"login":"bykoianko","id":1768114,"avatar_url":"https://avatars.githubusercontent.com/u/1768114?v=3","gravatar_id":"","url":"https://api.github.com/users/bykoianko","html_url":"https://github.com/bykoianko","followers_url":"https://api.github.com/users/bykoianko/followers","following_url":"https://api.github.com/users/bykoianko/following{/other_user}","gists_url":"https://api.github.com/users/bykoianko/gists{/gist_id}","starred_url":"https://api.github.com/users/bykoianko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bykoianko/subscriptions","organizations_url":"https://api.github.com/users/bykoianko/orgs","repos_url":"https://api.github.com/users/bykoianko/repos","events_url":"https://api.github.com/users/bykoianko/events{/privacy}","received_events_url":"https://api.github.com/users/bykoianko/received_events","type":"User","site_admin":false},"body":"Although, I removed these ASSERTs","created_at":"2016-09-02T07:12:07Z","updated_at":"2016-09-02T07:12:07Z","html_url":"https://github.com/mapsme/omim/pull/4193#discussion_r77302667","pull_request_url":"https://api.github.com/repos/mapsme/omim/pulls/4193","_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments/77302667"},"html":{"href":"https://github.com/mapsme/omim/pull/4193#discussion_r77302667"},"pull_request":{"href":"https://api.github.com/repos/mapsme/omim/pulls/4193"}}},"pull_request":{"url":"https://api.github.com/repos/mapsme/omim/pulls/4193","id":83643139,"html_url":"https://github.com/mapsme/omim/pull/4193","diff_url":"https://github.com/mapsme/omim/pull/4193.diff","patch_url":"https://github.com/mapsme/omim/pull/4193.patch","issue_url":"https://api.github.com/repos/mapsme/omim/issues/4193","number":4193,"state":"open","locked":false,"title":"[DNM] Generating route altitude chart image.","user":{"login":"bykoianko","id":1768114,"avatar_url":"https://avatars.githubusercontent.com/u/1768114?v=3","gravatar_id":"","url":"https://api.github.com/users/bykoianko","html_url":"https://github.com/bykoianko","followers_url":"https://api.github.com/users/bykoianko/followers","following_url":"https://api.github.com/users/bykoianko/following{/other_user}","gists_url":"https://api.github.com/users/bykoianko/gists{/gist_id}","starred_url":"https://api.github.com/users/bykoianko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bykoianko/subscriptions","organizations_url":"https://api.github.com/users/bykoianko/orgs","repos_url":"https://api.github.com/users/bykoianko/repos","events_url":"https://api.github.com/users/bykoianko/events{/privacy}","received_events_url":"https://api.github.com/users/bykoianko/received_events","type":"User","site_admin":false},"body":"Генерация диаграммы изменения высоты маршрута. В ядре. agg. \r\nPR пока дорабатывается, но уже можно пользоваться и подключать в клиенте.\r\n\r\n@syershov @rokuz PTAL\r\nА так же @igrechuhin ","created_at":"2016-09-01T14:28:28Z","updated_at":"2016-09-02T07:12:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f0fcf5736b4278124acecbde465bddfbb9beea4e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mapsme/omim/pulls/4193/commits","review_comments_url":"https://api.github.com/repos/mapsme/omim/pulls/4193/comments","review_comment_url":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapsme/omim/issues/4193/comments","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/9c3fe719208fe398ef05b5fdd6ff66326de638fa","head":{"label":"bykoianko:master-generating-route-altitude-chart-image","ref":"master-generating-route-altitude-chart-image","sha":"9c3fe719208fe398ef05b5fdd6ff66326de638fa","user":{"login":"bykoianko","id":1768114,"avatar_url":"https://avatars.githubusercontent.com/u/1768114?v=3","gravatar_id":"","url":"https://api.github.com/users/bykoianko","html_url":"https://github.com/bykoianko","followers_url":"https://api.github.com/users/bykoianko/followers","following_url":"https://api.github.com/users/bykoianko/following{/other_user}","gists_url":"https://api.github.com/users/bykoianko/gists{/gist_id}","starred_url":"https://api.github.com/users/bykoianko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bykoianko/subscriptions","organizations_url":"https://api.github.com/users/bykoianko/orgs","repos_url":"https://api.github.com/users/bykoianko/repos","events_url":"https://api.github.com/users/bykoianko/events{/privacy}","received_events_url":"https://api.github.com/users/bykoianko/received_events","type":"User","site_admin":false},"repo":{"id":43428862,"name":"omim","full_name":"bykoianko/omim","owner":{"login":"bykoianko","id":1768114,"avatar_url":"https://avatars.githubusercontent.com/u/1768114?v=3","gravatar_id":"","url":"https://api.github.com/users/bykoianko","html_url":"https://github.com/bykoianko","followers_url":"https://api.github.com/users/bykoianko/followers","following_url":"https://api.github.com/users/bykoianko/following{/other_user}","gists_url":"https://api.github.com/users/bykoianko/gists{/gist_id}","starred_url":"https://api.github.com/users/bykoianko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bykoianko/subscriptions","organizations_url":"https://api.github.com/users/bykoianko/orgs","repos_url":"https://api.github.com/users/bykoianko/repos","events_url":"https://api.github.com/users/bykoianko/events{/privacy}","received_events_url":"https://api.github.com/users/bykoianko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bykoianko/omim","description":"MAPS.ME - Offline OpenStreetMap maps for iOS/Android/Mac/Linux/Windows","fork":true,"url":"https://api.github.com/repos/bykoianko/omim","forks_url":"https://api.github.com/repos/bykoianko/omim/forks","keys_url":"https://api.github.com/repos/bykoianko/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bykoianko/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bykoianko/omim/teams","hooks_url":"https://api.github.com/repos/bykoianko/omim/hooks","issue_events_url":"https://api.github.com/repos/bykoianko/omim/issues/events{/number}","events_url":"https://api.github.com/repos/bykoianko/omim/events","assignees_url":"https://api.github.com/repos/bykoianko/omim/assignees{/user}","branches_url":"https://api.github.com/repos/bykoianko/omim/branches{/branch}","tags_url":"https://api.github.com/repos/bykoianko/omim/tags","blobs_url":"https://api.github.com/repos/bykoianko/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bykoianko/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bykoianko/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/bykoianko/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bykoianko/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/bykoianko/omim/languages","stargazers_url":"https://api.github.com/repos/bykoianko/omim/stargazers","contributors_url":"https://api.github.com/repos/bykoianko/omim/contributors","subscribers_url":"https://api.github.com/repos/bykoianko/omim/subscribers","subscription_url":"https://api.github.com/repos/bykoianko/omim/subscription","commits_url":"https://api.github.com/repos/bykoianko/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/bykoianko/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/bykoianko/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/bykoianko/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/bykoianko/omim/contents/{+path}","compare_url":"https://api.github.com/repos/bykoianko/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bykoianko/omim/merges","archive_url":"https://api.github.com/repos/bykoianko/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bykoianko/omim/downloads","issues_url":"https://api.github.com/repos/bykoianko/omim/issues{/number}","pulls_url":"https://api.github.com/repos/bykoianko/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/bykoianko/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/bykoianko/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bykoianko/omim/labels{/name}","releases_url":"https://api.github.com/repos/bykoianko/omim/releases{/id}","deployments_url":"https://api.github.com/repos/bykoianko/omim/deployments","created_at":"2015-09-30T11:21:20Z","updated_at":"2016-03-24T12:55:17Z","pushed_at":"2016-09-01T14:32:52Z","git_url":"git://github.com/bykoianko/omim.git","ssh_url":"git@github.com:bykoianko/omim.git","clone_url":"https://github.com/bykoianko/omim.git","svn_url":"https://github.com/bykoianko/omim","homepage":null,"size":2635531,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mapsme:master","ref":"master","sha":"a43c309fc7adfbd853133debc712a86be3d149f9","user":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"repo":{"id":42798033,"name":"omim","full_name":"mapsme/omim","owner":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapsme/omim","description":"MAPS.ME - Offline OpenStreetMap maps for iOS/Android/Mac/Linux/Windows","fork":false,"url":"https://api.github.com/repos/mapsme/omim","forks_url":"https://api.github.com/repos/mapsme/omim/forks","keys_url":"https://api.github.com/repos/mapsme/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapsme/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapsme/omim/teams","hooks_url":"https://api.github.com/repos/mapsme/omim/hooks","issue_events_url":"https://api.github.com/repos/mapsme/omim/issues/events{/number}","events_url":"https://api.github.com/repos/mapsme/omim/events","assignees_url":"https://api.github.com/repos/mapsme/omim/assignees{/user}","branches_url":"https://api.github.com/repos/mapsme/omim/branches{/branch}","tags_url":"https://api.github.com/repos/mapsme/omim/tags","blobs_url":"https://api.github.com/repos/mapsme/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapsme/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapsme/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapsme/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/mapsme/omim/languages","stargazers_url":"https://api.github.com/repos/mapsme/omim/stargazers","contributors_url":"https://api.github.com/repos/mapsme/omim/contributors","subscribers_url":"https://api.github.com/repos/mapsme/omim/subscribers","subscription_url":"https://api.github.com/repos/mapsme/omim/subscription","commits_url":"https://api.github.com/repos/mapsme/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapsme/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapsme/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapsme/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapsme/omim/contents/{+path}","compare_url":"https://api.github.com/repos/mapsme/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapsme/omim/merges","archive_url":"https://api.github.com/repos/mapsme/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapsme/omim/downloads","issues_url":"https://api.github.com/repos/mapsme/omim/issues{/number}","pulls_url":"https://api.github.com/repos/mapsme/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/mapsme/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/mapsme/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapsme/omim/labels{/name}","releases_url":"https://api.github.com/repos/mapsme/omim/releases{/id}","deployments_url":"https://api.github.com/repos/mapsme/omim/deployments","created_at":"2015-09-20T02:57:13Z","updated_at":"2016-09-02T01:10:33Z","pushed_at":"2016-09-01T18:38:04Z","git_url":"git://github.com/mapsme/omim.git","ssh_url":"git@github.com:mapsme/omim.git","clone_url":"https://github.com/mapsme/omim.git","svn_url":"https://github.com/mapsme/omim","homepage":null,"size":2747959,"stargazers_count":1955,"watchers_count":1955,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":343,"mirror_url":null,"open_issues_count":275,"forks":343,"open_issues":275,"watchers":1955,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/4193"},"html":{"href":"https://github.com/mapsme/omim/pull/4193"},"issue":{"href":"https://api.github.com/repos/mapsme/omim/issues/4193"},"comments":{"href":"https://api.github.com/repos/mapsme/omim/issues/4193/comments"},"review_comments":{"href":"https://api.github.com/repos/mapsme/omim/pulls/4193/comments"},"review_comment":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapsme/omim/pulls/4193/commits"},"statuses":{"href":"https://api.github.com/repos/mapsme/omim/statuses/9c3fe719208fe398ef05b5fdd6ff66326de638fa"}}}}
{"actor":{"display_login":"bykoianko"}}