blob: 0447fc4c046eecd8061ca7689db667fab5a435cd [file] [log] [blame]
Mike Klein735c7ba2019-03-25 12:57:58 -05001// 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 Kleinc0bd9f92019-04-23 12:05:21 -05006#include "include/core/SkBitmap.h"
7#include "include/core/SkStream.h"
8#include "tools/flags/CommandLineFlags.h"
Mike Klein735c7ba2019-03-25 12:57:58 -05009
10class HashAndEncode {
11public:
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
21private:
22 const SkISize fSize;
23 std::unique_ptr<uint64_t[]> fPixels;
24};
25