| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 1 | /* | 
|  | 2 | * Copyright (C) 2019 The Android Open Source Project | 
|  | 3 | * | 
|  | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | 
|  | 5 | * you may not use this file except in compliance with the License. | 
|  | 6 | * You may obtain a copy of the License at | 
|  | 7 | * | 
|  | 8 | *      http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 9 | * | 
|  | 10 | * Unless required by applicable law or agreed to in writing, software | 
|  | 11 | * distributed under the License is distributed on an "AS IS" BASIS, | 
|  | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | 13 | * See the License for the specific language governing permissions and | 
|  | 14 | * limitations under the License. | 
|  | 15 | */ | 
|  | 16 |  | 
|  | 17 | /** | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 18 | * @defgroup ImageDecoder | 
|  | 19 | * | 
|  | 20 | * Functions for converting encoded images into RGBA pixels. | 
|  | 21 | * | 
|  | 22 | * Similar to the Java counterpart android.graphics.ImageDecoder, it can be used | 
| Leon Scroggins III | bb5ffd2 | 2020-02-06 11:45:16 -0500 | [diff] [blame] | 23 | * to decode images in the following formats: | 
|  | 24 | * - JPEG | 
|  | 25 | * - PNG | 
|  | 26 | * - GIF | 
|  | 27 | * - WebP | 
|  | 28 | * - BMP | 
|  | 29 | * - ICO | 
|  | 30 | * - WBMP | 
|  | 31 | * - HEIF | 
|  | 32 | * - Digital negatives (via the DNG SDK) | 
|  | 33 | * <p>It has similar options for scaling, cropping, and choosing the output format. | 
|  | 34 | * Unlike the Java API, which can create an android.graphics.Bitmap or | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 35 | * android.graphics.drawable.Drawable object, AImageDecoder decodes directly | 
|  | 36 | * into memory provided by the client. For more information, see the | 
|  | 37 | * <a href="https://developer.android.com/ndk/guides/image-decoder">Image decoder</a> | 
|  | 38 | * developer guide. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 39 | * @{ | 
|  | 40 | */ | 
|  | 41 |  | 
|  | 42 | /** | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 43 | * @file imagedecoder.h | 
|  | 44 | * @brief API for decoding images. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 45 | */ | 
|  | 46 |  | 
|  | 47 | #ifndef ANDROID_IMAGE_DECODER_H | 
|  | 48 | #define ANDROID_IMAGE_DECODER_H | 
|  | 49 |  | 
|  | 50 | #include "bitmap.h" | 
| Leon Scroggins III | a9f397b | 2020-01-27 12:42:56 -0500 | [diff] [blame] | 51 | #include <android/rect.h> | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 52 | #include <stdint.h> | 
|  | 53 |  | 
| Elliott Hughes | 08e6cf5 | 2021-02-08 12:37:53 -0800 | [diff] [blame] | 54 | #if !defined(__INTRODUCED_IN) | 
|  | 55 | #define __INTRODUCED_IN(__api_level) /* nothing */ | 
| Leon Scroggins III | c1f093f | 2021-01-08 14:25:31 -0500 | [diff] [blame] | 56 | #endif | 
|  | 57 |  | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 58 | #ifdef __cplusplus | 
|  | 59 | extern "C" { | 
|  | 60 | #endif | 
|  | 61 |  | 
|  | 62 | struct AAsset; | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 63 |  | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 64 | /** | 
|  | 65 | *  {@link AImageDecoder} functions result code. Many functions will return one of these | 
|  | 66 | *  to indicate success ({@link ANDROID_IMAGE_DECODER_SUCCESS}) or the reason | 
|  | 67 | *  for the failure. On failure, any out-parameters should be considered | 
|  | 68 | *  uninitialized, except where specified. | 
|  | 69 | */ | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 70 | enum { | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 71 | /** | 
|  | 72 | * Decoding was successful and complete. | 
|  | 73 | */ | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 74 | ANDROID_IMAGE_DECODER_SUCCESS = 0, | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 75 | /** | 
| Leon Scroggins III | bb5ffd2 | 2020-02-06 11:45:16 -0500 | [diff] [blame] | 76 | * The input is incomplete. | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 77 | */ | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 78 | ANDROID_IMAGE_DECODER_INCOMPLETE = -1, | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 79 | /** | 
|  | 80 | * The input contained an error after decoding some lines. | 
|  | 81 | */ | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 82 | ANDROID_IMAGE_DECODER_ERROR = -2, | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 83 | /** | 
|  | 84 | * Could not convert. For example, attempting to decode an image with | 
|  | 85 | * alpha to an opaque format. | 
|  | 86 | */ | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 87 | ANDROID_IMAGE_DECODER_INVALID_CONVERSION = -3, | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 88 | /** | 
|  | 89 | * The scale is invalid. It may have overflowed, or it may be incompatible | 
|  | 90 | * with the current alpha setting. | 
|  | 91 | */ | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 92 | ANDROID_IMAGE_DECODER_INVALID_SCALE = -4, | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 93 | /** | 
| Leon Scroggins III | bb5ffd2 | 2020-02-06 11:45:16 -0500 | [diff] [blame] | 94 | * Some other parameter is invalid. | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 95 | */ | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 96 | ANDROID_IMAGE_DECODER_BAD_PARAMETER = -5, | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 97 | /** | 
|  | 98 | * Input was invalid before decoding any pixels. | 
|  | 99 | */ | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 100 | ANDROID_IMAGE_DECODER_INVALID_INPUT = -6, | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 101 | /** | 
|  | 102 | * A seek was required and it failed. | 
|  | 103 | */ | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 104 | ANDROID_IMAGE_DECODER_SEEK_ERROR = -7, | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 105 | /** | 
|  | 106 | * Some other error. For example, an internal allocation failed. | 
|  | 107 | */ | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 108 | ANDROID_IMAGE_DECODER_INTERNAL_ERROR = -8, | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 109 | /** | 
|  | 110 | * AImageDecoder did not recognize the format. | 
|  | 111 | */ | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 112 | ANDROID_IMAGE_DECODER_UNSUPPORTED_FORMAT = -9 | 
|  | 113 | }; | 
|  | 114 |  | 
|  | 115 | struct AImageDecoder; | 
|  | 116 |  | 
|  | 117 | /** | 
|  | 118 | * Opaque handle for decoding images. | 
|  | 119 | * | 
|  | 120 | * Create using one of the following: | 
|  | 121 | * - {@link AImageDecoder_createFromAAsset} | 
|  | 122 | * - {@link AImageDecoder_createFromFd} | 
|  | 123 | * - {@link AImageDecoder_createFromBuffer} | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 124 | * | 
|  | 125 | * After creation, {@link AImageDecoder_getHeaderInfo} can be used to retrieve | 
|  | 126 | * information about the encoded image. Other functions, like | 
|  | 127 | * {@link AImageDecoder_setTargetSize}, can be used to specify how to decode, and | 
|  | 128 | * {@link AImageDecoder_decode} will decode into client provided memory. | 
|  | 129 | * | 
|  | 130 | * {@link AImageDecoder} objects are NOT thread-safe, and should not be shared across | 
|  | 131 | * threads. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 132 | */ | 
|  | 133 | typedef struct AImageDecoder AImageDecoder; | 
|  | 134 |  | 
|  | 135 | /** | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 136 | * Create a new {@link AImageDecoder} from an {@link AAsset}. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 137 | * | 
| Elliott Hughes | 7be0e2d | 2020-06-02 13:05:04 -0700 | [diff] [blame] | 138 | * Available since API level 30. | 
|  | 139 | * | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 140 | * @param asset {@link AAsset} containing encoded image data. Client is still | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 141 | *              responsible for calling {@link AAsset_close} on it, which may be | 
|  | 142 | *              done after deleting the returned {@link AImageDecoder}. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 143 | * @param outDecoder On success (i.e. return value is | 
|  | 144 | *                   {@link ANDROID_IMAGE_DECODER_SUCCESS}), this will be set to | 
|  | 145 | *                   a newly created {@link AImageDecoder}. Caller is | 
|  | 146 | *                   responsible for calling {@link AImageDecoder_delete} on it. | 
|  | 147 | * @return {@link ANDROID_IMAGE_DECODER_SUCCESS} on success or a value | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 148 | *         indicating the reason for the failure. | 
| Leon Scroggins III | bb5ffd2 | 2020-02-06 11:45:16 -0500 | [diff] [blame] | 149 | * | 
|  | 150 | * Errors: | 
|  | 151 | * - {@link ANDROID_IMAGE_DECODER_INCOMPLETE}: The asset was truncated before | 
|  | 152 | *   reading the image header. | 
|  | 153 | * - {@link ANDROID_IMAGE_DECODER_BAD_PARAMETER}: One of the parameters is | 
|  | 154 | *   null. | 
|  | 155 | * - {@link ANDROID_IMAGE_DECODER_INVALID_INPUT}: There is an error in the | 
|  | 156 | *   header. | 
|  | 157 | * - {@link ANDROID_IMAGE_DECODER_SEEK_ERROR}: The asset failed to seek. | 
|  | 158 | * - {@link ANDROID_IMAGE_DECODER_INTERNAL_ERROR}: Some other error, like a | 
|  | 159 | *   failure to allocate memory. | 
|  | 160 | * - {@link ANDROID_IMAGE_DECODER_UNSUPPORTED_FORMAT}: The format is not | 
|  | 161 | *   supported. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 162 | */ | 
| Leon Scroggins III | a9f397b | 2020-01-27 12:42:56 -0500 | [diff] [blame] | 163 | int AImageDecoder_createFromAAsset(struct AAsset* asset, AImageDecoder** outDecoder) | 
|  | 164 | __INTRODUCED_IN(30); | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 165 |  | 
|  | 166 | /** | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 167 | * Create a new {@link AImageDecoder} from a file descriptor. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 168 | * | 
| Elliott Hughes | 7be0e2d | 2020-06-02 13:05:04 -0700 | [diff] [blame] | 169 | * Available since API level 30. | 
|  | 170 | * | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 171 | * @param fd Seekable, readable, open file descriptor for encoded data. | 
|  | 172 | *           Client is still responsible for closing it, which may be done | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 173 | *           after deleting the returned {@link AImageDecoder}. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 174 | * @param outDecoder On success (i.e. return value is | 
|  | 175 | *                   {@link ANDROID_IMAGE_DECODER_SUCCESS}), this will be set to | 
|  | 176 | *                   a newly created {@link AImageDecoder}. Caller is | 
|  | 177 | *                   responsible for calling {@link AImageDecoder_delete} on it. | 
|  | 178 | * @return {@link ANDROID_IMAGE_DECODER_SUCCESS} on success or a value | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 179 | *         indicating the reason for the failure. | 
| Leon Scroggins III | bb5ffd2 | 2020-02-06 11:45:16 -0500 | [diff] [blame] | 180 | * | 
|  | 181 | * Errors: | 
|  | 182 | * - {@link ANDROID_IMAGE_DECODER_INCOMPLETE}: The file was truncated before | 
|  | 183 | *   reading the image header. | 
|  | 184 | * - {@link ANDROID_IMAGE_DECODER_BAD_PARAMETER}: The {@link AImageDecoder} is | 
|  | 185 | *   null, or |fd| does not represent a valid, seekable file descriptor. | 
|  | 186 | * - {@link ANDROID_IMAGE_DECODER_INVALID_INPUT}: There is an error in the | 
|  | 187 | *   header. | 
|  | 188 | * - {@link ANDROID_IMAGE_DECODER_SEEK_ERROR}: The descriptor failed to seek. | 
|  | 189 | * - {@link ANDROID_IMAGE_DECODER_INTERNAL_ERROR}: Some other error, like a | 
|  | 190 | *   failure to allocate memory. | 
|  | 191 | * - {@link ANDROID_IMAGE_DECODER_UNSUPPORTED_FORMAT}: The format is not | 
|  | 192 | *   supported. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 193 | */ | 
|  | 194 | int AImageDecoder_createFromFd(int fd, AImageDecoder** outDecoder) __INTRODUCED_IN(30); | 
|  | 195 |  | 
|  | 196 | /** | 
|  | 197 | * Create a new AImageDecoder from a buffer. | 
|  | 198 | * | 
| Elliott Hughes | 7be0e2d | 2020-06-02 13:05:04 -0700 | [diff] [blame] | 199 | * Available since API level 30. | 
|  | 200 | * | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 201 | * @param buffer Pointer to encoded data. Must be valid for the entire time | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 202 | *               the {@link AImageDecoder} is used. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 203 | * @param length Byte length of buffer. | 
|  | 204 | * @param outDecoder On success (i.e. return value is | 
|  | 205 | *                   {@link ANDROID_IMAGE_DECODER_SUCCESS}), this will be set to | 
|  | 206 | *                   a newly created {@link AImageDecoder}. Caller is | 
|  | 207 | *                   responsible for calling {@link AImageDecoder_delete} on it. | 
|  | 208 | * @return {@link ANDROID_IMAGE_DECODER_SUCCESS} on success or a value | 
| Leon Scroggins III | bb5ffd2 | 2020-02-06 11:45:16 -0500 | [diff] [blame] | 209 | *         indicating the reason for the failure. | 
|  | 210 | * | 
|  | 211 | * Errors: | 
|  | 212 | * - {@link ANDROID_IMAGE_DECODER_INCOMPLETE}: The encoded image was truncated before | 
|  | 213 | *   reading the image header. | 
|  | 214 | * - {@link ANDROID_IMAGE_DECODER_BAD_PARAMETER}: One of the parameters is | 
|  | 215 | *   invalid. | 
|  | 216 | * - {@link ANDROID_IMAGE_DECODER_INVALID_INPUT}: There is an error in the | 
|  | 217 | *   header. | 
|  | 218 | * - {@link ANDROID_IMAGE_DECODER_INTERNAL_ERROR}: Some other error, like a | 
|  | 219 | *   failure to allocate memory. | 
|  | 220 | * - {@link ANDROID_IMAGE_DECODER_UNSUPPORTED_FORMAT}: The format is not | 
|  | 221 | *   supported. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 222 | */ | 
|  | 223 | int AImageDecoder_createFromBuffer(const void* buffer, size_t length, | 
|  | 224 | AImageDecoder** outDecoder) __INTRODUCED_IN(30); | 
|  | 225 |  | 
|  | 226 | /** | 
|  | 227 | * Delete the AImageDecoder. | 
| Elliott Hughes | 7be0e2d | 2020-06-02 13:05:04 -0700 | [diff] [blame] | 228 | * | 
|  | 229 | * Available since API level 30. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 230 | */ | 
|  | 231 | void AImageDecoder_delete(AImageDecoder* decoder) __INTRODUCED_IN(30); | 
|  | 232 |  | 
|  | 233 | /** | 
|  | 234 | * Choose the desired output format. | 
|  | 235 | * | 
| Elliott Hughes | 7be0e2d | 2020-06-02 13:05:04 -0700 | [diff] [blame] | 236 | * Available since API level 30. | 
|  | 237 | * | 
| Leon Scroggins III | 5d0445c | 2020-01-23 09:43:43 -0500 | [diff] [blame] | 238 | * @param format {@link AndroidBitmapFormat} to use for the output. | 
| Leon Scroggins III | bb5ffd2 | 2020-02-06 11:45:16 -0500 | [diff] [blame] | 239 | * @return {@link ANDROID_IMAGE_DECODER_SUCCESS} on success or a value | 
|  | 240 | *         indicating the reason for the failure. On failure, the | 
|  | 241 | *         {@link AImageDecoder} uses the format it was already planning | 
|  | 242 | *         to use (either its default or a previously successful setting | 
|  | 243 | *         from this function). | 
|  | 244 | * | 
|  | 245 | * Errors: | 
|  | 246 | * - {@link ANDROID_IMAGE_DECODER_BAD_PARAMETER}: The | 
|  | 247 | *   {@link AImageDecoder} is null or |format| does not correspond to an | 
|  | 248 | *   {@link AndroidBitmapFormat}. | 
|  | 249 | * - {@link ANDROID_IMAGE_DECODER_INVALID_CONVERSION}: The | 
|  | 250 | *   {@link AndroidBitmapFormat} is incompatible with the image. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 251 | */ | 
|  | 252 | int AImageDecoder_setAndroidBitmapFormat(AImageDecoder*, | 
|  | 253 | int32_t format) __INTRODUCED_IN(30); | 
|  | 254 |  | 
| Leon Scroggins III | 1be112f | 2020-01-15 04:26:44 -0500 | [diff] [blame] | 255 | /** | 
|  | 256 | * Specify whether the output's pixels should be unpremultiplied. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 257 | * | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 258 | * By default, {@link AImageDecoder_decodeImage} will premultiply the pixels, if they have alpha. | 
|  | 259 | * Pass true to this method to leave them unpremultiplied. This has no effect on an | 
| Leon Scroggins III | 1be112f | 2020-01-15 04:26:44 -0500 | [diff] [blame] | 260 | * opaque image. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 261 | * | 
| Elliott Hughes | 7be0e2d | 2020-06-02 13:05:04 -0700 | [diff] [blame] | 262 | * Available since API level 30. | 
|  | 263 | * | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 264 | * @param unpremultipliedRequired Pass true to leave the pixels unpremultiplied. | 
| Leon Scroggins III | bb5ffd2 | 2020-02-06 11:45:16 -0500 | [diff] [blame] | 265 | * @return {@link ANDROID_IMAGE_DECODER_SUCCESS} on success or a value | 
|  | 266 | *         indicating the reason for the failure. | 
|  | 267 | * | 
|  | 268 | * Errors: | 
|  | 269 | * - {@link ANDROID_IMAGE_DECODER_INVALID_CONVERSION}: Unpremultiplied is not | 
|  | 270 | *   possible due to an existing scale set by | 
|  | 271 | *   {@link AImageDecoder_setTargetSize}. | 
|  | 272 | * - {@link ANDROID_IMAGE_DECODER_BAD_PARAMETER}: The | 
|  | 273 | *   {@link AImageDecoder} is null. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 274 | */ | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 275 | int AImageDecoder_setUnpremultipliedRequired(AImageDecoder*, | 
|  | 276 | bool unpremultipliedRequired) __INTRODUCED_IN(30); | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 277 |  | 
|  | 278 | /** | 
| Leon Scroggins III | 20d480c | 2020-01-15 15:32:59 -0500 | [diff] [blame] | 279 | * Choose the dataspace for the output. | 
|  | 280 | * | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 281 | * Ignored by {@link ANDROID_BITMAP_FORMAT_A_8}, which does not support | 
|  | 282 | * an {@link ADataSpace}. | 
| Leon Scroggins III | 20d480c | 2020-01-15 15:32:59 -0500 | [diff] [blame] | 283 | * | 
| Elliott Hughes | 7be0e2d | 2020-06-02 13:05:04 -0700 | [diff] [blame] | 284 | * Available since API level 30. | 
|  | 285 | * | 
| Leon Scroggins III | 20d480c | 2020-01-15 15:32:59 -0500 | [diff] [blame] | 286 | * @param dataspace The {@link ADataSpace} to decode into. An ADataSpace | 
|  | 287 | *                  specifies how to interpret the colors. By default, | 
|  | 288 | *                  AImageDecoder will decode into the ADataSpace specified by | 
|  | 289 | *                  {@link AImageDecoderHeaderInfo_getDataSpace}. If this | 
|  | 290 | *                  parameter is set to a different ADataSpace, AImageDecoder | 
|  | 291 | *                  will transform the output into the specified ADataSpace. | 
| Leon Scroggins III | bb5ffd2 | 2020-02-06 11:45:16 -0500 | [diff] [blame] | 292 | * @return {@link ANDROID_IMAGE_DECODER_SUCCESS} on success or a value | 
|  | 293 | *         indicating the reason for the failure. | 
|  | 294 | * | 
|  | 295 | * Errors: | 
|  | 296 | * - {@link ANDROID_IMAGE_DECODER_BAD_PARAMETER}: The | 
|  | 297 | *   {@link AImageDecoder} is null or |dataspace| does not correspond to an | 
|  | 298 | *   {@link ADataSpace} value. | 
| Leon Scroggins III | 20d480c | 2020-01-15 15:32:59 -0500 | [diff] [blame] | 299 | */ | 
|  | 300 | int AImageDecoder_setDataSpace(AImageDecoder*, int32_t dataspace) __INTRODUCED_IN(30); | 
|  | 301 |  | 
|  | 302 | /** | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 303 | * Specify the output size for a decoded image. | 
|  | 304 | * | 
|  | 305 | * Future calls to {@link AImageDecoder_decodeImage} will sample or scale the | 
|  | 306 | * encoded image to reach the desired size. If a crop rect is set (via | 
|  | 307 | * {@link AImageDecoder_setCrop}), it must be contained within the dimensions | 
|  | 308 | * specified by width and height, and the output image will be the size of the | 
|  | 309 | * crop rect. | 
|  | 310 | * | 
| Elliott Hughes | 7be0e2d | 2020-06-02 13:05:04 -0700 | [diff] [blame] | 311 | * Available since API level 30. | 
|  | 312 | * | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 313 | * @param width Width of the output (prior to cropping). | 
|  | 314 | *              This will affect future calls to | 
|  | 315 | *              {@link AImageDecoder_getMinimumStride}, which will now return | 
|  | 316 | *              a value based on this width. | 
|  | 317 | * @param height Height of the output (prior to cropping). | 
| Leon Scroggins III | bb5ffd2 | 2020-02-06 11:45:16 -0500 | [diff] [blame] | 318 | * @return {@link ANDROID_IMAGE_DECODER_SUCCESS} on success or a value | 
|  | 319 | *         indicating the reason for the failure. | 
|  | 320 | * | 
|  | 321 | * Errors: | 
|  | 322 | * - {@link ANDROID_IMAGE_DECODER_BAD_PARAMETER}: The | 
|  | 323 | *   {@link AImageDecoder} is null. | 
|  | 324 | * - {@link ANDROID_IMAGE_DECODER_INVALID_SCALE}: |width| or |height| is <= 0, | 
|  | 325 | *   the size is too big, any existing crop is not contained by the new image dimensions, | 
|  | 326 | *   or the scale is incompatible with a previous call to | 
|  | 327 | *   {@link AImageDecoder_setUnpremultipliedRequired}(true). | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 328 | */ | 
| Leon Scroggins III | 5d0445c | 2020-01-23 09:43:43 -0500 | [diff] [blame] | 329 | int AImageDecoder_setTargetSize(AImageDecoder*, int32_t width, int32_t height) __INTRODUCED_IN(30); | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 330 |  | 
| Leon Scroggins III | f27256b | 2020-01-19 21:13:04 -0500 | [diff] [blame] | 331 |  | 
|  | 332 | /** | 
|  | 333 | * Compute the dimensions to use for a given sampleSize. | 
|  | 334 | * | 
|  | 335 | * Although AImageDecoder can scale to an arbitrary target size (see | 
|  | 336 | * {@link AImageDecoder_setTargetSize}), some sizes may be more efficient than | 
|  | 337 | * others. This computes the most efficient target size to use to reach a | 
|  | 338 | * particular sampleSize. | 
|  | 339 | * | 
| Elliott Hughes | 7be0e2d | 2020-06-02 13:05:04 -0700 | [diff] [blame] | 340 | * Available since API level 30. | 
|  | 341 | * | 
| Leon Scroggins III | f27256b | 2020-01-19 21:13:04 -0500 | [diff] [blame] | 342 | * @param sampleSize A subsampling rate of the original image. Must be greater | 
|  | 343 | *                   than or equal to 1. A sampleSize of 2 means to skip every | 
|  | 344 | *                   other pixel/line, resulting in a width and height that are | 
|  | 345 | *                   1/2 of the original dimensions, with 1/4 the number of | 
|  | 346 | *                   pixels. | 
|  | 347 | * @param width Out parameter for the width sampled by sampleSize, and rounded | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 348 | *              in the direction that the decoder can do most efficiently. | 
| Leon Scroggins III | f27256b | 2020-01-19 21:13:04 -0500 | [diff] [blame] | 349 | * @param height Out parameter for the height sampled by sampleSize, and rounded | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 350 | *               in the direction that the decoder can do most efficiently. | 
| Leon Scroggins III | bb5ffd2 | 2020-02-06 11:45:16 -0500 | [diff] [blame] | 351 | * @return {@link ANDROID_IMAGE_DECODER_SUCCESS} on success or a value | 
|  | 352 | *         indicating the reason for the failure. | 
|  | 353 | * | 
|  | 354 | * Errors: | 
|  | 355 | * - {@link ANDROID_IMAGE_DECODER_BAD_PARAMETER}: The | 
|  | 356 | *   {@link AImageDecoder}, |width| or |height| is null or |sampleSize| is < 1. | 
| Leon Scroggins III | f27256b | 2020-01-19 21:13:04 -0500 | [diff] [blame] | 357 | */ | 
|  | 358 | int AImageDecoder_computeSampledSize(const AImageDecoder*, int sampleSize, | 
| Leon Scroggins III | 5d0445c | 2020-01-23 09:43:43 -0500 | [diff] [blame] | 359 | int32_t* width, int32_t* height) __INTRODUCED_IN(30); | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 360 | /** | 
|  | 361 | * Specify how to crop the output after scaling (if any). | 
|  | 362 | * | 
|  | 363 | * Future calls to {@link AImageDecoder_decodeImage} will crop their output to | 
|  | 364 | * the specified {@link ARect}. Clients will only need to allocate enough memory | 
|  | 365 | * for the cropped ARect. | 
|  | 366 | * | 
| Elliott Hughes | 7be0e2d | 2020-06-02 13:05:04 -0700 | [diff] [blame] | 367 | * Available since API level 30. | 
|  | 368 | * | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 369 | * @param crop Rectangle describing a crop of the decode. It must be contained inside of | 
|  | 370 | *             the (possibly scaled, by {@link AImageDecoder_setTargetSize}) | 
|  | 371 | *             image dimensions. This will affect future calls to | 
|  | 372 | *             {@link AImageDecoder_getMinimumStride}, which will now return a | 
|  | 373 | *             value based on the width of the crop. An empty ARect - | 
|  | 374 | *             specifically { 0, 0, 0, 0 } - may be used to remove the cropping | 
|  | 375 | *             behavior. Any other empty or unsorted ARects will result in | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 376 | *             returning {@link ANDROID_IMAGE_DECODER_BAD_PARAMETER}. | 
| Leon Scroggins III | bb5ffd2 | 2020-02-06 11:45:16 -0500 | [diff] [blame] | 377 | * @return {@link ANDROID_IMAGE_DECODER_SUCCESS} on success or a value | 
|  | 378 | *         indicating the reason for the failure. | 
|  | 379 | * | 
|  | 380 | * Errors: | 
|  | 381 | * - {@link ANDROID_IMAGE_DECODER_BAD_PARAMETER}: The | 
|  | 382 | *   {@link AImageDecoder} is null or the crop is not contained by the | 
|  | 383 | *   (possibly scaled) image dimensions. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 384 | */ | 
|  | 385 | int AImageDecoder_setCrop(AImageDecoder*, ARect crop) __INTRODUCED_IN(30); | 
|  | 386 |  | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 387 | struct AImageDecoderHeaderInfo; | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 388 | /** | 
| Leon Scroggins III | bb5ffd2 | 2020-02-06 11:45:16 -0500 | [diff] [blame] | 389 | * Opaque handle for representing information about the encoded image. Retrieved | 
|  | 390 | * using {@link AImageDecoder_getHeaderInfo} and passed to methods like | 
|  | 391 | * {@link AImageDecoderHeaderInfo_getWidth} and | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 392 | * {@link AImageDecoderHeaderInfo_getHeight}. | 
|  | 393 | */ | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 394 | typedef struct AImageDecoderHeaderInfo AImageDecoderHeaderInfo; | 
|  | 395 |  | 
|  | 396 | /** | 
|  | 397 | * Return an opaque handle for reading header info. | 
|  | 398 | * | 
|  | 399 | * This is owned by the {@link AImageDecoder} and will be destroyed when the | 
|  | 400 | * AImageDecoder is destroyed via {@link AImageDecoder_delete}. | 
| Elliott Hughes | 7be0e2d | 2020-06-02 13:05:04 -0700 | [diff] [blame] | 401 | * | 
|  | 402 | * Available since API level 30. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 403 | */ | 
|  | 404 | const AImageDecoderHeaderInfo* AImageDecoder_getHeaderInfo( | 
|  | 405 | const AImageDecoder*) __INTRODUCED_IN(30); | 
|  | 406 |  | 
|  | 407 | /** | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 408 | * Report the native width of the encoded image. This is also the logical | 
|  | 409 | * pixel width of the output, unless {@link AImageDecoder_setTargetSize} is | 
| Leon Scroggins III | bb5ffd2 | 2020-02-06 11:45:16 -0500 | [diff] [blame] | 410 | * used to choose a different size or {@link AImageDecoder_setCrop} is used to | 
|  | 411 | * set a crop rect. | 
| Elliott Hughes | 7be0e2d | 2020-06-02 13:05:04 -0700 | [diff] [blame] | 412 | * | 
|  | 413 | * Available since API level 30. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 414 | */ | 
|  | 415 | int32_t AImageDecoderHeaderInfo_getWidth(const AImageDecoderHeaderInfo*) __INTRODUCED_IN(30); | 
|  | 416 |  | 
|  | 417 | /** | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 418 | * Report the native height of the encoded image. This is also the logical | 
|  | 419 | * pixel height of the output, unless {@link AImageDecoder_setTargetSize} is | 
| Leon Scroggins III | bb5ffd2 | 2020-02-06 11:45:16 -0500 | [diff] [blame] | 420 | * used to choose a different size or {@link AImageDecoder_setCrop} is used to | 
|  | 421 | * set a crop rect. | 
| Elliott Hughes | 7be0e2d | 2020-06-02 13:05:04 -0700 | [diff] [blame] | 422 | * | 
|  | 423 | * Available since API level 30. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 424 | */ | 
|  | 425 | int32_t AImageDecoderHeaderInfo_getHeight(const AImageDecoderHeaderInfo*) __INTRODUCED_IN(30); | 
|  | 426 |  | 
|  | 427 | /** | 
|  | 428 | * Report the mimeType of the encoded image. | 
|  | 429 | * | 
| Elliott Hughes | 7be0e2d | 2020-06-02 13:05:04 -0700 | [diff] [blame] | 430 | * Available since API level 30. | 
|  | 431 | * | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 432 | * @return a string literal describing the mime type. | 
|  | 433 | */ | 
|  | 434 | const char* AImageDecoderHeaderInfo_getMimeType( | 
|  | 435 | const AImageDecoderHeaderInfo*) __INTRODUCED_IN(30); | 
|  | 436 |  | 
|  | 437 | /** | 
| Leon Scroggins III | 5d0445c | 2020-01-23 09:43:43 -0500 | [diff] [blame] | 438 | * Report the {@link AndroidBitmapFormat} the AImageDecoder will decode to | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 439 | * by default. {@link AImageDecoder} will try to choose one that is sensible | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 440 | * for the image and the system. Note that this does not indicate the | 
|  | 441 | * encoded format of the image. | 
| Elliott Hughes | 7be0e2d | 2020-06-02 13:05:04 -0700 | [diff] [blame] | 442 | * | 
|  | 443 | * Available since API level 30. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 444 | */ | 
| Leon Scroggins III | 5d0445c | 2020-01-23 09:43:43 -0500 | [diff] [blame] | 445 | int32_t AImageDecoderHeaderInfo_getAndroidBitmapFormat( | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 446 | const AImageDecoderHeaderInfo*) __INTRODUCED_IN(30); | 
|  | 447 |  | 
|  | 448 | /** | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 449 | * Report how the {@link AImageDecoder} will handle alpha by default. If the image | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 450 | * contains no alpha (according to its header), this will return | 
|  | 451 | * {@link ANDROID_BITMAP_FLAGS_ALPHA_OPAQUE}. If the image may contain alpha, | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 452 | * this returns {@link ANDROID_BITMAP_FLAGS_ALPHA_PREMUL}, because | 
|  | 453 | * {@link AImageDecoder_decodeImage} will premultiply pixels by default. | 
| Elliott Hughes | 7be0e2d | 2020-06-02 13:05:04 -0700 | [diff] [blame] | 454 | * | 
|  | 455 | * Available since API level 30. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 456 | */ | 
|  | 457 | int AImageDecoderHeaderInfo_getAlphaFlags( | 
|  | 458 | const AImageDecoderHeaderInfo*) __INTRODUCED_IN(30); | 
|  | 459 |  | 
|  | 460 | /** | 
| Leon Scroggins III | 8cee65e | 2020-01-30 14:20:42 -0500 | [diff] [blame] | 461 | * Report the dataspace the AImageDecoder will decode to by default. | 
| Leon Scroggins III | 20d480c | 2020-01-15 15:32:59 -0500 | [diff] [blame] | 462 | * | 
| Leon Scroggins III | 8cee65e | 2020-01-30 14:20:42 -0500 | [diff] [blame] | 463 | * By default, {@link AImageDecoder_decodeImage} will not do any color | 
|  | 464 | * conversion. | 
|  | 465 | * | 
| Elliott Hughes | 7be0e2d | 2020-06-02 13:05:04 -0700 | [diff] [blame] | 466 | * Available since API level 30. | 
|  | 467 | * | 
| Leon Scroggins III | 8cee65e | 2020-01-30 14:20:42 -0500 | [diff] [blame] | 468 | * @return The {@link ADataSpace} representing the way the colors | 
|  | 469 | *         are encoded (or {@link ADATASPACE_UNKNOWN} if there is not a | 
|  | 470 | *         corresponding ADataSpace). This specifies how to interpret the colors | 
| Leon Scroggins III | 20d480c | 2020-01-15 15:32:59 -0500 | [diff] [blame] | 471 | *         in the decoded image, unless {@link AImageDecoder_setDataSpace} is | 
|  | 472 | *         called to decode to a different ADataSpace. | 
|  | 473 | * | 
|  | 474 | *         Note that ADataSpace only exposes a few values. This may return | 
| Leon Scroggins III | 8cee65e | 2020-01-30 14:20:42 -0500 | [diff] [blame] | 475 | *         {@link ADATASPACE_UNKNOWN}, even for Named ColorSpaces, if they have | 
|  | 476 | *         no corresponding {@link ADataSpace}. | 
| Leon Scroggins III | 20d480c | 2020-01-15 15:32:59 -0500 | [diff] [blame] | 477 | */ | 
|  | 478 | int32_t AImageDecoderHeaderInfo_getDataSpace( | 
|  | 479 | const AImageDecoderHeaderInfo*) __INTRODUCED_IN(30); | 
|  | 480 |  | 
|  | 481 | /** | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 482 | * Return the minimum stride that can be used in | 
|  | 483 | * {@link AImageDecoder_decodeImage). | 
|  | 484 | * | 
|  | 485 | * This stride provides no padding, meaning it will be exactly equal to the | 
|  | 486 | * width times the number of bytes per pixel for the {@link AndroidBitmapFormat} | 
|  | 487 | * being used. | 
|  | 488 | * | 
|  | 489 | * If the output is scaled (via {@link AImageDecoder_setTargetSize}) and/or | 
|  | 490 | * cropped (via {@link AImageDecoder_setCrop}), this takes those into account. | 
| Elliott Hughes | 7be0e2d | 2020-06-02 13:05:04 -0700 | [diff] [blame] | 491 | * | 
|  | 492 | * Available since API level 30. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 493 | */ | 
|  | 494 | size_t AImageDecoder_getMinimumStride(AImageDecoder*) __INTRODUCED_IN(30); | 
|  | 495 |  | 
|  | 496 | /** | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 497 | * Decode the image into pixels, using the settings of the {@link AImageDecoder}. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 498 | * | 
| Elliott Hughes | 7be0e2d | 2020-06-02 13:05:04 -0700 | [diff] [blame] | 499 | * Available since API level 30. | 
|  | 500 | * | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 501 | * @param decoder Opaque object representing the decoder. | 
|  | 502 | * @param pixels On success, will be filled with the result | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 503 | *               of the decode. Must be large enough to hold |size| bytes. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 504 | * @param stride Width in bytes of a single row. Must be at least | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 505 | *               {@link AImageDecoder_getMinimumStride} and a multiple of the | 
|  | 506 | *               bytes per pixel of the {@link AndroidBitmapFormat}. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 507 | * @param size Size of the pixel buffer in bytes. Must be at least | 
|  | 508 | *             stride * (height - 1) + | 
| Leon Scroggins III | 97fea5f | 2020-01-30 12:18:20 -0500 | [diff] [blame] | 509 | *             {@link AImageDecoder_getMinimumStride}. | 
| Leon Scroggins III | bb5ffd2 | 2020-02-06 11:45:16 -0500 | [diff] [blame] | 510 | * @return {@link ANDROID_IMAGE_DECODER_SUCCESS} on success or a value | 
|  | 511 | *         indicating the reason for the failure. | 
|  | 512 | * | 
|  | 513 | * Errors: | 
|  | 514 | * - {@link ANDROID_IMAGE_DECODER_INCOMPLETE}: The image was truncated. A | 
|  | 515 | *   partial image was decoded, and undecoded lines have been initialized to all | 
|  | 516 | *   zeroes. | 
|  | 517 | * - {@link ANDROID_IMAGE_DECODER_ERROR}: The image contained an error. A | 
|  | 518 | *   partial image was decoded, and undecoded lines have been initialized to all | 
|  | 519 | *   zeroes. | 
|  | 520 | * - {@link ANDROID_IMAGE_DECODER_BAD_PARAMETER}: The {@link AImageDecoder} or | 
|  | 521 | *   |pixels| is null, the stride is not large enough or not pixel aligned, or | 
|  | 522 | *   |size| is not large enough. | 
|  | 523 | * - {@link ANDROID_IMAGE_DECODER_SEEK_ERROR}: The asset or file descriptor | 
|  | 524 | *   failed to seek. | 
|  | 525 | * - {@link ANDROID_IMAGE_DECODER_INTERNAL_ERROR}: Some other error, like a | 
|  | 526 | *   failure to allocate memory. | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 527 | */ | 
|  | 528 | int AImageDecoder_decodeImage(AImageDecoder* decoder, | 
|  | 529 | void* pixels, size_t stride, | 
|  | 530 | size_t size) __INTRODUCED_IN(30); | 
|  | 531 |  | 
| Leon Scroggins III | 2f98494 | 2019-11-22 17:02:23 -0500 | [diff] [blame] | 532 | #ifdef __cplusplus | 
|  | 533 | } | 
|  | 534 | #endif | 
|  | 535 |  | 
|  | 536 | #endif // ANDROID_IMAGE_DECODER_H | 
|  | 537 |  | 
|  | 538 | /** @} */ |