Flutter Engine
The Flutter Engine
SkImageGeneratorPriv.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 SkImageGeneratorPriv_DEFINED
9#define SkImageGeneratorPriv_DEFINED
10
11#include "include/core/SkRefCnt.h" // IWYU pragma: keep
12
13#include <memory>
14#include <optional>
15
16class SkColorSpace;
17class SkData;
19class SkMatrix;
20class SkPaint;
21class SkPicture;
22class SkSurfaceProps;
23enum SkAlphaType : int;
24namespace SkImages { enum class BitDepth; }
25struct SkISize;
26
27namespace SkImageGenerators {
28/** Return a new image generator backed by the specified picture. If the size is empty or
29 * the picture is NULL, this returns NULL.
30 * The optional matrix and paint arguments are passed to drawPicture() at rasterization
31 * time.
32 */
33std::unique_ptr<SkImageGenerator> MakeFromPicture(const SkISize&,
35 const SkMatrix*,
36 const SkPaint*,
39 SkSurfaceProps props);
40
41std::unique_ptr<SkImageGenerator> MakeFromPicture(const SkISize&,
43 const SkMatrix*,
44 const SkPaint*,
47
48/**
49 * If the default image decoder system can interpret the specified (encoded) data, then
50 * this returns a new ImageGenerator for it. Otherwise this returns NULL. Either way
51 * the caller is still responsible for managing their ownership of the data.
52 * By default, images will be converted to premultiplied pixels. The alpha type can be
53 * overridden by specifying kPremul_SkAlphaType or kUnpremul_SkAlphaType. Specifying
54 * kOpaque_SkAlphaType is not supported, and will return NULL.
55 */
56std::unique_ptr<SkImageGenerator> MakeFromEncoded(sk_sp<SkData>,
57 std::optional<SkAlphaType> = std::nullopt);
58}
59
60#endif
SkAlphaType
Definition: SkAlphaType.h:26
Definition: SkData.h:25
std::unique_ptr< SkImageGenerator > MakeFromPicture(const SkISize &, sk_sp< SkPicture >, const SkMatrix *, const SkPaint *, SkImages::BitDepth, sk_sp< SkColorSpace >, SkSurfaceProps props)
std::unique_ptr< SkImageGenerator > MakeFromEncoded(sk_sp< SkData > data, std::optional< SkAlphaType > at)
Definition: SkSize.h:16