Mike Klein | 735c7ba | 2019-03-25 12:57:58 -0500 | [diff] [blame] | 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 | |
| 4 | #pragma once |
| 5 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 6 | #include "include/core/SkBitmap.h" |
| 7 | #include "include/core/SkStream.h" |
| 8 | #include "tools/flags/CommandLineFlags.h" |
Mike Klein | 735c7ba | 2019-03-25 12:57:58 -0500 | [diff] [blame] | 9 | |
| 10 | class HashAndEncode { |
| 11 | public: |
| 12 | explicit HashAndEncode(const SkBitmap&); |
| 13 | |
| 14 | void write(SkWStream*) const; |
| 15 | |
| 16 | bool writePngTo(const char* path, |
| 17 | const char* md5, |
| 18 | CommandLineFlags::StringArray key, |
| 19 | CommandLineFlags::StringArray properties) const; |
| 20 | |
| 21 | private: |
| 22 | const SkISize fSize; |
| 23 | std::unique_ptr<uint64_t[]> fPixels; |
| 24 | }; |
| 25 | |