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_IMAGE_IMAGE_UTIL_H_ | 5 #ifndef UI_GFX_IMAGE_IMAGE_UTIL_H_ |
6 #define UI_GFX_IMAGE_IMAGE_UTIL_H_ | 6 #define UI_GFX_IMAGE_IMAGE_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "ui/ui_api.h" |
12 | 13 |
13 namespace gfx { | 14 namespace gfx { |
14 class Image; | 15 class Image; |
15 } | 16 } |
16 | 17 |
17 namespace gfx { | 18 namespace gfx { |
18 | 19 |
19 // Creates an image from the given PNG-encoded input. The caller owns the | 20 // Creates an image from the given PNG-encoded input. The caller owns the |
20 // returned Image. If there was an error creating the image, returns NULL. | 21 // returned Image. If there was an error creating the image, returns NULL. |
21 Image* ImageFromPNGEncodedData(const unsigned char* input, size_t input_size); | 22 UI_API Image* ImageFromPNGEncodedData(const unsigned char* input, |
| 23 size_t input_size); |
22 | 24 |
23 // Fills the |dst| vector with PNG-encoded bytes based on the given Image. | 25 // Fills the |dst| vector with PNG-encoded bytes based on the given Image. |
24 // Returns true if the Image was encoded successfully. | 26 // Returns true if the Image was encoded successfully. |
25 bool PNGEncodedDataFromImage(const Image& image, | 27 UI_API bool PNGEncodedDataFromImage(const Image& image, |
26 std::vector<unsigned char>* dst); | 28 std::vector<unsigned char>* dst); |
27 | 29 |
28 } | 30 } |
29 | 31 |
30 #endif // UI_GFX_IMAGE_IMAGE_UTIL_H_ | 32 #endif // UI_GFX_IMAGE_IMAGE_UTIL_H_ |
OLD | NEW |