summaryrefslogtreecommitdiff
path: root/include/android/bitmap.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/android/bitmap.h')
-rw-r--r--include/android/bitmap.h22
1 files changed, 8 insertions, 14 deletions
diff --git a/include/android/bitmap.h b/include/android/bitmap.h
index 6704a1ddf2..2631b144af 100644
--- a/include/android/bitmap.h
+++ b/include/android/bitmap.h
@@ -28,13 +28,8 @@
#include <stdbool.h>
#include <stdint.h>
-#include <stddef.h>
#include <jni.h>
-#if !defined(__INTRODUCED_IN)
-#define __INTRODUCED_IN(__api_level) /* nothing */
-#endif
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -122,17 +117,19 @@ typedef struct {
int AndroidBitmap_getInfo(JNIEnv* env, jobject jbitmap,
AndroidBitmapInfo* info);
+#if __ANDROID_API__ >= 30
+
/**
* Given a java bitmap object, return its {@link ADataSpace}.
*
* Note that {@link ADataSpace} only exposes a few values. This may return
* {@link ADATASPACE_UNKNOWN}, even for Named ColorSpaces, if they have no
* corresponding ADataSpace.
- *
- * Available since API level 30.
*/
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
@@ -153,6 +150,8 @@ int AndroidBitmap_lockPixels(JNIEnv* env, jobject jbitmap, void** addrPtr);
*/
int AndroidBitmap_unlockPixels(JNIEnv* env, jobject jbitmap);
+#if __ANDROID_API__ >= 30
+
// Note: these values match android.graphics.Bitmap#compressFormat.
/**
@@ -190,8 +189,6 @@ enum AndroidBitmapCompressFormat {
/**
* User-defined function for writing the output of compression.
*
- * Available since API level 30.
- *
* @param userContext Pointer to user-defined data passed to
* {@link AndroidBitmap_compress}.
* @param data Compressed data of |size| bytes to write.
@@ -205,8 +202,6 @@ typedef bool (*AndroidBitmap_CompressWriteFunc)(void* userContext,
/**
* Compress |pixels| as described by |info|.
*
- * Available since API level 30.
- *
* @param info Description of the pixels to compress.
* @param dataspace {@link ADataSpace} describing the color space of the
* pixels.
@@ -239,9 +234,6 @@ typedef struct AHardwareBuffer AHardwareBuffer;
*
* Client must not modify it while a Bitmap is wrapping it.
*
- * Available since API level 30.
- *
- * @param env Handle to the JNI environment pointer.
* @param bitmap Handle to an android.graphics.Bitmap.
* @param outBuffer On success, is set to a pointer to the
* {@link AHardwareBuffer} associated with bitmap. This acquires
@@ -254,6 +246,8 @@ typedef struct AHardwareBuffer AHardwareBuffer;
int AndroidBitmap_getHardwareBuffer(JNIEnv* env, jobject bitmap,
AHardwareBuffer** outBuffer) __INTRODUCED_IN(30);
+#endif // __ANDROID_API__ >= 30
+
#ifdef __cplusplus
}
#endif