summaryrefslogtreecommitdiff
path: root/include/android/imagedecoder.h
diff options
context:
space:
mode:
author Leon Scroggins III <scroggo@google.com> 2020-12-29 11:52:12 -0500
committer Leon Scroggins III <scroggo@google.com> 2021-01-05 12:37:22 -0500
commit3b3700edf4cd5d1eab7cf3de2cd332b2f903258e (patch)
treebdf2c4558541d865e5e9d28ccff2743e378da332 /include/android/imagedecoder.h
parent542630954b270eadd31af33a8019df588647d9df (diff)
AImageDecoder: Document/unguard types/enums
Bug: 160984428 Test: none From go/android-ndk-api-guidelines, these shouldn't be guarded, but they should have an "Introduced in API ##" line. Match the guidelines. Change-Id: I9bb51adb81782e7f6df8bd1d614d7e00a2e5556a
Diffstat (limited to 'include/android/imagedecoder.h')
-rw-r--r--include/android/imagedecoder.h39
1 files changed, 29 insertions, 10 deletions
diff --git a/include/android/imagedecoder.h b/include/android/imagedecoder.h
index 3dd1534f1d..49a616fce1 100644
--- a/include/android/imagedecoder.h
+++ b/include/android/imagedecoder.h
@@ -57,13 +57,15 @@ extern "C" {
struct AAsset;
-#if __ANDROID_API__ >= 30
-
/**
- * {@link AImageDecoder} functions result code. Many functions will return one of these
- * to indicate success ({@link ANDROID_IMAGE_DECODER_SUCCESS}) or the reason
- * for the failure. On failure, any out-parameters should be considered
- * uninitialized, except where specified.
+ * {@link AImageDecoder} functions result code.
+ *
+ * Introduced in API 30.
+ *
+ * Many functions will return this to indicate success
+ * ({@link ANDROID_IMAGE_DECODER_SUCCESS}) or the reason for the failure. On
+ * failure, any out-parameters should be considered uninitialized, except where
+ * specified.
*/
enum {
/**
@@ -115,6 +117,8 @@ struct AImageDecoder;
/**
* Opaque handle for decoding images.
*
+ * Introduced in API 30
+ *
* Create using one of the following:
* - {@link AImageDecoder_createFromAAsset}
* - {@link AImageDecoder_createFromFd}
@@ -130,6 +134,8 @@ struct AImageDecoder;
*/
typedef struct AImageDecoder AImageDecoder;
+#if __ANDROID_API__ >= 30
+
/**
* Create a new {@link AImageDecoder} from an {@link AAsset}.
*
@@ -331,7 +337,6 @@ int AImageDecoder_setDataSpace(AImageDecoder* _Nonnull decoder, int32_t dataspac
int AImageDecoder_setTargetSize(AImageDecoder* _Nonnull decoder, int32_t width,
int32_t height) __INTRODUCED_IN(30);
-
/**
* Compute the dimensions to use for a given sampleSize.
*
@@ -361,6 +366,7 @@ int AImageDecoder_setTargetSize(AImageDecoder* _Nonnull decoder, int32_t width,
int AImageDecoder_computeSampledSize(const AImageDecoder* _Nonnull decoder, int sampleSize,
int32_t* _Nonnull width, int32_t* _Nonnull height)
__INTRODUCED_IN(30);
+
/**
* Specify how to crop the output after scaling (if any).
*
@@ -388,15 +394,22 @@ int AImageDecoder_computeSampledSize(const AImageDecoder* _Nonnull decoder, int
*/
int AImageDecoder_setCrop(AImageDecoder* _Nonnull decoder, ARect crop) __INTRODUCED_IN(30);
+#endif // __ANDROID_API__ >= 30
+
struct AImageDecoderHeaderInfo;
/**
- * Opaque handle for representing information about the encoded image. Retrieved
- * using {@link AImageDecoder_getHeaderInfo} and passed to methods like
- * {@link AImageDecoderHeaderInfo_getWidth} and
+ * Opaque handle for representing information about the encoded image.
+ *
+ * Introduced in API 30
+ *
+ * Retrieved using {@link AImageDecoder_getHeaderInfo} and passed to methods
+ * like {@link AImageDecoderHeaderInfo_getWidth} and
* {@link AImageDecoderHeaderInfo_getHeight}.
*/
typedef struct AImageDecoderHeaderInfo AImageDecoderHeaderInfo;
+#if __ANDROID_API__ >= 30
+
/**
* Return an opaque handle for reading header info.
*
@@ -557,14 +570,20 @@ int AImageDecoder_decodeImage(AImageDecoder* _Nonnull decoder,
bool AImageDecoder_isAnimated(AImageDecoder* _Nonnull decoder)
__INTRODUCED_IN(31);
+#endif // __ANDROID_API__ >= 31
+
enum {
/*
* Reported by {@link AImageDecoder_getRepeatCount} if the
* animation should repeat forever.
+ *
+ * Introduced in API 31
*/
ANDROID_IMAGE_DECODER_INFINITE = INT32_MAX,
};
+#if __ANDROID_API__ >= 31
+
/**
* Report how many times the animation should repeat.
*