1 /* 2 * Copyright (C) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 /** 17 * @addtogroup image 18 * @{ 19 * 20 * @brief Provides native APIs for image sources. 21 * 22 * @Syscap SystemCapability.Multimedia.Image 23 * @since 10 24 * @version 4.0 25 */ 26 27 /** 28 * @file image_source_mdk.h 29 * 30 * @brief Declares APIs for decoding an image source into a pixel map. 31 * 32 * @Syscap SystemCapability.Multimedia.Image 33 * @since 10 34 * @version 4.0 35 */ 36 37 #ifndef INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_SOURCE_MDK_H_ 38 #define INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_SOURCE_MDK_H_ 39 #include <cstdint> 40 #include "napi/native_api.h" 41 #include "image_mdk_common.h" 42 #ifdef __cplusplus 43 extern "C" { 44 #endif 45 46 /** 47 * @brief Defines a native image source object for the image source APIs. 48 * 49 * @Syscap SystemCapability.Multimedia.Image 50 * @since 10 51 * @version 4.0 52 */ 53 struct ImageSourceNative_; 54 55 /** 56 * @brief Defines a native image source object for the image source APIs. 57 * 58 * @Syscap SystemCapability.Multimedia.Image 59 * @since 10 60 * @version 4.0 61 */ 62 typedef struct ImageSourceNative_ ImageSourceNative; 63 64 /** 65 * @brief Defines a pointer to bits per sample, one of the image properties. 66 * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. 67 * 68 * @Syscap SystemCapability.Multimedia.Image 69 * @since 10 70 * @version 4.0 71 */ 72 const char* OHOS_IMAGE_PROPERTY_BITS_PER_SAMPLE = "BitsPerSample"; 73 74 /** 75 * @brief Defines a pointer to the orientation, one of the image properties. 76 * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. 77 * 78 * @Syscap SystemCapability.Multimedia.Image 79 * @since 10 80 * @version 4.0 81 */ 82 const char* OHOS_IMAGE_PROPERTY_ORIENTATION = "Orientation"; 83 84 /** 85 * @brief Defines a pointer to the image length, one of the image properties. 86 * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. 87 * 88 * @Syscap SystemCapability.Multimedia.Image 89 * @since 10 90 * @version 4.0 91 */ 92 const char* OHOS_IMAGE_PROPERTY_IMAGE_LENGTH = "ImageLength"; 93 94 /** 95 * @brief Defines a pointer to the image width, one of the image properties. 96 * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. 97 * 98 * @Syscap SystemCapability.Multimedia.Image 99 * @since 10 100 * @version 4.0 101 */ 102 const char* OHOS_IMAGE_PROPERTY_IMAGE_WIDTH = "ImageWidth"; 103 104 /** 105 * @brief Defines a pointer to the GPS latitude, one of the image properties. 106 * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. 107 * 108 * @Syscap SystemCapability.Multimedia.Image 109 * @since 10 110 * @version 4.0 111 */ 112 const char* OHOS_IMAGE_PROPERTY_GPS_LATITUDE = "GPSLatitude"; 113 114 /** 115 * @brief Defines a pointer to the GPS longitude, one of the image properties. 116 * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. 117 * 118 * @Syscap SystemCapability.Multimedia.Image 119 * @since 10 120 * @version 4.0 121 */ 122 const char* OHOS_IMAGE_PROPERTY_GPS_LONGITUDE = "GPSLongitude"; 123 124 /** 125 * @brief Defines a pointer to the GPS latitude reference information, one of the image properties. 126 * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. 127 * 128 * @Syscap SystemCapability.Multimedia.Image 129 * @since 10 130 * @version 4.0 131 */ 132 const char* OHOS_IMAGE_PROPERTY_GPS_LATITUDE_REF = "GPSLatitudeRef"; 133 134 /** 135 * @brief Defines a pointer to the GPS longitude reference information, one of the image properties. 136 * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. 137 * 138 * @Syscap SystemCapability.Multimedia.Image 139 * @since 10 140 * @version 4.0 141 */ 142 const char* OHOS_IMAGE_PROPERTY_GPS_LONGITUDE_REF = "GPSLongitudeRef"; 143 144 /** 145 * @brief Defines a pointer to the created date and time, one of the image properties. 146 * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. 147 * 148 * @Syscap SystemCapability.Multimedia.Image 149 * @since 10 150 * @version 4.0 151 */ 152 const char* OHOS_IMAGE_PROPERTY_DATE_TIME_ORIGINAL = "DateTimeOriginal"; 153 154 /** 155 * @brief Defines a pointer to the exposure time, one of the image properties. 156 * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. 157 * 158 * @Syscap SystemCapability.Multimedia.Image 159 * @since 10 160 * @version 4.0 161 */ 162 const char* OHOS_IMAGE_PROPERTY_EXPOSURE_TIME = "ExposureTime"; 163 164 /** 165 * @brief Defines a pointer to the scene type, one of the image properties. 166 * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. 167 * 168 * @Syscap SystemCapability.Multimedia.Image 169 * @since 10 170 * @version 4.0 171 */ 172 const char* OHOS_IMAGE_PROPERTY_SCENE_TYPE = "SceneType"; 173 174 /** 175 * @brief Defines a pointer to the ISO speed ratings, one of the image properties. 176 * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. 177 * 178 * @Syscap SystemCapability.Multimedia.Image 179 * @since 10 180 * @version 4.0 181 */ 182 const char* OHOS_IMAGE_PROPERTY_ISO_SPEED_RATINGS = "ISOSpeedRatings"; 183 184 /** 185 * @brief Defines a pointer to the f-number of the image, one of the image properties. 186 * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. 187 * 188 * @Syscap SystemCapability.Multimedia.Image 189 * @since 10 190 * @version 4.0 191 */ 192 const char* OHOS_IMAGE_PROPERTY_F_NUMBER = "FNumber"; 193 194 /** 195 * @brief Defines a pointer to the compressed bits per pixel, one of the image properties. 196 * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. 197 * 198 * @Syscap SystemCapability.Multimedia.Image 199 * @since 10 200 * @version 4.0 201 */ 202 const char* OHOS_IMAGE_PROPERTY_COMPRESSED_BITS_PER_PIXEL = "CompressedBitsPerPixel"; 203 204 /** 205 * @brief Defines the region of the image source to decode. 206 * It is used in {@link OhosImageDecodingOps}, {@link OH_ImageSource_CreatePixelMap}, and 207 * {@link OH_ImageSource_CreatePixelMapList}. 208 * 209 * @Syscap SystemCapability.Multimedia.Image 210 * @since 10 211 * @version 4.0 212 */ 213 struct OhosImageRegion { 214 /** X coordinate of the start point, in pixels. */ 215 int32_t x; 216 /** Y coordinate of the start point, in pixels. */ 217 int32_t y; 218 /** Width of the region, in pixels. */ 219 int32_t width; 220 /** Height of the region, in pixels. */ 221 int32_t height; 222 }; 223 224 /** 225 * @brief Defines image source options infomation 226 * {@link OH_ImageSource_Create} and {@link OH_ImageSource_CreateIncremental}. 227 * 228 * @Syscap SystemCapability.Multimedia.Image 229 * @since 10 230 * @version 4.0 231 */ 232 struct OhosImageSourceOps { 233 /** Pixel density of the image source. */ 234 int32_t density; 235 /** Image source pixel format, used to describe YUV buffer usually. */ 236 int32_t pixelFormat; 237 /** Image source pixel size of width and height. */ 238 struct OhosImageSize size; 239 }; 240 241 /** 242 * @brief Defines the options for decoding the image source. 243 * It is used in {@link OH_ImageSource_CreatePixelMap} and {@link OH_ImageSource_CreatePixelMapList}. 244 * 245 * @Syscap SystemCapability.Multimedia.Image 246 * @since 10 247 * @version 4.0 248 */ 249 struct OhosImageDecodingOps { 250 /** Defines output pixel map editable. */ 251 int8_t editable; 252 /** Defines output pixel format. */ 253 int32_t pixelFormat; 254 /** Defines decoding target pixel density. */ 255 int32_t fitDensity; 256 /** Defines decoding index of image source. */ 257 uint32_t index; 258 /** Defines decoding sample size option. */ 259 uint32_t sampleSize; 260 /** Defines decoding rotate option. */ 261 uint32_t rotate; 262 /** Defines decoding target pixel size of width and height. */ 263 struct OhosImageSize size; 264 /** Defines image source pixel region for decoding. */ 265 struct OhosImageRegion region; 266 }; 267 268 /** 269 * @brief Defines the image source information, which is obtained by calling {@link OH_ImageSource_GetImageInfo}. 270 * 271 * @Syscap SystemCapability.Multimedia.Image 272 * @since 10 273 * @version 4.0 274 */ 275 struct OhosImageSourceInfo { 276 /** Pixel format of the image source. It is set in {@link OH_ImageSource_Create}. */ 277 int32_t pixelFormat; 278 /** Color space of the image source. */ 279 int32_t colorSpace; 280 /** Alpha type of the image source. */ 281 int32_t alphaType; 282 /** Image density of the image source. It is set in {@link OH_ImageSource_Create}. */ 283 int32_t density; 284 /** Pixel width and height of the image source. */ 285 struct OhosImageSize size; 286 }; 287 288 /** 289 * @brief Defines the input resource of the image source. It is obtained by calling {@link OH_ImageSource_Create}. 290 * Only one type of resource is accepted at a time. 291 * 292 * @Syscap SystemCapability.Multimedia.Image 293 * @since 10 294 * @version 4.0 295 */ 296 struct OhosImageSource { 297 /** Pointer to the image source URI. Only a file URI or Base64 URI is accepted. */ 298 char* uri = nullptr; 299 /** Length of the image source URI. */ 300 size_t uriSize = 0; 301 /** Descriptor of the image source. */ 302 int32_t fd = -1; 303 /** Pointer to the image source buffer. Only a formatted packet buffer or Base64 buffer is accepted. */ 304 uint8_t* buffer = nullptr; 305 /** Size of the image source buffer. */ 306 size_t bufferSize = 0; 307 }; 308 309 /** 310 * @brief Defines the delay time list of the image source. It is obtained by calling 311 * {@link OH_ImageSource_GetDelayTime}. 312 * 313 * @Syscap SystemCapability.Multimedia.Image 314 * @since 10 315 * @version 4.0 316 */ 317 struct OhosImageSourceDelayTimeList { 318 /** Pointer to the head of the image source delay time list. */ 319 int32_t* delayTimeList; 320 /** Size of the image source delay time list. */ 321 size_t size = 0; 322 }; 323 324 /** 325 * @brief Defines image source supported format string. 326 * {@link OhosImageSourceSupportedFormatList} and {@link OH_ImageSource_GetSupportedFormats} 327 * 328 * @Syscap SystemCapability.Multimedia.Image 329 * @since 10 330 * @version 4.0 331 */ 332 struct OhosImageSourceSupportedFormat { 333 /** Image source supported format string head.*/ 334 char* format = nullptr; 335 /** Image source supported format string size.*/ 336 size_t size = 0; 337 }; 338 339 /** 340 * @brief Defines the format string list supported by the image source. 341 * It is obtained by calling {@link OH_ImageSource_GetSupportedFormats}. 342 * 343 * @Syscap SystemCapability.Multimedia.Image 344 * @since 10 345 * @version 4.0 346 */ 347 struct OhosImageSourceSupportedFormatList { 348 /** Image source supported format string list head.*/ 349 struct OhosImageSourceSupportedFormat** supportedFormatList = nullptr; 350 /** Image source supported format string list size.*/ 351 size_t size = 0; 352 }; 353 354 /** 355 * @brief Defines the property string (in key-value format) of the image source. 356 * It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. 357 * 358 * @Syscap SystemCapability.Multimedia.Image 359 * @since 10 360 * @version 4.0 361 */ 362 struct OhosImageSourceProperty { 363 /** Image source property key and value string head.*/ 364 char* value = nullptr; 365 /** Image source property key and value string size.*/ 366 size_t size = 0; 367 }; 368 369 /** 370 * @brief Defines the update data of the image source. It is obtained by calling {@link OH_ImageSource_UpdateData}. 371 * 372 * @Syscap SystemCapability.Multimedia.Image 373 * @since 10 374 * @version 4.0 375 */ 376 struct OhosImageSourceUpdateData { 377 /** Image source update data buffer.*/ 378 uint8_t* buffer = nullptr; 379 /** Image source update data buffer size.*/ 380 size_t bufferSize = 0; 381 /** Image source offset of update data buffer.*/ 382 uint32_t offset = 0; 383 /** Image source update data length in update data buffer.*/ 384 uint32_t updateLength = 0; 385 /** Image source update data is completed in this session.*/ 386 int8_t isCompleted = 0; 387 }; 388 389 /** 390 * @brief Creates an <b>ImageSource</b> object at the JavaScript native layer based on the specified 391 * {@link OhosImageSource} and {@link OhosImageSourceOps} structs. 392 * 393 * @param env Indicates a pointer to the Java Native Interface (JNI) environment. 394 * @param src Indicates a pointer to the input resource of the image source. For details, see {@link OhosImageSource}. 395 * @param ops Indicates a pointer to the options for creating the image source. 396 * For details, see {@link OhosImageSourceOps}. 397 * @param res Indicates a pointer to the <b>ImageSource</b> object created at the JavaScript native layer. 398 * @return Returns {@link IRNdkErrCode} IMAGE_RESULT_SUCCESS - if the operation is successful. 399 * returns {@link IRNdkErrCode} IMAGE_RESULT_BAD_PARAMETER - if bad parameter. 400 * returns {@link IRNdkErrCode} IMAGE_RESULT_JNI_ENV_ABNORMAL - if Abnormal JNI environment. 401 * returns {@link IRNdkErrCode} IMAGE_RESULT_INVALID_PARAMETER - if invalid parameter. 402 * returns {@link IRNdkErrCode} IMAGE_RESULT_SOURCE_DATA_INCOMPLETE - if image source data incomplete. 403 * returns {@link IRNdkErrCode} IMAGE_RESULT_SOURCE_DATA - if image source data error. 404 * returns {@link IRNdkErrCode} IMAGE_RESULT_GET_DATA_ABNORMAL - if image get data error. 405 * returns {@link IRNdkErrCode} IMAGE_RESULT_TOO_LARGE - if image data too large. 406 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_FAILED - if decode fail. 407 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_HEAD_ABNORMAL - if image decode head error. 408 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_EXIF_UNSUPPORT - if image decode exif unsupport. 409 * returns {@link IRNdkErrCode} IMAGE_RESULT_PROPERTY_NOT_EXIST - if image property not exist. 410 * returns {@link IRNdkErrCode} IMAGE_RESULT_FILE_DAMAGED - if file damaged. 411 * returns {@link IRNdkErrCode} IMAGE_RESULT_FILE_FD_ERROR - if file fd is bad. 412 * returns {@link IRNdkErrCode} IMAGE_RESULT_STREAM_SIZE_ERROR - if stream bad. 413 * returns {@link IRNdkErrCode} IMAGE_RESULT_SEEK_FAILED - if seek file failed. 414 * returns {@link IRNdkErrCode} IMAGE_RESULT_PEEK_FAILED - if peek file failed. 415 * returns {@link IRNdkErrCode} IMAGE_RESULT_FREAD_FAILED - if read file failed. 416 * @see {@link OhosImageSource}, {@link OhosImageSourceOps} 417 * 418 * @Syscap SystemCapability.Multimedia.Image 419 * @since 10 420 * @version 4.0 421 */ 422 int32_t OH_ImageSource_Create(napi_env env, struct OhosImageSource* src, 423 struct OhosImageSourceOps* ops, napi_value *res); 424 425 /** 426 * @brief Creates an incremental <b>ImageSource</b> object at the JavaScript native layer based on the specified 427 * {@link OhosImageSource} and {@link OhosImageSourceOps} structs. 428 * The image source data will be updated through {@link OH_ImageSource_UpdateData}. 429 * 430 * @param env Indicates a pointer to the JNI environment. 431 * @param src Indicates a pointer to the input resource of the image source. Only the buffer type is accepted. 432 * For details, see {@link OhosImageSource}. 433 * @param ops Indicates a pointer to the options for creating the image source. 434 * For details, see {@link OhosImageSourceOps}. 435 * @param res Indicates a pointer to the <b>ImageSource</b> object created at the JavaScript native layer. 436 * @return Returns {@link IRNdkErrCode} IMAGE_RESULT_SUCCESS - if the operation is successful. 437 * returns {@link IRNdkErrCode} IMAGE_RESULT_BAD_PARAMETER - if bad parameter. 438 * returns {@link IRNdkErrCode} IMAGE_RESULT_JNI_ENV_ABNORMAL - if Abnormal JNI environment. 439 * returns {@link IRNdkErrCode} IMAGE_RESULT_INVALID_PARAMETER - if invalid parameter. 440 * returns {@link IRNdkErrCode} IMAGE_RESULT_SOURCE_DATA_INCOMPLETE - if image source data incomplete. 441 * returns {@link IRNdkErrCode} IMAGE_RESULT_SOURCE_DATA - if image source data error. 442 * returns {@link IRNdkErrCode} IMAGE_RESULT_GET_DATA_ABNORMAL - if image get data error. 443 * returns {@link IRNdkErrCode} IMAGE_RESULT_TOO_LARGE - if image data too large. 444 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_FAILED - if decode fail. 445 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_HEAD_ABNORMAL - if image decode head error. 446 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_EXIF_UNSUPPORT - if image decode exif unsupport. 447 * returns {@link IRNdkErrCode} IMAGE_RESULT_PROPERTY_NOT_EXIST - if image property not exist. 448 * returns {@link IRNdkErrCode} IMAGE_RESULT_FILE_DAMAGED - if file damaged. 449 * returns {@link IRNdkErrCode} IMAGE_RESULT_FILE_FD_ERROR - if file fd is bad. 450 * returns {@link IRNdkErrCode} IMAGE_RESULT_STREAM_SIZE_ERROR - if stream bad. 451 * returns {@link IRNdkErrCode} IMAGE_RESULT_SEEK_FAILED - if seek file failed. 452 * returns {@link IRNdkErrCode} IMAGE_RESULT_PEEK_FAILED - if peek file failed. 453 * returns {@link IRNdkErrCode} IMAGE_RESULT_FREAD_FAILED - if read file failed. 454 * @see {@link OhosImageSource}, {@link OhosImageSourceOps}, {@link OH_ImageSource_UpdateData} 455 * 456 * @Syscap SystemCapability.Multimedia.Image 457 * @since 10 458 * @version 4.0 459 */ 460 int32_t OH_ImageSource_CreateIncremental(napi_env env, struct OhosImageSource* source, 461 struct OhosImageSourceOps* ops, napi_value *res); 462 463 /** 464 * @brief Obtains all supported decoding formats. 465 * 466 * @param res Indicates a pointer to the <b>OhosImageSourceSupportedFormatList</b> struct. 467 * When the input <b>supportedFormatList</b> is a null pointer and <b>size</b> is 0, the size of the supported formats 468 * is returned through <b>size</b> in <b>res</b>. 469 * To obtain all formats, a space larger than <b>size</b> is required. 470 * In addition, sufficient space must be reserved for each format supported. 471 * @return Returns {@link IRNdkErrCode} IMAGE_RESULT_SUCCESS - if the operation is successful. 472 * returns {@link IRNdkErrCode} IMAGE_RESULT_BAD_PARAMETER - if bad parameter. 473 * returns {@link IRNdkErrCode} IMAGE_RESULT_JNI_ENV_ABNORMAL - if Abnormal JNI environment. 474 * returns {@link IRNdkErrCode} IMAGE_RESULT_INVALID_PARAMETER - if invalid parameter. 475 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_FAILED - if decode fail. 476 * returns {@link IRNdkErrCode} IMAGE_RESULT_CHECK_FORMAT_ERROR - if decode fail. 477 * @see {@link OhosImageSourceSupportedFormatList}, {@link OhosImageSourceSupportedFormat} 478 * 479 * @Syscap SystemCapability.Multimedia.Image 480 * @since 10 481 * @version 4.0 482 */ 483 int32_t OH_ImageSource_GetSupportedFormats(struct OhosImageSourceSupportedFormatList* res); 484 485 /** 486 * @brief Converts an {@link ImageSource} object at the JavaScript native layer to an <b>ImageSourceNative</b> object 487 * at the C++ native layer. 488 * 489 * @param env Indicates a pointer to the JNI environment. 490 * @param source Indicates a pointer to the <b>ImageSource</b> object at the JavaScript native layer. 491 * @return Returns a pointer to the {@link ImageSourceNative} object if the operation is successful; 492 * returns a null pointer otherwise. 493 * @see {@link ImageSourceNative}, {@link OH_ImageSource_Release} 494 * 495 * @Syscap SystemCapability.Multimedia.Image 496 * @since 10 497 * @version 4.0 498 */ 499 ImageSourceNative* OH_ImageSource_InitNative(napi_env env, napi_value source); 500 501 /** 502 * @brief Decodes an <b>ImageSource</b> object to obtain a <b>PixelMap</b> object at the JavaScript native layer 503 * based on the specified {@link OhosImageDecodingOps} struct. 504 * 505 * @param native Indicates a pointer to the {@link ImageSourceNative} object at the C++ native layer. 506 * @param ops Indicates a pointer to the options for decoding the image source. 507 * For details, see {@link OhosImageDecodingOps}. 508 * @param res Indicates a pointer to the <b>PixelMap</b> object obtained at the JavaScript native layer. 509 * @return Returns {@link IRNdkErrCode} IMAGE_RESULT_SUCCESS - if the operation is successful. 510 * returns {@link IRNdkErrCode} IMAGE_RESULT_BAD_PARAMETER - if bad parameter. 511 * returns {@link IRNdkErrCode} IMAGE_RESULT_JNI_ENV_ABNORMAL - if Abnormal JNI environment. 512 * returns {@link IRNdkErrCode} IMAGE_RESULT_INVALID_PARAMETER - if invalid parameter. 513 * returns {@link IRNdkErrCode} IMAGE_RESULT_GET_DATA_ABNORMAL - if image get data error. 514 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_FAILED - if decode fail. 515 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_HEAD_ABNORMAL - if image decode head error. 516 * returns {@link IRNdkErrCode} IMAGE_RESULT_CREATE_DECODER_FAILED - if create decoder failed. 517 * returns {@link IRNdkErrCode} IMAGE_RESULT_CREATE_ENCODER_FAILED - if create encoder failed. 518 * returns {@link IRNdkErrCode} IMAGE_RESULT_CHECK_FORMAT_ERROR - if check format failed. 519 * returns {@link IRNdkErrCode} IMAGE_RESULT_THIRDPART_SKIA_ERROR - if skia error. 520 * returns {@link IRNdkErrCode} IMAGE_RESULT_DATA_ABNORMAL - if image input data error. 521 * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST - if sharememory error. 522 * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL - if sharememory data abnormal. 523 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_ABNORMAL - if image decode error. 524 * returns {@link IRNdkErrCode} IMAGE_RESULT_MALLOC_ABNORMAL - if image malloc error. 525 * returns {@link IRNdkErrCode} IMAGE_RESULT_DATA_UNSUPPORT - if image init error. 526 * returns {@link IRNdkErrCode} IMAGE_RESULT_INIT_ABNORMAL - if image input data error. 527 * returns {@link IRNdkErrCode} IMAGE_RESULT_CROP - if crop error. 528 * returns {@link IRNdkErrCode} IMAGE_RESULT_UNKNOWN_FORMAT - if image unknown format. 529 * returns {@link IRNdkErrCode} IMAGE_RESULT_PLUGIN_REGISTER_FAILED - if register plugin fail. 530 * returns {@link IRNdkErrCode} IMAGE_RESULT_PLUGIN_CREATE_FAILED - if create plugin fail. 531 * returns {@link IRNdkErrCode} IMAGE_RESULT_ENCODE_FAILED - if image add pixel map fail. 532 * returns {@link IRNdkErrCode} IMAGE_RESULT_HW_DECODE_UNSUPPORT - if image hardware decode unsupported. 533 * returns {@link IRNdkErrCode} IMAGE_RESULT_HW_DECODE_FAILED - if hard decode failed. 534 * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_IPC - if ipc error. 535 * returns {@link IRNdkErrCode} IMAGE_RESULT_INDEX_INVALID - if invalid index. 536 * returns {@link IRNdkErrCode} IMAGE_RESULT_ALPHA_TYPE_ERROR - if hard decode failed. 537 * returns {@link IRNdkErrCode} IMAGE_RESULT_ALLOCATER_TYPE_ERROR - if hard decode failed. 538 * @see {@link ImageSourceNative}, {@link OhosImageDecodingOps} 539 * 540 * @Syscap SystemCapability.Multimedia.Image 541 * @since 10 542 * @version 4.0 543 */ 544 int32_t OH_ImageSource_CreatePixelMap(const ImageSourceNative* native, 545 struct OhosImageDecodingOps* ops, napi_value *res); 546 547 /** 548 * @brief Decodes an <b>ImageSource</b> to obtain all the <b>PixelMap</b> objects at the JavaScript native layer 549 * based on the specified {@link OhosImageDecodingOps} struct. 550 * 551 * @param native Indicates a pointer to the {@link ImageSourceNative} object at the C++ native layer. 552 * @param ops Indicates a pointer to the options for decoding the image source. 553 * For details, see {@link OhosImageDecodingOps}. 554 * @param res Indicates a pointer to the <b>PixelMap</b> objects obtained at the JavaScript native layer. 555 * @return Returns {@link IRNdkErrCode} IMAGE_RESULT_SUCCESS - if the operation is successful. 556 * returns {@link IRNdkErrCode} IMAGE_RESULT_BAD_PARAMETER - if bad parameter. 557 * returns {@link IRNdkErrCode} IMAGE_RESULT_JNI_ENV_ABNORMAL - if Abnormal JNI environment. 558 * returns {@link IRNdkErrCode} IMAGE_RESULT_INVALID_PARAMETER - if invalid parameter. 559 * returns {@link IRNdkErrCode} IMAGE_RESULT_GET_DATA_ABNORMAL - if image get data error. 560 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_FAILED - if decode fail. 561 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_HEAD_ABNORMAL - if image decode head error. 562 * returns {@link IRNdkErrCode} IMAGE_RESULT_CREATE_DECODER_FAILED - if create decoder failed. 563 * returns {@link IRNdkErrCode} IMAGE_RESULT_CREATE_ENCODER_FAILED - if create encoder failed. 564 * returns {@link IRNdkErrCode} IMAGE_RESULT_CHECK_FORMAT_ERROR - if check format failed. 565 * returns {@link IRNdkErrCode} IMAGE_RESULT_THIRDPART_SKIA_ERROR - if skia error. 566 * returns {@link IRNdkErrCode} IMAGE_RESULT_DATA_ABNORMAL - if image input data error. 567 * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST - if sharememory error. 568 * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL - if sharememory data abnormal. 569 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_ABNORMAL - if image decode error. 570 * returns {@link IRNdkErrCode} IMAGE_RESULT_MALLOC_ABNORMAL - if image malloc error. 571 * returns {@link IRNdkErrCode} IMAGE_RESULT_DATA_UNSUPPORT - if image init error. 572 * returns {@link IRNdkErrCode} IMAGE_RESULT_INIT_ABNORMAL - if image input data error. 573 * returns {@link IRNdkErrCode} IMAGE_RESULT_CROP - if crop error. 574 * returns {@link IRNdkErrCode} IMAGE_RESULT_UNKNOWN_FORMAT - if image unknown format. 575 * returns {@link IRNdkErrCode} IMAGE_RESULT_PLUGIN_REGISTER_FAILED - if register plugin fail. 576 * returns {@link IRNdkErrCode} IMAGE_RESULT_PLUGIN_CREATE_FAILED - if create plugin fail. 577 * returns {@link IRNdkErrCode} IMAGE_RESULT_ENCODE_FAILED - if image add pixel map fail. 578 * returns {@link IRNdkErrCode} IMAGE_RESULT_HW_DECODE_UNSUPPORT - if image hardware decode unsupported. 579 * returns {@link IRNdkErrCode} IMAGE_RESULT_HW_DECODE_FAILED - if hard decode failed. 580 * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_IPC - if ipc error. 581 * returns {@link IRNdkErrCode} IMAGE_RESULT_INDEX_INVALID - if invalid index. 582 * returns {@link IRNdkErrCode} IMAGE_RESULT_ALPHA_TYPE_ERROR - if hard decode failed. 583 * returns {@link IRNdkErrCode} IMAGE_RESULT_ALLOCATER_TYPE_ERROR - if hard decode failed. 584 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_EXIF_UNSUPPORT - if image decode exif unsupport. 585 * returns {@link IRNdkErrCode} IMAGE_RESULT_PROPERTY_NOT_EXIST - if image property not exist. 586 * @see {@link ImageSourceNative}, {@link OhosImageDecodingOps} 587 * 588 * @Syscap SystemCapability.Multimedia.Image 589 * @since 10 590 * @version 4.0 591 */ 592 int32_t OH_ImageSource_CreatePixelMapList(const ImageSourceNative* native, 593 struct OhosImageDecodingOps* ops, napi_value *res); 594 595 /** 596 * @brief Obtains the delay time list from some <b>ImageSource</b> objects (such as GIF image sources). 597 * 598 * @param native Indicates a pointer to the {@link ImageSourceNative} object at the C++ native layer. 599 * @param res Indicates a pointer to the delay time list obtained. 600 * For details, see {@link OhosImageSourceDelayTimeList}. When the input <b>delayTimeList</b> is a null pointer and 601 * <b>size</b> is <b>0</b>, the size of the delay time list is returned through <b>size</b> in <b>res</b>. 602 * To obtain the complete delay time list, a space greater than <b>size</b> is required. 603 * @return Returns {@link IRNdkErrCode} IMAGE_RESULT_SUCCESS - if the operation is successful. 604 * returns {@link IRNdkErrCode} IMAGE_RESULT_BAD_PARAMETER - if bad parameter. 605 * returns {@link IRNdkErrCode} IMAGE_RESULT_JNI_ENV_ABNORMAL - if Abnormal JNI environment. 606 * returns {@link IRNdkErrCode} IMAGE_RESULT_INVALID_PARAMETER - if invalid parameter. 607 * returns {@link IRNdkErrCode} IMAGE_RESULT_GET_DATA_ABNORMAL - if image get data error. 608 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_FAILED - if decode fail. 609 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_HEAD_ABNORMAL - if image decode head error. 610 * returns {@link IRNdkErrCode} IMAGE_RESULT_CREATE_DECODER_FAILED - if create decoder failed. 611 * returns {@link IRNdkErrCode} IMAGE_RESULT_THIRDPART_SKIA_ERROR - if skia error. 612 * returns {@link IRNdkErrCode} IMAGE_RESULT_DATA_ABNORMAL - if image input data error. 613 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_ABNORMAL - if image decode error. 614 * returns {@link IRNdkErrCode} IMAGE_RESULT_DATA_UNSUPPORT - if image init error. 615 * returns {@link IRNdkErrCode} IMAGE_RESULT_UNKNOWN_FORMAT - if image unknown format. 616 * returns {@link IRNdkErrCode} IMAGE_RESULT_PLUGIN_REGISTER_FAILED - if register plugin fail. 617 * returns {@link IRNdkErrCode} IMAGE_RESULT_PLUGIN_CREATE_FAILED - if create plugin fail. 618 * returns {@link IRNdkErrCode} IMAGE_RESULT_INDEX_INVALID - if invalid index. 619 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_EXIF_UNSUPPORT - if image decode exif unsupport. 620 * returns {@link IRNdkErrCode} IMAGE_RESULT_PROPERTY_NOT_EXIST - if image property not exist. 621 * @see {@link ImageSourceNative}, {@link OhosImageSourceDelayTimeList} 622 * 623 * @Syscap SystemCapability.Multimedia.Image 624 * @since 10 625 * @version 4.0 626 */ 627 int32_t OH_ImageSource_GetDelayTime(const ImageSourceNative* native, 628 struct OhosImageSourceDelayTimeList* res); 629 630 /** 631 * @brief Obtains the number of frames from an <b>ImageSource</b> object. 632 * 633 * @param native Indicates a pointer to the {@link ImageSourceNative} object at the C++ native layer. 634 * @param res Indicates a pointer to the number of frames obtained. 635 * @return Returns {@link IRNdkErrCode} IMAGE_RESULT_SUCCESS - if the operation is successful. 636 * returns {@link IRNdkErrCode} IMAGE_RESULT_BAD_PARAMETER - if bad parameter. 637 * returns {@link IRNdkErrCode} IMAGE_RESULT_JNI_ENV_ABNORMAL - if Abnormal JNI environment. 638 * returns {@link IRNdkErrCode} IMAGE_RESULT_INVALID_PARAMETER - if invalid parameter. 639 * returns {@link IRNdkErrCode} IMAGE_RESULT_GET_DATA_ABNORMAL - if image get data error. 640 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_FAILED - if decode fail. 641 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_HEAD_ABNORMAL - if image decode head error. 642 * returns {@link IRNdkErrCode} IMAGE_RESULT_CREATE_DECODER_FAILED - if create decoder failed. 643 * returns {@link IRNdkErrCode} IMAGE_RESULT_THIRDPART_SKIA_ERROR - if skia error. 644 * returns {@link IRNdkErrCode} IMAGE_RESULT_DATA_ABNORMAL - if image input data error. 645 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_ABNORMAL - if image decode error. 646 * returns {@link IRNdkErrCode} IMAGE_RESULT_DATA_UNSUPPORT - if image init error. 647 * returns {@link IRNdkErrCode} IMAGE_RESULT_UNKNOWN_FORMAT - if image unknown format. 648 * returns {@link IRNdkErrCode} IMAGE_RESULT_PLUGIN_REGISTER_FAILED - if register plugin fail. 649 * returns {@link IRNdkErrCode} IMAGE_RESULT_PLUGIN_CREATE_FAILED - if create plugin fail. 650 * returns {@link IRNdkErrCode} IMAGE_RESULT_INDEX_INVALID - if invalid index. 651 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_EXIF_UNSUPPORT - if image decode exif unsupport. 652 * returns {@link IRNdkErrCode} IMAGE_RESULT_PROPERTY_NOT_EXIST - if image property not exist. 653 * @see {@link ImageSourceNative} 654 * 655 * @Syscap SystemCapability.Multimedia.Image 656 * @since 10 657 * @version 4.0 658 */ 659 int32_t OH_ImageSource_GetFrameCount(const ImageSourceNative* native, uint32_t *res); 660 661 /** 662 * @brief Obtains image source information from an <b>ImageSource</b> object by index. 663 * 664 * @param native Indicates a pointer to the {@link ImageSourceNative} object at the C++ native layer. 665 * @param index Indicates the index of the frame. 666 * @param info Indicates a pointer to the image source information obtained. 667 * For details, see {@link OhosImageSourceInfo}. 668 * @return Returns {@link IRNdkErrCode} IMAGE_RESULT_SUCCESS - if the operation is successful. 669 * returns {@link IRNdkErrCode} IMAGE_RESULT_BAD_PARAMETER - if bad parameter. 670 * returns {@link IRNdkErrCode} IMAGE_RESULT_JNI_ENV_ABNORMAL - if Abnormal JNI environment. 671 * returns {@link IRNdkErrCode} IMAGE_RESULT_INVALID_PARAMETER - if invalid parameter. 672 * returns {@link IRNdkErrCode} IMAGE_RESULT_GET_DATA_ABNORMAL - if image get data error. 673 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_FAILED - if decode fail. 674 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_HEAD_ABNORMAL - if image decode head error. 675 * returns {@link IRNdkErrCode} IMAGE_RESULT_CREATE_DECODER_FAILED - if create decoder failed. 676 * returns {@link IRNdkErrCode} IMAGE_RESULT_THIRDPART_SKIA_ERROR - if skia error. 677 * returns {@link IRNdkErrCode} IMAGE_RESULT_DATA_ABNORMAL - if image input data error. 678 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_ABNORMAL - if image decode error. 679 * returns {@link IRNdkErrCode} IMAGE_RESULT_DATA_UNSUPPORT - if image init error. 680 * returns {@link IRNdkErrCode} IMAGE_RESULT_UNKNOWN_FORMAT - if image unknown format. 681 * returns {@link IRNdkErrCode} IMAGE_RESULT_PLUGIN_REGISTER_FAILED - if register plugin fail. 682 * returns {@link IRNdkErrCode} IMAGE_RESULT_PLUGIN_CREATE_FAILED - if create plugin fail. 683 * returns {@link IRNdkErrCode} IMAGE_RESULT_INDEX_INVALID - if invalid index. 684 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_EXIF_UNSUPPORT - if image decode exif unsupport. 685 * returns {@link IRNdkErrCode} IMAGE_RESULT_PROPERTY_NOT_EXIST - if image property not exist. 686 * @see {@link ImageSourceNative}, {@link OhosImageSourceInfo} 687 * 688 * @Syscap SystemCapability.Multimedia.Image 689 * @since 10 690 * @version 4.0 691 */ 692 int32_t OH_ImageSource_GetImageInfo(const ImageSourceNative* native, int32_t index, 693 struct OhosImageSourceInfo* info); 694 695 /** 696 * @brief Obtains the value of an image property from an <b>ImageSource</b> object. 697 * 698 * @param native Indicates a pointer to the {@link ImageSourceNative} object at the C++ native layer. 699 * @param key Indicates a pointer to the property. For details, see {@link OhosImageSourceProperty}. 700 * @param value Indicates a pointer to the property value obtained. 701 * If the input <b>value</b> is a null pointer and <b>size</b> is <b>0</b>, the size of the property value is returned 702 * through <b>size</b> in <b>value</b>. 703 * To obtain the complete property value, a space greater than <b>size</b> is required. 704 * @return Returns {@link IRNdkErrCode} IMAGE_RESULT_SUCCESS - if the operation is successful. 705 * returns {@link IRNdkErrCode} IMAGE_RESULT_BAD_PARAMETER - if bad parameter. 706 * returns {@link IRNdkErrCode} IMAGE_RESULT_JNI_ENV_ABNORMAL - if Abnormal JNI environment. 707 * returns {@link IRNdkErrCode} IMAGE_RESULT_INVALID_PARAMETER - if invalid parameter. 708 * returns {@link IRNdkErrCode} IMAGE_RESULT_GET_DATA_ABNORMAL - if image get data error. 709 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_FAILED - if decode fail. 710 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_HEAD_ABNORMAL - if image decode head error. 711 * returns {@link IRNdkErrCode} IMAGE_RESULT_CREATE_DECODER_FAILED - if create decoder failed. 712 * returns {@link IRNdkErrCode} IMAGE_RESULT_THIRDPART_SKIA_ERROR - if skia error. 713 * returns {@link IRNdkErrCode} IMAGE_RESULT_DATA_ABNORMAL - if image input data error. 714 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_ABNORMAL - if image decode error. 715 * returns {@link IRNdkErrCode} IMAGE_RESULT_DATA_UNSUPPORT - if image init error. 716 * returns {@link IRNdkErrCode} IMAGE_RESULT_UNKNOWN_FORMAT - if image unknown format. 717 * returns {@link IRNdkErrCode} IMAGE_RESULT_PLUGIN_REGISTER_FAILED - if register plugin fail. 718 * returns {@link IRNdkErrCode} IMAGE_RESULT_PLUGIN_CREATE_FAILED - if create plugin fail. 719 * returns {@link IRNdkErrCode} IMAGE_RESULT_INDEX_INVALID - if invalid index. 720 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_EXIF_UNSUPPORT - if image decode exif unsupport. 721 * returns {@link IRNdkErrCode} IMAGE_RESULT_PROPERTY_NOT_EXIST - if image property not exist. 722 * @see {@link ImageSourceNative}, {@link OhosImageSourceProperty} 723 * 724 * @Syscap SystemCapability.Multimedia.Image 725 * @since 10 726 * @version 4.0 727 */ 728 int32_t OH_ImageSource_GetImageProperty(const ImageSourceNative* native, 729 struct OhosImageSourceProperty* key, struct OhosImageSourceProperty* value); 730 731 /** 732 * @brief Modifies the value of an image property of an <b>ImageSource</b> object. 733 * 734 * @param native Indicates a pointer to the {@link ImageSourceNative} object at the C++ native layer. 735 * @param key Indicates a pointer to the property. For details, see {@link OhosImageSourceProperty}. 736 * @param value Indicates a pointer to the new value of the property. 737 * @return Returns {@link IRNdkErrCode} IMAGE_RESULT_SUCCESS - if the operation is successful. 738 * returns {@link IRNdkErrCode} IMAGE_RESULT_BAD_PARAMETER - if bad parameter. 739 * returns {@link IRNdkErrCode} IMAGE_RESULT_JNI_ENV_ABNORMAL - if Abnormal JNI environment. 740 * returns {@link IRNdkErrCode} IMAGE_RESULT_INVALID_PARAMETER - if invalid parameter. 741 * returns {@link IRNdkErrCode} IMAGE_RESULT_GET_DATA_ABNORMAL - if image get data error. 742 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_FAILED - if decode fail. 743 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_HEAD_ABNORMAL - if image decode head error. 744 * returns {@link IRNdkErrCode} IMAGE_RESULT_CREATE_DECODER_FAILED - if create decoder failed. 745 * returns {@link IRNdkErrCode} IMAGE_RESULT_THIRDPART_SKIA_ERROR - if skia error. 746 * returns {@link IRNdkErrCode} IMAGE_RESULT_DATA_ABNORMAL - if image input data error. 747 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_ABNORMAL - if image decode error. 748 * returns {@link IRNdkErrCode} IMAGE_RESULT_DATA_UNSUPPORT - if image init error. 749 * returns {@link IRNdkErrCode} IMAGE_RESULT_UNKNOWN_FORMAT - if image unknown format. 750 * returns {@link IRNdkErrCode} IMAGE_RESULT_PLUGIN_REGISTER_FAILED - if register plugin fail. 751 * returns {@link IRNdkErrCode} IMAGE_RESULT_PLUGIN_CREATE_FAILED - if create plugin fail. 752 * returns {@link IRNdkErrCode} IMAGE_RESULT_INDEX_INVALID - if invalid index. 753 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_EXIF_UNSUPPORT - if image decode exif unsupport. 754 * returns {@link IRNdkErrCode} IMAGE_RESULT_PROPERTY_NOT_EXIST - if image property not exist. 755 * @see {@link ImageSourceNative}, {@link OhosImageSourceProperty} 756 * 757 * @Syscap SystemCapability.Multimedia.Image 758 * @since 10 759 * @version 4.0 760 */ 761 int32_t OH_ImageSource_ModifyImageProperty(const ImageSourceNative* native, 762 struct OhosImageSourceProperty* key, struct OhosImageSourceProperty* value); 763 764 /** 765 * @brief Updates the data of an <b>ImageSource</b> object. 766 * 767 * @param native Indicates a pointer to the {@link ImageSourceNative} object at the C++ native layer. 768 * @param data Indicates a pointer to the update data. For details, see {@link OhosImageSourceUpdateData}. 769 * @return Returns {@link IRNdkErrCode} IMAGE_RESULT_SUCCESS - if the operation is successful. 770 * returns {@link IRNdkErrCode} IMAGE_RESULT_BAD_PARAMETER - if bad parameter. 771 * returns {@link IRNdkErrCode} IMAGE_RESULT_JNI_ENV_ABNORMAL - if Abnormal JNI environment. 772 * returns {@link IRNdkErrCode} IMAGE_RESULT_INVALID_PARAMETER - if invalid parameter. 773 * returns {@link IRNdkErrCode} IMAGE_RESULT_GET_DATA_ABNORMAL - if image get data error. 774 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_FAILED - if decode fail. 775 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_HEAD_ABNORMAL - if image decode head error. 776 * returns {@link IRNdkErrCode} IMAGE_RESULT_CREATE_DECODER_FAILED - if create decoder failed. 777 * returns {@link IRNdkErrCode} IMAGE_RESULT_CREATE_ENCODER_FAILED - if create encoder failed. 778 * returns {@link IRNdkErrCode} IMAGE_RESULT_CHECK_FORMAT_ERROR - if check format failed. 779 * returns {@link IRNdkErrCode} IMAGE_RESULT_THIRDPART_SKIA_ERROR - if skia error. 780 * returns {@link IRNdkErrCode} IMAGE_RESULT_DATA_ABNORMAL - if image input data error. 781 * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST - if sharememory error. 782 * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL - if sharememory data abnormal. 783 * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_ABNORMAL - if image decode error. 784 * returns {@link IRNdkErrCode} IMAGE_RESULT_MALLOC_ABNORMAL - if image malloc error. 785 * returns {@link IRNdkErrCode} IMAGE_RESULT_DATA_UNSUPPORT - if image init error. 786 * returns {@link IRNdkErrCode} IMAGE_RESULT_INIT_ABNORMAL - if image input data error. 787 * returns {@link IRNdkErrCode} IMAGE_RESULT_CROP - if crop error. 788 * returns {@link IRNdkErrCode} IMAGE_RESULT_UNKNOWN_FORMAT - if image unknown format. 789 * returns {@link IRNdkErrCode} IMAGE_RESULT_PLUGIN_REGISTER_FAILED - if register plugin fail. 790 * returns {@link IRNdkErrCode} IMAGE_RESULT_PLUGIN_CREATE_FAILED - if create plugin fail. 791 * returns {@link IRNdkErrCode} IMAGE_RESULT_ENCODE_FAILED - image add pixel map fail. 792 * returns {@link IRNdkErrCode} IMAGE_RESULT_HW_DECODE_UNSUPPORT - if image hardware decode unsupported. 793 * returns {@link IRNdkErrCode} IMAGE_RESULT_HW_DECODE_FAILED - if hard decode failed. 794 * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_IPC - if ipc error. 795 * returns {@link IRNdkErrCode} IMAGE_RESULT_INDEX_INVALID - if invalid index. 796 * returns {@link IRNdkErrCode} IMAGE_RESULT_ALPHA_TYPE_ERROR - if hard decode failed. 797 * returns {@link IRNdkErrCode} IMAGE_RESULT_ALLOCATER_TYPE_ERROR - if hard decode failed. 798 * @see {@link ImageSourceNative}, {@link OhosImageSourceUpdateData} 799 * 800 * @Syscap SystemCapability.Multimedia.Image 801 * @since 10 802 * @version 4.0 803 */ 804 int32_t OH_ImageSource_UpdateData(const ImageSourceNative* native, struct OhosImageSourceUpdateData* data); 805 806 807 /** 808 * @brief Releases an <b>ImageSourceNative</b> object. 809 * 810 * @param native Indicates a pointer to the {@link ImageSourceNative} object at the C++ native layer. 811 * @return Returns {@link IRNdkErrCode} IMAGE_RESULT_SUCCESS - if the operation is successful. 812 * returns {@link IRNdkErrCode} IMAGE_RESULT_BAD_PARAMETER - if bad parameter. 813 * returns {@link IRNdkErrCode} IMAGE_RESULT_JNI_ENV_ABNORMAL - if Abnormal JNI environment. 814 * returns {@link IRNdkErrCode} IMAGE_RESULT_INVALID_PARAMETER - if invalid parameter. 815 * returns {@link IRNdkErrCode} IMAGE_RESULT_GET_DATA_ABNORMAL - if image get data error. 816 * returns {@link IRNdkErrCode} IMAGE_RESULT_DATA_ABNORMAL - if image input data error. 817 * @see {@link ImageSourceNative}, {@link OH_ImageSource_Create}, {@link OH_ImageSource_CreateIncremental} 818 * 819 * @Syscap SystemCapability.Multimedia.Image 820 * @since 10 821 * @version 4.0 822 */ 823 int32_t OH_ImageSource_Release(ImageSourceNative* native); 824 #ifdef __cplusplus 825 }; 826 #endif 827 #endif // INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_SOURCE_MDK_H_ 828