OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
9 #include "ui/gfx/color_utils.h" | 9 #include "ui/gfx/color_utils.h" |
10 #include "ui/gfx/gfx_export.h" | 10 #include "ui/gfx/gfx_export.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 ROTATION_90_CW, | 25 ROTATION_90_CW, |
26 ROTATION_180_CW, | 26 ROTATION_180_CW, |
27 ROTATION_270_CW, | 27 ROTATION_270_CW, |
28 }; | 28 }; |
29 | 29 |
30 // Create a bitmap that is an inverted image of the passed in image. | 30 // Create a bitmap that is an inverted image of the passed in image. |
31 // Each color becomes its inverse in the color wheel. So (255, 15, 0) becomes | 31 // Each color becomes its inverse in the color wheel. So (255, 15, 0) becomes |
32 // (0, 240, 255). The alpha value is not inverted. | 32 // (0, 240, 255). The alpha value is not inverted. |
33 static SkBitmap CreateInvertedBitmap(const SkBitmap& image); | 33 static SkBitmap CreateInvertedBitmap(const SkBitmap& image); |
34 | 34 |
35 // Create a bitmap that is a superimposition of the second bitmap on top of | |
36 // the first. The provided bitmaps must use have the kARGB_8888_Config config | |
37 // and be of equal dimensions. | |
38 static SkBitmap CreateSuperimposedBitmap(const SkBitmap& first, | |
39 const SkBitmap& second); | |
40 | |
41 // Create a bitmap that is a blend of two others. The alpha argument | 35 // Create a bitmap that is a blend of two others. The alpha argument |
42 // specifies the opacity of the second bitmap. The provided bitmaps must | 36 // specifies the opacity of the second bitmap. The provided bitmaps must |
43 // use have the kARGB_8888_Config config and be of equal dimensions. | 37 // use have the kARGB_8888_Config config and be of equal dimensions. |
44 static SkBitmap CreateBlendedBitmap(const SkBitmap& first, | 38 static SkBitmap CreateBlendedBitmap(const SkBitmap& first, |
45 const SkBitmap& second, | 39 const SkBitmap& second, |
46 double alpha); | 40 double alpha); |
47 | 41 |
48 // Create a bitmap that is the original bitmap masked out by the mask defined | 42 // Create a bitmap that is the original bitmap masked out by the mask defined |
49 // in the alpha bitmap. The images must use the kARGB_8888_Config config and | 43 // in the alpha bitmap. The images must use the kARGB_8888_Config config and |
50 // be of equal dimensions. | 44 // be of equal dimensions. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 static SkBitmap Rotate(const SkBitmap& source, RotationAmount rotation); | 115 static SkBitmap Rotate(const SkBitmap& source, RotationAmount rotation); |
122 | 116 |
123 private: | 117 private: |
124 SkBitmapOperations(); // Class for scoping only. | 118 SkBitmapOperations(); // Class for scoping only. |
125 | 119 |
126 FRIEND_TEST_ALL_PREFIXES(SkBitmapOperationsTest, DownsampleByTwo); | 120 FRIEND_TEST_ALL_PREFIXES(SkBitmapOperationsTest, DownsampleByTwo); |
127 FRIEND_TEST_ALL_PREFIXES(SkBitmapOperationsTest, DownsampleByTwoSmall); | 121 FRIEND_TEST_ALL_PREFIXES(SkBitmapOperationsTest, DownsampleByTwoSmall); |
128 }; | 122 }; |
129 | 123 |
130 #endif // UI_GFX_SKBITMAP_OPERATIONS_H_ | 124 #endif // UI_GFX_SKBITMAP_OPERATIONS_H_ |
OLD | NEW |