Debian Codegraph @

src/ports/SkNDKConversions.h

raw
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 SkNDKConversions_DEFINED
9 #define SkNDKConversions_DEFINED
10
11 #include "include/core/SkColorSpace.h"
12 #include "include/core/SkImageInfo.h"
13
14 #include <android/bitmap.h>
15 #include <android/data_space.h>
16
17 namespace SkNDKConversions {
18 // Supports a small subset of SkColorType. Others are treated as
19 // ANDROID_BITMAP_FORMAT_NONE.
20 AndroidBitmapFormat toAndroidBitmapFormat(SkColorType);
21
22 uint32_t toAndroidBitmapAlphaFlags(SkAlphaType);
23
24 SkColorType toColorType(AndroidBitmapFormat);
25
26 // Treats null as ADATASPACE_SRGB.
27 ADataSpace toDataSpace(SkColorSpace*);
28
29 // Treats ADATASPACE_UNKNOWN as nullptr.
30 sk_sp<SkColorSpace> toColorSpace(ADataSpace);
31 }
32
33 #endif // SkNDKConversions_DEFINED