image_diff_png.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  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
  3. // found in the LICENSE file.
  4. #ifndef TOOLS_IMAGEDIFF_IMAGE_DIFF_PNG_H_
  5. #define TOOLS_IMAGEDIFF_IMAGE_DIFF_PNG_H_
  6. #include <stddef.h>
  7. #include <string>
  8. #include <vector>
  9. namespace image_diff_png {
  10. // Decode a PNG into an RGBA pixel array.
  11. bool DecodePNG(const unsigned char* input, size_t input_size,
  12. std::vector<unsigned char>* output,
  13. int* width, int* height);
  14. // Encode an RGBA pixel array into a PNG.
  15. bool EncodeRGBAPNG(const unsigned char* input,
  16. int width,
  17. int height,
  18. int row_byte_width,
  19. std::vector<unsigned char>* output);
  20. // Encode an BGRA pixel array into a PNG.
  21. bool EncodeBGRAPNG(const unsigned char* input,
  22. int width,
  23. int height,
  24. int row_byte_width,
  25. bool discard_transparency,
  26. std::vector<unsigned char>* output);
  27. } // namespace image_diff_png
  28. #endif // TOOLS_IMAGEDIFF_IMAGE_DIFF_PNG_H_