HashAndEncode.h 663 B

12345678910111213141516171819202122232425
  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
  3. #pragma once
  4. #include "include/core/SkBitmap.h"
  5. #include "include/core/SkStream.h"
  6. #include "tools/flags/CommandLineFlags.h"
  7. class HashAndEncode {
  8. public:
  9. explicit HashAndEncode(const SkBitmap&);
  10. void write(SkWStream*) const;
  11. bool writePngTo(const char* path,
  12. const char* md5,
  13. CommandLineFlags::StringArray key,
  14. CommandLineFlags::StringArray properties) const;
  15. private:
  16. const SkISize fSize;
  17. std::unique_ptr<uint64_t[]> fPixels;
  18. };