| 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 #include "ui/base/ui_export.h" |
| 13 | 13 |
| 14 namespace gfx { | 14 namespace gfx { |
| 15 class Image; | 15 class Image; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace gfx { | 18 namespace gfx { |
| 19 | 19 |
| 20 // 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 |
| 21 // 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. |
| 22 UI_API Image* ImageFromPNGEncodedData(const unsigned char* input, | 22 UI_EXPORT Image* ImageFromPNGEncodedData(const unsigned char* input, |
| 23 size_t input_size); | 23 size_t input_size); |
| 24 | 24 |
| 25 // 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. |
| 26 // Returns true if the Image was encoded successfully. | 26 // Returns true if the Image was encoded successfully. |
| 27 UI_API bool PNGEncodedDataFromImage(const Image& image, | 27 UI_EXPORT bool PNGEncodedDataFromImage(const Image& image, |
| 28 std::vector<unsigned char>* dst); | 28 std::vector<unsigned char>* dst); |
| 29 | 29 |
| 30 // Fills the |dst| vector with JPEG-encoded bytes based on the given Image. | 30 // Fills the |dst| vector with JPEG-encoded bytes based on the given Image. |
| 31 // Returns true if the Image was encoded successfully. | 31 // Returns true if the Image was encoded successfully. |
| 32 UI_API bool JPEGEncodedDataFromImage(const Image& image, | 32 UI_EXPORT bool JPEGEncodedDataFromImage(const Image& image, |
| 33 std::vector<unsigned char>* dst); | 33 std::vector<unsigned char>* dst); |
| 34 | 34 |
| 35 } | 35 } |
| 36 | 36 |
| 37 #endif // UI_GFX_IMAGE_IMAGE_UTIL_H_ | 37 #endif // UI_GFX_IMAGE_IMAGE_UTIL_H_ |
| OLD | NEW |