Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkImageGeneratorNDK.h
Go to the documentation of this file.
1/*
2 * Copyright 2020 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 SkImageGeneratorNDK_DEFINED
9#define SkImageGeneratorNDK_DEFINED
10
12#ifdef SK_ENABLE_NDK_IMAGES
13
14#include "include/core/SkData.h"
16
17#include <memory>
18
19namespace SkImageGeneratorNDK {
20/**
21 * Create a generator that uses the Android NDK's APIs for decoding images.
22 *
23 * Only supported on devices where __ANDROID_API__ >= 30.
24 *
25 * As with SkCodec, the SkColorSpace passed to getPixels() determines the
26 * type of color space transformations to apply. A null SkColorSpace means to
27 * apply none.
28 *
29 * A note on scaling: Calling getPixels() on the resulting SkImageGenerator
30 * with dimensions that do not match getInfo() requests a scale. For WebP
31 * files, dimensions smaller than those of getInfo are supported. For Jpeg
32 * files, dimensions of 1/2, 1/4, and 1/8 are supported. TODO: Provide an
33 * API like SkCodecImageGenerator::getScaledDimensions() to report which
34 * dimensions are supported?
35 */
36SK_API std::unique_ptr<SkImageGenerator> MakeFromEncodedNDK(sk_sp<SkData>);
37}
38
39#endif // SK_ENABLE_NDK_IMAGES
40#endif // SkImageGeneratorNDK_DEFINED
#define SK_API
Definition SkAPI.h:35