OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 UI_GFX_SKBITMAP_OPERATIONS_H_ | 5 #ifndef UI_GFX_SKBITMAP_OPERATIONS_H_ |
6 #define UI_GFX_SKBITMAP_OPERATIONS_H_ | 6 #define UI_GFX_SKBITMAP_OPERATIONS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
| 10 #include "ui/base/ui_export.h" |
10 #include "ui/gfx/color_utils.h" | 11 #include "ui/gfx/color_utils.h" |
11 #include "ui/ui_api.h" | |
12 | 12 |
13 class SkBitmap; | 13 class SkBitmap; |
14 | 14 |
15 class UI_API SkBitmapOperations { | 15 class UI_EXPORT SkBitmapOperations { |
16 public: | 16 public: |
17 // Create a bitmap that is an inverted image of the passed in image. | 17 // Create a bitmap that is an inverted image of the passed in image. |
18 // Each color becomes its inverse in the color wheel. So (255, 15, 0) becomes | 18 // Each color becomes its inverse in the color wheel. So (255, 15, 0) becomes |
19 // (0, 240, 255). The alpha value is not inverted. | 19 // (0, 240, 255). The alpha value is not inverted. |
20 static SkBitmap CreateInvertedBitmap(const SkBitmap& image); | 20 static SkBitmap CreateInvertedBitmap(const SkBitmap& image); |
21 | 21 |
22 // Create a bitmap that is a superimposition of the second bitmap on top of | 22 // Create a bitmap that is a superimposition of the second bitmap on top of |
23 // the first. The provided bitmaps must use have the kARGB_8888_Config config | 23 // the first. The provided bitmaps must use have the kARGB_8888_Config config |
24 // and be of equal dimensions. | 24 // and be of equal dimensions. |
25 static SkBitmap CreateSuperimposedBitmap(const SkBitmap& first, | 25 static SkBitmap CreateSuperimposedBitmap(const SkBitmap& first, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 static SkBitmap CreateTransposedBtmap(const SkBitmap& bitmap); | 94 static SkBitmap CreateTransposedBtmap(const SkBitmap& bitmap); |
95 | 95 |
96 private: | 96 private: |
97 SkBitmapOperations(); // Class for scoping only. | 97 SkBitmapOperations(); // Class for scoping only. |
98 | 98 |
99 FRIEND_TEST_ALL_PREFIXES(SkBitmapOperationsTest, DownsampleByTwo); | 99 FRIEND_TEST_ALL_PREFIXES(SkBitmapOperationsTest, DownsampleByTwo); |
100 FRIEND_TEST_ALL_PREFIXES(SkBitmapOperationsTest, DownsampleByTwoSmall); | 100 FRIEND_TEST_ALL_PREFIXES(SkBitmapOperationsTest, DownsampleByTwoSmall); |
101 }; | 101 }; |
102 | 102 |
103 #endif // UI_GFX_SKBITMAP_OPERATIONS_H_ | 103 #endif // UI_GFX_SKBITMAP_OPERATIONS_H_ |
OLD | NEW |