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
17namespace SkNDKConversions {
18    // Supports a small subset of SkColorType. Others are treated as
19    // ANDROID_BITMAP_FORMAT_NONE.
20    AndroidBitmapFormat toAndroidBitmapFormat(SkColorType);
21
22    SkColorType toColorType(AndroidBitmapFormat);
23
24    // Treats null as ADATASPACE_SRGB.
25    ADataSpace toDataSpace(SkColorSpace*);
26
27    // Treats ADATASPACE_UNKNOWN as nullptr.
28    sk_sp<SkColorSpace> toColorSpace(ADataSpace);
29}
30
31#endif // SkNDKConversions_DEFINED
32