Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(468)

Issue 289283004: Add ability to constrain dominant color selection to a HSL range. (Closed)

Created:
6 years, 7 months ago by calamity
Modified:
6 years, 6 months ago
CC:
chromium-reviews, dbeam+watch-ntp_chromium.org, extensions-reviews_chromium.org, chrome-apps-syd-reviews_chromium.org, tfarina, estade+watch_chromium.org, chromium-apps-reviews_chromium.org, pedrosimonetti+watch_chromium.org, James Cook, David Trainor- moved to gerrit
Visibility:
Public.

Description

Add ability to constrain dominant color selection to a HSL range. This CL adds the ability to supply CalculateKMeanColorOfPNG with a lower and upper HSL bound which will be used to select the dominant color. This CL also adds CalculateKMeanColorOfPNG with only a PNG param as a convenience method, using sane defaults and a utility function IsWithinHSLRange for checking whether a given HSL is within the given HSL range. BUG=376613 TBR=benwells@chromium.org, estade@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=274500

Patch Set 1 : #

Patch Set 2 : make bounds inclusive, add saturation test #

Total comments: 18

Patch Set 3 : rebase onto 291653004 #

Patch Set 4 : address comments #

Total comments: 4

Patch Set 5 : rebase, fix nits #

Total comments: 1

Patch Set 6 : rebase #

Total comments: 14

Patch Set 7 : rebase #

Patch Set 8 : rebase onto 309773002 #

Patch Set 9 : fix DCHECKS #

Total comments: 2

Patch Set 10 : fix nit #

Patch Set 11 : remove C++11 features #

Unified diffs Side-by-side diffs Delta from patch set Stats (+185 lines, -59 lines) Patch
M chrome/browser/extensions/bookmark_app_helper.cc View 1 2 3 4 5 6 1 chunk +2 lines, -6 lines 0 comments Download
M chrome/browser/ui/webui/ntp/favicon_webui_handler.cc View 1 chunk +1 line, -2 lines 0 comments Download
M ui/gfx/color_analysis.h View 1 2 3 4 5 3 chunks +16 lines, -18 lines 0 comments Download
M ui/gfx/color_analysis.cc View 1 2 3 4 5 6 7 8 chunks +25 lines, -26 lines 0 comments Download
M ui/gfx/color_analysis_unittest.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +65 lines, -6 lines 0 comments Download
M ui/gfx/color_utils.h View 1 2 3 1 chunk +14 lines, -0 lines 0 comments Download
M ui/gfx/color_utils.cc View 1 2 3 4 5 6 7 8 9 1 chunk +30 lines, -0 lines 0 comments Download
M ui/gfx/color_utils_unittest.cc View 1 2 3 4 5 6 7 2 chunks +32 lines, -1 line 0 comments Download

Messages

Total messages: 21 (0 generated)
calamity
6 years, 7 months ago (2014-05-21 01:55:40 UTC) #1
Matt Giuca
So I think you should split this into 3 CLs (as detailed in the comments): ...
6 years, 7 months ago (2014-05-22 05:03:51 UTC) #2
calamity
Precursor is up at https://codereview.chromium.org/291653004/ . https://codereview.chromium.org/289283004/diff/60001/ui/app_list/views/tile_item_view.cc File ui/app_list/views/tile_item_view.cc (right): https://codereview.chromium.org/289283004/diff/60001/ui/app_list/views/tile_item_view.cc#newcode109 ui/app_list/views/tile_item_view.cc:109: background_->set_strip_color(color_utils::CalculateKMeanColorOfPNG( On 2014/05/22 ...
6 years, 7 months ago (2014-05-22 07:36:36 UTC) #3
calamity
+asvitkine for ui/gfx OWNERS.
6 years, 7 months ago (2014-05-22 07:50:04 UTC) #4
Alexei Svitkine (slow)
Seems that this work is sufficiently non-trivial that there should be a crbug for it. ...
6 years, 7 months ago (2014-05-22 13:05:21 UTC) #5
calamity
@asvitkine: I just realized you're OWNERS of ui/gfx specifically for font rendering. Let me know ...
6 years, 7 months ago (2014-05-23 03:03:40 UTC) #6
Matt Giuca
I looked over the DCHECKs and the changes to the default values. Everything seems good. ...
6 years, 7 months ago (2014-05-23 03:33:35 UTC) #7
Matt Giuca
So I looked a bit deeper into this and did some calculations. The old system ...
6 years, 7 months ago (2014-05-23 05:00:28 UTC) #8
Alexei Svitkine (slow)
https://codereview.chromium.org/289283004/diff/180001/ui/gfx/color_analysis.cc File ui/gfx/color_analysis.cc (right): https://codereview.chromium.org/289283004/diff/180001/ui/gfx/color_analysis.cc#newcode24 ui/gfx/color_analysis.cc:24: const color_utils::HSL kDefaultLowerHSLBound = {-1, -1, 0.15}; Nit: Move ...
6 years, 6 months ago (2014-05-30 14:56:38 UTC) #9
calamity
https://codereview.chromium.org/289283004/diff/180001/ui/gfx/color_analysis.cc File ui/gfx/color_analysis.cc (right): https://codereview.chromium.org/289283004/diff/180001/ui/gfx/color_analysis.cc#newcode24 ui/gfx/color_analysis.cc:24: const color_utils::HSL kDefaultLowerHSLBound = {-1, -1, 0.15}; On 2014/05/30 ...
6 years, 6 months ago (2014-06-02 03:53:16 UTC) #10
Matt Giuca
slgtm https://codereview.chromium.org/289283004/diff/260001/ui/gfx/color_utils.cc File ui/gfx/color_utils.cc (right): https://codereview.chromium.org/289283004/diff/260001/ui/gfx/color_utils.cc#newcode162 ui/gfx/color_utils.cc:162: << "lower_bound.h:" << lower_bound.h nit: Can you put ...
6 years, 6 months ago (2014-06-02 04:12:23 UTC) #11
Alexei Svitkine (slow)
LGTM
6 years, 6 months ago (2014-06-02 15:35:06 UTC) #12
calamity
https://codereview.chromium.org/289283004/diff/260001/ui/gfx/color_utils.cc File ui/gfx/color_utils.cc (right): https://codereview.chromium.org/289283004/diff/260001/ui/gfx/color_utils.cc#newcode162 ui/gfx/color_utils.cc:162: << "lower_bound.h:" << lower_bound.h On 2014/06/02 04:12:23, Matt Giuca ...
6 years, 6 months ago (2014-06-03 02:49:50 UTC) #13
calamity
The CQ bit was checked by calamity@chromium.org
6 years, 6 months ago (2014-06-03 02:49:57 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/calamity@chromium.org/289283004/280001
6 years, 6 months ago (2014-06-03 02:51:20 UTC) #15
calamity
TBRing benwells@ for bookmark_app_helper.cc and estade@ for favicon_webui_handler.cc.
6 years, 6 months ago (2014-06-03 05:03:02 UTC) #16
calamity
The CQ bit was checked by calamity@chromium.org
6 years, 6 months ago (2014-06-03 05:03:12 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/calamity@chromium.org/289283004/300001
6 years, 6 months ago (2014-06-03 05:04:40 UTC) #18
calamity
The CQ bit was checked by calamity@chromium.org
6 years, 6 months ago (2014-06-03 05:29:50 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/calamity@chromium.org/289283004/300001
6 years, 6 months ago (2014-06-03 05:30:56 UTC) #20
commit-bot: I haz the power
6 years, 6 months ago (2014-06-03 13:15:06 UTC) #21
Message was sent while issue was closed.
Change committed as 274500

Powered by Google App Engine
This is Rietveld 408576698