• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
6 #include "include/core/SkBitmap.h"
7 #include "include/core/SkStream.h"
8 #include "tools/flags/CommandLineFlags.h"
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 
26