Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
EncodeUtils.h
Go to the documentation of this file.
1/*
2 * Copyright 2023 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef EncodeUtils_DEFINED
9#define EncodeUtils_DEFINED
10
11class SkBitmap;
12class SkPixmap;
13class SkString;
14
15namespace ToolUtils {
16
17// Encodes the bitmap into a data:/image/png;base64,... url suitable to view in a browser after
18// printing to a log. If false is returned, dst holds an error message instead of a URI.
20
21bool EncodeImageToPngFile(const char* path, const SkBitmap& src);
22bool EncodeImageToPngFile(const char* path, const SkPixmap& src);
23
24} // namespace ToolUtils
25
26#endif
bool EncodeImageToPngFile(const char *path, const SkBitmap &src)
bool BitmapToBase64DataURI(const SkBitmap &bitmap, SkString *dst)