summaryrefslogtreecommitdiff
path: root/include/android
diff options
context:
space:
mode:
author Leon Scroggins <scroggo@google.com> 2020-01-22 19:39:06 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-01-22 19:39:06 +0000
commit77ff5159d1b2fa69f139686c5241df697a85ff49 (patch)
tree5200bb0be664b8d76a4a37ff8426bb44a170cbd1 /include/android
parenta5e57f6d4e9e4f499dd94091b1769ac71e6fcfc7 (diff)
parent20d480ce9c6bfdd54d2b1e5e34306744968a4f37 (diff)
Merge "Add AImageDecoder HeaderInfo_get/_setDataSpace"
Diffstat (limited to 'include/android')
-rw-r--r--include/android/imagedecoder.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/include/android/imagedecoder.h b/include/android/imagedecoder.h
index c9fde0d3b7..469b088c89 100644
--- a/include/android/imagedecoder.h
+++ b/include/android/imagedecoder.h
@@ -159,6 +159,25 @@ int AImageDecoder_setAndroidBitmapFormat(AImageDecoder*,
int AImageDecoder_setUnpremultipliedRequired(AImageDecoder*, bool required) __INTRODUCED_IN(30);
/**
+ * Choose the dataspace for the output.
+ *
+ * Not supported for {@link ANDROID_BITMAP_FORMAT_A_8}, which does not support
+ * an ADataSpace.
+ *
+ * @param dataspace The {@link ADataSpace} to decode into. An ADataSpace
+ * specifies how to interpret the colors. By default,
+ * AImageDecoder will decode into the ADataSpace specified by
+ * {@link AImageDecoderHeaderInfo_getDataSpace}. If this
+ * parameter is set to a different ADataSpace, AImageDecoder
+ * will transform the output into the specified ADataSpace.
+ * @return - {@link ANDROID_IMAGE_DECODER_SUCCESS} on success
+ * - {@link ANDROID_IMAGE_DECODER_BAD_PARAMETER} for a null
+ * AImageDecoder or an integer that does not correspond to an
+ * ADataSpace value.
+ */
+int AImageDecoder_setDataSpace(AImageDecoder*, int32_t dataspace) __INTRODUCED_IN(30);
+
+/**
* Specify the output size for a decoded image.
*
* Future calls to {@link AImageDecoder_decodeImage} will sample or scale the
@@ -283,6 +302,25 @@ int AImageDecoderHeaderInfo_getAlphaFlags(
const AImageDecoderHeaderInfo*) __INTRODUCED_IN(30);
/**
+ * Report the dataspace the AImageDecoder will decode to by default.
+ * AImageDecoder will try to choose one that is sensible for the
+ * image and the system. Note that this may not exactly match the ICC
+ * profile (or other color information) stored in the encoded image.
+ *
+ * @return The {@link ADataSpace} most closely representing the way the colors
+ * are encoded (or {@link ADATASPACE_UNKNOWN} if there is not an
+ * approximate ADataSpace). This specifies how to interpret the colors
+ * in the decoded image, unless {@link AImageDecoder_setDataSpace} is
+ * called to decode to a different 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 AImageDecoderHeaderInfo_getDataSpace(
+ const AImageDecoderHeaderInfo*) __INTRODUCED_IN(30);
+
+/**
* Return the minimum stride that can be used, taking the specified
* (or default) (possibly scaled) width, crop rect and
* {@link AndroidBitmapFormat} into account.