Chromium Code Reviews| 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 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 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_EXPORT 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_EXPORT 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 // |quality| determines the compression level, 0 == lowest, 100 == highest. | |
| 31 // Returns true if the Image was encoded successfully. | 32 // Returns true if the Image was encoded successfully. |
| 32 UI_EXPORT bool JPEGEncodedDataFromImage(const Image& image, | 33 UI_EXPORT bool JPEGEncodedDataFromImage(const Image& image, int quality, |
|
sky
2011/11/28 15:44:37
nit: each param on its own line.
csilv
2011/11/28 18:04:41
Done.
| |
| 33 std::vector<unsigned char>* dst); | 34 std::vector<unsigned char>* dst); |
| 34 | 35 |
| 35 } | 36 } |
| 36 | 37 |
| 37 #endif // UI_GFX_IMAGE_IMAGE_UTIL_H_ | 38 #endif // UI_GFX_IMAGE_IMAGE_UTIL_H_ |
| OLD | NEW |