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