OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 TOOLS_IMAGEDIFF_IMAGE_DIFF_PNG_H_ | 5 #ifndef TOOLS_IMAGEDIFF_IMAGE_DIFF_PNG_H_ |
6 #define TOOLS_IMAGEDIFF_IMAGE_DIFF_PNG_H_ | 6 #define TOOLS_IMAGEDIFF_IMAGE_DIFF_PNG_H_ |
7 | 7 |
| 8 #include <stddef.h> |
| 9 |
8 #include <string> | 10 #include <string> |
9 #include <vector> | 11 #include <vector> |
10 | 12 |
11 namespace image_diff_png { | 13 namespace image_diff_png { |
12 | 14 |
13 // Decode a PNG into an RGBA pixel array. | 15 // Decode a PNG into an RGBA pixel array. |
14 bool DecodePNG(const unsigned char* input, size_t input_size, | 16 bool DecodePNG(const unsigned char* input, size_t input_size, |
15 std::vector<unsigned char>* output, | 17 std::vector<unsigned char>* output, |
16 int* width, int* height); | 18 int* width, int* height); |
17 | 19 |
18 // Encode an RGBA pixel array into a PNG. | 20 // Encode an RGBA pixel array into a PNG. |
19 bool EncodeRGBAPNG(const unsigned char* input, | 21 bool EncodeRGBAPNG(const unsigned char* input, |
20 int width, | 22 int width, |
21 int height, | 23 int height, |
22 int row_byte_width, | 24 int row_byte_width, |
23 std::vector<unsigned char>* output); | 25 std::vector<unsigned char>* output); |
24 | 26 |
25 // Encode an BGRA pixel array into a PNG. | 27 // Encode an BGRA pixel array into a PNG. |
26 bool EncodeBGRAPNG(const unsigned char* input, | 28 bool EncodeBGRAPNG(const unsigned char* input, |
27 int width, | 29 int width, |
28 int height, | 30 int height, |
29 int row_byte_width, | 31 int row_byte_width, |
30 bool discard_transparency, | 32 bool discard_transparency, |
31 std::vector<unsigned char>* output); | 33 std::vector<unsigned char>* output); |
32 | 34 |
33 } // namespace image_diff_png | 35 } // namespace image_diff_png |
34 | 36 |
35 #endif // TOOLS_IMAGEDIFF_IMAGE_DIFF_PNG_H_ | 37 #endif // TOOLS_IMAGEDIFF_IMAGE_DIFF_PNG_H_ |
OLD | NEW |