From 3dd6455a54bb94c4059519fe9370ec3ecf33dc92 Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Fri, 10 Jan 2020 13:41:44 -0500 Subject: Reland "Add AndroidBitmap_getDataSpace" Originally reviewed in Ia46dfb39d0f2708ce873343ec74bcc52e7bccd3a (and reverted in Ie6c9065f515442f3ea59d3930208deffb9a3bd2a) Bug:135133301 Test: I7a5fcb726fba0c832bbb86a424d7534a7cfa35b6 This supplements AndroidBitmap_getInfo, allowing NDK clients to know how to interpret the colors in an android.graphics.Bitmap. Change-Id: If822af556ac5ee6d412bf31afb9d07de6dd777eb --- include/android/bitmap.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/android/bitmap.h') diff --git a/include/android/bitmap.h b/include/android/bitmap.h index 01cf2f88ea..41718b2904 100644 --- a/include/android/bitmap.h +++ b/include/android/bitmap.h @@ -100,6 +100,19 @@ typedef struct { int AndroidBitmap_getInfo(JNIEnv* env, jobject jbitmap, AndroidBitmapInfo* info); +#if __ANDROID_API__ >= 30 + +/** + * Given a java bitmap object, return its ADataSpace. + * + * Note that ADataSpace only exposes a few values. This may return + * ADATASPACE_UNKNOWN, even for Named ColorSpaces, if they have no + * corresponding ADataSpace. + */ +int32_t AndroidBitmap_getDataSpace(JNIEnv* env, jobject jbitmap) __INTRODUCED_IN(30); + +#endif // __ANDROID_API__ >= 30 + /** * Given a java bitmap object, attempt to lock the pixel address. * Locking will ensure that the memory for the pixels will not move -- cgit v1.2.3-59-g8ed1b