OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_THUMBNAILS_CONTENT_ANALYSIS_H_ | 5 #ifndef CHROME_BROWSER_THUMBNAILS_CONTENT_ANALYSIS_H_ |
6 #define CHROME_BROWSER_THUMBNAILS_CONTENT_ANALYSIS_H_ | 6 #define CHROME_BROWSER_THUMBNAILS_CONTENT_ANALYSIS_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "third_party/skia/include/core/SkColor.h" | 11 #include "third_party/skia/include/core/SkColor.h" |
12 #include "ui/gfx/geometry/rect.h" | 12 #include "ui/gfx/geometry/rect.h" |
13 #include "ui/gfx/size.h" | 13 #include "ui/gfx/geometry/size.h" |
14 | 14 |
15 class SkBitmap; | 15 class SkBitmap; |
16 | 16 |
17 namespace thumbnailing_utils { | 17 namespace thumbnailing_utils { |
18 | 18 |
19 // Compute in-place gaussian gradient magnitude of |input_bitmap| with sigma | 19 // Compute in-place gaussian gradient magnitude of |input_bitmap| with sigma |
20 // |kernel_sigma|. |input_bitmap| is requried to be of SkBitmap::kA8_Config | 20 // |kernel_sigma|. |input_bitmap| is requried to be of SkBitmap::kA8_Config |
21 // type. The routine computes first-order gaussian derivative on a | 21 // type. The routine computes first-order gaussian derivative on a |
22 // gaussian-smoothed image. Beware, this is fairly slow since kernel size is | 22 // gaussian-smoothed image. Beware, this is fairly slow since kernel size is |
23 // 4 * kernel_sigma + 1. | 23 // 4 * kernel_sigma + 1. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // |kernel_sigma| defines the degree of image smoothing in gradient computation. | 76 // |kernel_sigma| defines the degree of image smoothing in gradient computation. |
77 // For a natural-sized (not shrunk) screenshot at 96 DPI and regular font size | 77 // For a natural-sized (not shrunk) screenshot at 96 DPI and regular font size |
78 // 5.0 was determined to be a good value. | 78 // 5.0 was determined to be a good value. |
79 SkBitmap CreateRetargetedThumbnailImage(const SkBitmap& source_bitmap, | 79 SkBitmap CreateRetargetedThumbnailImage(const SkBitmap& source_bitmap, |
80 const gfx::Size& target_size, | 80 const gfx::Size& target_size, |
81 float kernel_sigma); | 81 float kernel_sigma); |
82 | 82 |
83 } // namespace thumbnailing_utils | 83 } // namespace thumbnailing_utils |
84 | 84 |
85 #endif // CHROME_BROWSER_THUMBNAILS_CONTENT_ANALYSIS_H_ | 85 #endif // CHROME_BROWSER_THUMBNAILS_CONTENT_ANALYSIS_H_ |
OLD | NEW |