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 ImageSourceNative 18 * @{ 19 * 20 * @brief Provides APIs for access to the image interface. 21 * 22 * @since 12 23 */ 24 25 /** 26 * @file image_source_native.h 27 * 28 * @brief Declares APIs for decoding an image source into a pixel map. 29 * 30 * @library libimage_source.so 31 * @kit ImageKit 32 * @syscap SystemCapability.Multimedia.Image.ImageSource 33 * @since 12 34 */ 35 36 #ifndef INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_IMAGE_SOURCE_NATIVE_H_ 37 #define INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_IMAGE_SOURCE_NATIVE_H_ 38 #include "image_common.h" 39 40 #include "pixelmap_native.h" 41 #include "picture_native.h" 42 #include "rawfile/raw_file.h" 43 44 #ifdef __cplusplus 45 extern "C" { 46 #endif 47 48 /** 49 * @brief Defines an image source object for the image interface. 50 * 51 * @since 12 52 */ 53 struct OH_ImageSourceNative; 54 typedef struct OH_ImageSourceNative OH_ImageSourceNative; 55 56 /** 57 * @brief Defines image source infomation 58 * {@link OH_ImageSourceInfo_Create}. 59 * 60 * @since 12 61 */ 62 struct OH_ImageSource_Info; 63 typedef struct OH_ImageSource_Info OH_ImageSource_Info; 64 65 /** 66 * @brief Defines decoding options for picture 67 * {@link OH_DecodingOptionsForPicture_Create}. 68 * 69 * @since 13 70 */ 71 struct OH_DecodingOptionsForPicture; 72 73 /** 74 * @brief Defines decoding options for picture 75 * {@link OH_DecodingOptionsForPicture_Create}. 76 * 77 * @since 13 78 */ 79 typedef struct OH_DecodingOptionsForPicture OH_DecodingOptionsForPicture; 80 81 /** 82 * @brief Enumerates decoding dynamic range.. 83 * 84 * @since 12 85 */ 86 typedef enum { 87 /* 88 * Dynamic range depends on the image. 89 */ 90 IMAGE_DYNAMIC_RANGE_AUTO = 0, 91 /* 92 * Standard dynamic range. 93 */ 94 IMAGE_DYNAMIC_RANGE_SDR = 1, 95 /* 96 * High dynamic range. 97 */ 98 IMAGE_DYNAMIC_RANGE_HDR = 2, 99 } IMAGE_DYNAMIC_RANGE; 100 101 /** 102 * @brief Type of allocator used to allocate memory of a PixelMap.. 103 * 104 * @since 15 105 */ 106 typedef enum { 107 /* 108 * The system determines which memory to use to create the PixelMap. 109 */ 110 IMAGE_ALLOCATOR_TYPE_AUTO = 0, 111 /* 112 * Use DMA buffer to create the PixelMap. 113 */ 114 IMAGE_ALLOCATOR_TYPE_DMA = 1, 115 /* 116 * Use share memory to create the PixelMap. 117 */ 118 IMAGE_ALLOCATOR_TYPE_SHARE_MEMORY = 2, 119 } IMAGE_ALLOCATOR_TYPE; 120 121 /** 122 * @brief The strategy for executing the two operations when both desiredSize and desiredRegion 123 * are specified. 124 * 125 * @since 18 126 */ 127 typedef enum { 128 /** 129 * Scale first, then crop. 130 */ 131 IMAGE_CROP_AND_SCALE_STRATEGY_SCALE_FIRST = 1, 132 133 /** 134 * Crop first, then scale. 135 */ 136 IMAGE_CROP_AND_SCALE_STRATEGY_CROP_FIRST = 2, 137 } Image_CropAndScaleStrategy; 138 139 /** 140 * @brief Create a pointer for OH_ImageSource_Info struct. 141 * 142 * @param info The OH_ImageSource_Info pointer will be operated. 143 * @return Returns {@link Image_ErrorCode} 144 * @since 12 145 */ 146 Image_ErrorCode OH_ImageSourceInfo_Create(OH_ImageSource_Info **info); 147 148 /** 149 * @brief Get width number for OH_ImageSource_Info struct. 150 * 151 * @param info The OH_ImageSource_Info pointer will be operated. 152 * @param width the number of image width. 153 * @return Returns {@link Image_ErrorCode} 154 * @since 12 155 */ 156 Image_ErrorCode OH_ImageSourceInfo_GetWidth(OH_ImageSource_Info *info, uint32_t *width); 157 158 /** 159 * @brief Get height number for OH_ImageSource_Info struct. 160 * 161 * @param info The OH_ImageSource_Info pointer will be operated. 162 * @param height the number of image height. 163 * @return Returns {@link Image_ErrorCode} 164 * @since 12 165 */ 166 Image_ErrorCode OH_ImageSourceInfo_GetHeight(OH_ImageSource_Info *info, uint32_t *height); 167 168 /** 169 * @brief Get isHdr for OH_ImageSource_Info struct. 170 * 171 * @param info The OH_ImageSource_Info pointer will be operated. Pointer connot be null. 172 * @param isHdr Whether the image has a high dynamic range. 173 * @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - The operation is successful. 174 * returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - Parameter error.Possible causes:Parameter verification failed. 175 * @since 12 176 */ 177 Image_ErrorCode OH_ImageSourceInfo_GetDynamicRange(OH_ImageSource_Info *info, bool *isHdr); 178 179 /** 180 * @brief delete OH_ImageSource_Info pointer. 181 * 182 * @param info The OH_ImageSource_Info pointer will be operated. 183 * @return Returns {@link Image_ErrorCode} 184 * @since 12 185 */ 186 Image_ErrorCode OH_ImageSourceInfo_Release(OH_ImageSource_Info *info); 187 188 /** 189 * @brief Defines the options for decoding the image source. 190 * It is used in {@link OH_ImageSourceNative_CreatePixelmap}. 191 * 192 * @since 12 193 */ 194 struct OH_DecodingOptions; 195 typedef struct OH_DecodingOptions OH_DecodingOptions; 196 197 /** 198 * @brief Create a pointer for OH_DecodingOptions struct. 199 * 200 * @param options The OH_DecodingOptions pointer will be operated. 201 * @return Returns {@link Image_ErrorCode} 202 * @since 12 203 */ 204 Image_ErrorCode OH_DecodingOptions_Create(OH_DecodingOptions **options); 205 206 /** 207 * @brief Get pixelFormat number for OH_DecodingOptions struct. 208 * 209 * @param options The OH_DecodingOptions pointer will be operated. 210 * @param pixelFormat the number of image pixelFormat. 211 * @return Returns {@link Image_ErrorCode} 212 * @since 12 213 */ 214 Image_ErrorCode OH_DecodingOptions_GetPixelFormat(OH_DecodingOptions *options, 215 int32_t *pixelFormat); 216 217 /** 218 * @brief Set pixelFormat number for OH_DecodingOptions struct. 219 * 220 * @param options The OH_DecodingOptions pointer will be operated. 221 * @param pixelFormat the number of image pixelFormat. 222 * @return Returns {@link Image_ErrorCode} 223 * @since 12 224 */ 225 Image_ErrorCode OH_DecodingOptions_SetPixelFormat(OH_DecodingOptions *options, 226 int32_t pixelFormat); 227 228 /** 229 * @brief Get index number for OH_DecodingOptions struct. 230 * 231 * @param options The OH_DecodingOptions pointer will be operated. 232 * @param index the number of image index. 233 * @return Returns {@link Image_ErrorCode} 234 * @since 12 235 */ 236 Image_ErrorCode OH_DecodingOptions_GetIndex(OH_DecodingOptions *options, uint32_t *index); 237 238 /** 239 * @brief Set index number for OH_DecodingOptions struct. 240 * 241 * @param options The OH_DecodingOptions pointer will be operated. 242 * @param index the number of image index. 243 * @return Returns {@link Image_ErrorCode} 244 * @since 12 245 */ 246 Image_ErrorCode OH_DecodingOptions_SetIndex(OH_DecodingOptions *options, uint32_t index); 247 248 /** 249 * @brief Get rotate number for OH_DecodingOptions struct. 250 * 251 * @param options The OH_DecodingOptions pointer will be operated. 252 * @param rotate the number of image rotate. 253 * @return Returns {@link Image_ErrorCode} 254 * @since 12 255 */ 256 Image_ErrorCode OH_DecodingOptions_GetRotate(OH_DecodingOptions *options, float *rotate); 257 258 /** 259 * @brief Set rotate number for OH_DecodingOptions struct. 260 * 261 * @param options The OH_DecodingOptions pointer will be operated. 262 * @param rotate the number of image rotate. 263 * @return Returns {@link Image_ErrorCode} 264 * @since 12 265 */ 266 Image_ErrorCode OH_DecodingOptions_SetRotate(OH_DecodingOptions *options, float rotate); 267 268 /** 269 * @brief Get desiredSize number for OH_DecodingOptions struct. 270 * 271 * @param options The OH_DecodingOptions pointer will be operated. 272 * @param desiredSize the number of image desiredSize. 273 * @return Returns {@link Image_ErrorCode} 274 * @since 12 275 */ 276 Image_ErrorCode OH_DecodingOptions_GetDesiredSize(OH_DecodingOptions *options, 277 Image_Size *desiredSize); 278 279 /** 280 * @brief Set desiredSize number for OH_DecodingOptions struct. 281 * 282 * @param options The OH_DecodingOptions pointer will be operated. 283 * @param desiredSize the number of image desiredSize. 284 * @return Returns {@link Image_ErrorCode} 285 * @since 12 286 */ 287 Image_ErrorCode OH_DecodingOptions_SetDesiredSize(OH_DecodingOptions *options, 288 Image_Size *desiredSize); 289 290 /** 291 * @brief Set desiredRegion number for OH_DecodingOptions struct. 292 * 293 * @param options The OH_DecodingOptions pointer will be operated. 294 * @param desiredRegion the number of image desiredRegion. 295 * @return Returns {@link Image_ErrorCode} 296 * @since 12 297 */ 298 Image_ErrorCode OH_DecodingOptions_GetDesiredRegion(OH_DecodingOptions *options, 299 Image_Region *desiredRegion); 300 301 /** 302 * @brief Set desiredRegion number for OH_DecodingOptions struct. 303 * 304 * @param options The OH_DecodingOptions pointer will be operated. 305 * @param desiredRegion the number of image desiredRegion. 306 * @return Returns {@link Image_ErrorCode} 307 * @since 12 308 */ 309 Image_ErrorCode OH_DecodingOptions_SetDesiredRegion(OH_DecodingOptions *options, 310 Image_Region *desiredRegion); 311 312 /** 313 * @brief Set desiredDynamicRange number for OH_DecodingOptions struct. 314 * 315 * @param options The OH_DecodingOptions pointer will be operated. Pointer connot be null. 316 * @param desiredDynamicRange the number of desired dynamic range {@link IMAGE_DYNAMIC_RANGE}. Pointer connot be null. 317 * @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - The operation is successful. 318 * returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - Parameter error.Possible causes:Parameter verification failed. 319 * @since 12 320 */ 321 Image_ErrorCode OH_DecodingOptions_GetDesiredDynamicRange(OH_DecodingOptions *options, 322 int32_t *desiredDynamicRange); 323 324 /** 325 * @brief Sets a cropping and scaling strategy for decoding options. 326 * 327 * @param options Pointer to the decoding options. 328 * @param cropAndScaleStrategy Strategy for executing the cropping and scaling operations when both desiredSize and 329 * desiredRegion are specified. 330 * @return Returns one of the following result codes: 331 * {@link IMAGE_SUCCESS}: The execution is successful. 332 * {@link IMAGE_BAD_PARAMETER}: options is a null pointer or cropAndScaleStrategy is not in the range of 333 * Image_CropAndScaleStrategy. 334 * @since 18 335 */ 336 Image_ErrorCode OH_DecodingOptions_SetCropAndScaleStrategy(OH_DecodingOptions *options, 337 int32_t cropAndScaleStrategy); 338 339 /** 340 * @brief Obtains the cropping and scaling strategy of decoding options. 341 * 342 * @param options Pointer to the decoding options. 343 * @param cropAndScaleStrategy Pointer to the strategy for executing the cropping and scaling operations when both 344 * desiredSize and desiredRegion are specified. 345 * @return Returns one of the following result codes: 346 * {@link IMAGE_SUCCESS}: The execution is successful. 347 * {@link IMAGE_BAD_PARAMETER}: options or cropAndScaleStrategy is a null pointer. 348 * @since 18 349 */ 350 Image_ErrorCode OH_DecodingOptions_GetCropAndScaleStrategy(OH_DecodingOptions *options, 351 int32_t *cropAndScaleStrategy); 352 353 /** 354 * @brief Set desiredDynamicRange number for OH_DecodingOptions struct. 355 * 356 * @param options The OH_DecodingOptions pointer will be operated. Pointer connot be null. 357 * @param desiredDynamicRange the number of desired dynamic range {@link IMAGE_DYNAMIC_RANGE}. 358 * @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - The operation is successful. 359 * returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - Parameter error.Possible causes:Parameter verification failed. 360 * @since 12 361 */ 362 Image_ErrorCode OH_DecodingOptions_SetDesiredDynamicRange(OH_DecodingOptions *options, 363 int32_t desiredDynamicRange); 364 365 /** 366 * @brief delete OH_DecodingOptions pointer. 367 * 368 * @param options The OH_DecodingOptions pointer will be operated. 369 * @return Returns {@link Image_ErrorCode} 370 * @since 12 371 */ 372 Image_ErrorCode OH_DecodingOptions_Release(OH_DecodingOptions *options); 373 374 /** 375 * @brief Creates an ImageSource pointer. 376 * 377 * @param uri Indicates a pointer to the image source URI. Only a file URI or Base64 URI is accepted. 378 * @param uriSize Indicates the length of the image source URI. 379 * @param res Indicates a pointer to the <b>ImageSource</b> object created at the C++ native layer. 380 * @return Returns {@link Image_ErrorCode} 381 * @since 12 382 */ 383 Image_ErrorCode OH_ImageSourceNative_CreateFromUri(char *uri, size_t uriSize, OH_ImageSourceNative **res); 384 385 /** 386 * @brief Creates an void pointer 387 * 388 * @param fd Indicates the image source file descriptor. 389 * @param res Indicates a void pointer to the <b>ImageSource</b> object created at the C++ native layer. 390 * @return Returns {@link Image_ErrorCode} 391 * @since 12 392 */ 393 Image_ErrorCode OH_ImageSourceNative_CreateFromFd(int32_t fd, OH_ImageSourceNative **res); 394 395 /** 396 * @brief Creates an void pointer 397 * 398 * @param data Indicates a pointer to the image source data. Only a formatted packet data or Base64 data is accepted. 399 * @param dataSize Indicates the size of the image source data. 400 * @param res Indicates a void pointer to the <b>ImageSource</b> object created at the C++ native layer. 401 * @return Returns {@link Image_ErrorCode} 402 * @since 12 403 */ 404 Image_ErrorCode OH_ImageSourceNative_CreateFromData(uint8_t *data, size_t dataSize, OH_ImageSourceNative **res); 405 406 /** 407 * @brief Creates an void pointer 408 * 409 * @param rawFile Indicates the raw file's file descriptor. 410 * @param res Indicates a void pointer to the <b>ImageSource</b> object created at the C++ native layer. 411 * @return Returns {@link Image_ErrorCode} 412 * @since 12 413 */ 414 Image_ErrorCode OH_ImageSourceNative_CreateFromRawFile(RawFileDescriptor *rawFile, OH_ImageSourceNative **res); 415 416 /** 417 * @brief Decodes an void pointer 418 * based on the specified {@link OH_DecodingOptions} struct. 419 * 420 * @param source Indicates a void pointer(from ImageSource pointer convert). 421 * @param options Indicates a pointer to the options for decoding the image source. 422 * For details, see {@link OH_DecodingOptions}. 423 * @param pixelmap Indicates a void pointer to the <b>Pixelmap</b> object obtained at the C++ native layer. 424 * @return Returns {@link Image_ErrorCode} 425 * @since 12 426 */ 427 Image_ErrorCode OH_ImageSourceNative_CreatePixelmap(OH_ImageSourceNative *source, OH_DecodingOptions *options, 428 OH_PixelmapNative **pixelmap); 429 430 /** 431 * @brief Creates a PixelMap based on decoding parameters {@link OH_DecodingOptions}, the memory type used by the 432 * PixelMap can be specified by allocatorType {@link IMAGE_ALLOCATOR_TYPE}. By default, the system selects the memory 433 * type based on the image type, image size, platform capability, etc. When processing the PixelMap returned by this 434 * interface, please always consider the impact of stride. 435 * 436 * @param source Image Source. 437 * @param options Decoding parameters, such as the size, pixel format, and color space of the pixelMap. 438 * For details, see {@link OH_DecodingOptions}. 439 * @param allocator Indicate which memory type will be used by the returned PixelMap. 440 * @param pixelmap Decoded <b>Pixelmap</b> object. 441 * @return Error code. 442 * {@link IMAGE_SUCCESS} if the execution is successful. 443 * {@link IMAGE_BAD_PARAMETER} source is nullptr, or picture is nullptr. 444 * {@link IMAGE_BAD_SOURCE} data source exception. 445 * {@link IMAGE_SOURCE_UNSUPPORTED_MIMETYPE} unsupported mime type. 446 * {@link IMAGE_SOURCE_TOO_LARGE} image to large. 447 * {@link IMAGE_SOURCE_UNSUPPORTED_ALLOCATOR_TYPE} unsupported allocator type, 448 * e.g., use share memory to decode a HDR image as only DMA supported hdr metadata. 449 * {@link IMAGE_SOURCE_UNSUPPORTED_OPTIONS} unsupported options, 450 * e.g, cannot convert image into desired pixel format. 451 * {@link IMAGE_DECODE_FAILED} decode failed. 452 * {@link IMAGE_SOURCE_ALLOC_FAILED} memory allocation failed. 453 * @since 15 454 */ 455 Image_ErrorCode OH_ImageSourceNative_CreatePixelmapUsingAllocator(OH_ImageSourceNative *source, 456 OH_DecodingOptions *options, IMAGE_ALLOCATOR_TYPE allocator, OH_PixelmapNative **pixelmap); 457 458 459 /** 460 * @brief Decodes an void pointer 461 * the <b>Pixelmap</b> objects at the C++ native layer 462 * based on the specified {@link OH_DecodingOptions} struct. 463 * 464 * @param source Indicates a void pointer(from ImageSource pointer convert). 465 * @param options Indicates a pointer to the options for decoding the image source. 466 * For details, see {@link OH_DecodingOptions}. 467 * @param resVecPixMap Indicates a pointer array to the <b>Pixelmap</b> objects obtained at the C++ native layer. 468 * It cannot be a null pointer. 469 * @param size Indicates a size of resVecPixMap. User can get size from {@link OH_ImageSourceNative_GetFrameCount}. 470 * @return Returns {@link Image_ErrorCode} 471 * @since 12 472 */ 473 Image_ErrorCode OH_ImageSourceNative_CreatePixelmapList(OH_ImageSourceNative *source, OH_DecodingOptions *options, 474 OH_PixelmapNative *resVecPixMap[], size_t size); 475 476 /** 477 * @brief Create Picture pointer from ImageSource 478 * based on the specified {@link OH_DecodingOptionsForPicture} struct. 479 * 480 * @param source Indicates a void pointer(from ImageSource pointer convert). 481 * @param options Indicates a pointer to the options for decoding the image source. 482 * For details, see {@link OH_DecodingOptionsForPicture}. 483 * @param picture Indicates a void pointer to the <b>Picture</b> object obtained at the C++ native layer. 484 * @return Image functions result code. 485 * {@link IMAGE_SUCCESS} if the execution is successful. 486 * {@link IMAGE_BAD_PARAMETER} source is nullptr, or picture is nullptr. 487 * {@link IMAGE_DECODE_FAILED} decode failed. 488 * @since 13 489 */ 490 Image_ErrorCode OH_ImageSourceNative_CreatePicture(OH_ImageSourceNative *source, OH_DecodingOptionsForPicture *options, 491 OH_PictureNative **picture); 492 493 /** 494 * @brief Obtains the delay time list from some <b>ImageSource</b> objects (such as GIF image sources). 495 * 496 * @param source Indicates a void pointer(from ImageSource pointer convert). 497 * @param delayTimeList Indicates a pointer to the delay time list obtained. It cannot be a null pointer. 498 * @param size Indicates a size of delayTimeList. User can get size from {@link OH_ImageSourceNative_GetFrameCount}. 499 * @return Returns {@link Image_ErrorCode} 500 * @since 12 501 */ 502 Image_ErrorCode OH_ImageSourceNative_GetDelayTimeList(OH_ImageSourceNative *source, int32_t *delayTimeList, size_t size); 503 504 /** 505 * @brief Obtains image source information from an <b>ImageSource</b> object by index. 506 * 507 * @param source Indicates a void pointer(from ImageSource pointer convert). 508 * @param index Indicates the index of the frame. 509 * @param info Indicates a pointer to the image source information obtained. 510 * For details, see {@link OH_ImageSource_Info}. 511 * @return Returns {@link Image_ErrorCode} 512 * @since 12 513 */ 514 Image_ErrorCode OH_ImageSourceNative_GetImageInfo(OH_ImageSourceNative *source, int32_t index, 515 OH_ImageSource_Info *info); 516 517 /** 518 * @brief Obtains the value of an image property from an <b>ImageSource</b> object. 519 * 520 * @param source Indicates a void pointer(from ImageSource pointer convert). 521 * @param key Indicates a pointer to the property. For details, see {@link Image_String}., key is an exif constant. 522 * Release after use ImageSource, see {@link OH_ImageSourceNative_Release}. 523 * @param value Indicates a pointer to the value obtained.The user can pass in a null pointer and zero size, 524 * we will allocate memory, but user must free memory after use. 525 * @return Returns {@link Image_ErrorCode} 526 * @since 12 527 */ 528 Image_ErrorCode OH_ImageSourceNative_GetImageProperty(OH_ImageSourceNative *source, Image_String *key, 529 Image_String *value); 530 531 /** 532 * @brief Modifies the value of an image property of an <b>ImageSource</b> object. 533 * @param source Indicates a void pointer(from ImageSource pointer convert). 534 * @param key Indicates a pointer to the property. For details, see {@link Image_String}., key is an exif constant. 535 * Release after use ImageSource, see {@link OH_ImageSourceNative_Release}. 536 * @param value Indicates a pointer to the new value of the property. 537 * @return Returns {@link Image_ErrorCode} 538 * @since 12 539 */ 540 Image_ErrorCode OH_ImageSourceNative_ModifyImageProperty(OH_ImageSourceNative *source, Image_String *key, 541 Image_String *value); 542 543 /** 544 * @brief Obtains the number of frames from an <b>ImageSource</b> object. 545 * 546 * @param source Indicates a pointer to the {@link OH_ImageSource} object at the C++ native layer. 547 * @param frameCount The number of image frameCount. 548 * @return Returns {@link Image_ErrorCode} 549 * @since 12 550 */ 551 Image_ErrorCode OH_ImageSourceNative_GetFrameCount(OH_ImageSourceNative *source, uint32_t *frameCount); 552 553 /** 554 * @brief Releases an <b>ImageSourc</b> object. 555 * 556 * @param source Indicates a ImageSource pointer. 557 * @return Returns {@link Image_ErrorCode} 558 * @since 12 559 */ 560 Image_ErrorCode OH_ImageSourceNative_Release(OH_ImageSourceNative *source); 561 562 /** 563 * @brief Create a pointer for OH_DecodingOptionsForPicture struct. 564 * 565 * @param options The OH_DecodingOptionsForPicture pointer will be operated. 566 * @return Image functions result code. 567 * {@link IMAGE_SUCCESS} if the execution is successful. 568 * {@link IMAGE_BAD_PARAMETER} options is nullptr. 569 * @since 13 570 */ 571 Image_ErrorCode OH_DecodingOptionsForPicture_Create(OH_DecodingOptionsForPicture **options); 572 573 /** 574 * @brief Obtains the desired auxiliary pictures of decoding options. 575 * 576 * @param options The OH_DecodingOptionsForPicture pointer will be operated. 577 * @param desiredAuxiliaryPictures The desired auxiliary pictures in DecodingOptionsForPicture. 578 * @param length The length of desired auxiliary pictures. 579 * @return Image functions result code. 580 * {@link IMAGE_SUCCESS} if the execution is successful. 581 * {@link IMAGE_BAD_PARAMETER} options is nullptr, desiredAuxiliaryPictures is nullptr, 582 * or length is invalid. 583 * @since 13 584 */ 585 Image_ErrorCode OH_DecodingOptionsForPicture_GetDesiredAuxiliaryPictures(OH_DecodingOptionsForPicture *options, 586 Image_AuxiliaryPictureType **desiredAuxiliaryPictures, size_t *length); 587 588 /** 589 * @brief Set decoding options desired auxiliary pictures. 590 * 591 * @param options The OH_DecodingOptionsForPicture pointer will be operated. 592 * @param desiredAuxiliaryPictures The desired auxiliary pictures will be set. 593 * @param length The length of desired auxiliary pictures. 594 * @return Image functions result code. 595 * {@link IMAGE_SUCCESS} if the execution is successful. 596 * {@link IMAGE_BAD_PARAMETER} options is nullptr, desiredAuxiliaryPictures is nullptr, 597 * or length is invalid. 598 * @since 13 599 */ 600 Image_ErrorCode OH_DecodingOptionsForPicture_SetDesiredAuxiliaryPictures(OH_DecodingOptionsForPicture *options, 601 Image_AuxiliaryPictureType *desiredAuxiliaryPictures, size_t length); 602 603 /** 604 * @brief Releases an <b>DecodingOptionsForPicture</b> object. 605 * 606 * @param options Indicates a DecodingOptionsForPicture pointer. 607 * @return Image functions result code. 608 * {@link IMAGE_SUCCESS} if the execution is successful. 609 * {@link IMAGE_BAD_PARAMETER} options is nullptr. 610 * @since 13 611 */ 612 Image_ErrorCode OH_DecodingOptionsForPicture_Release(OH_DecodingOptionsForPicture *options); 613 #ifdef __cplusplus 614 }; 615 #endif 616 /** @} */ 617 #endif // INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_IMAGE_SOURCE_NATIVE_H_