Skip to main content

OH_PixelMap_CreateAlphaPixelMap

Function OH_PixelMap_CreateAlphaPixelMap 

Source
pub unsafe extern "C" fn OH_PixelMap_CreateAlphaPixelMap(
    env: napi_env,
    source: napi_value,
    alpha: *mut napi_value,
) -> i32
Expand description

@brief Creates a PixelMap object that contains only alpha channel information.

@param env Pointer to the NAPI environment. @param source PixelMap object at the application layer. @param alpha Pointer to the alpha channel. @return Result code defined in {@link IRNdkErrCode}:

  • {@link IMAGE_RESULT_SUCCESS}: The operation is successful.
  • {@link IMAGE_RESULT_BAD_PARAMETER}: A parameter is incorrect.
  • {@link IMAGE_RESULT_JNI_ENV_ABNORMAL}: The JNI environment is abnormal.
  • {@link IMAGE_RESULT_INVALID_PARAMETER}: A parameter is invalid.
  • {@link IMAGE_RESULT_GET_DATA_ABNORMAL}: An error occurs during image data retrieval.
  • {@link IMAGE_RESULT_DECODE_FAILED}: Decoding fails.
  • {@link IMAGE_RESULT_DECODE_HEAD_ABNORMAL}: An error occurs during decoding of the image header.
  • {@link IMAGE_RESULT_CREATE_DECODER_FAILED}: The decoder fails to be created.
  • {@link IMAGE_RESULT_CREATE_ENCODER_FAILED}: The encoder fails to be created.
  • {@link IMAGE_RESULT_CHECK_FORMAT_ERROR}: The format check fails.
  • {@link IMAGE_RESULT_THIRDPART_SKIA_ERROR}: Skia decoding fails.
  • {@link IMAGE_RESULT_DATA_ABNORMAL}: The image input data is incorrect.
  • {@link IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST}: Sharing the memory fails.
  • {@link IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL}: Data in the shared memory is incorrect.
  • {@link IMAGE_RESULT_DECODE_ABNORMAL}: Image decoding fails.
  • {@link IMAGE_RESULT_MALLOC_ABNORMAL}: An error occurs during memory allocation.
  • {@link IMAGE_RESULT_DATA_UNSUPPORT}: The attribute is invalid or the image data is not supported.
  • {@link IMAGE_RESULT_INIT_ABNORMAL}: The image fails to be initialized.
  • {@link IMAGE_RESULT_CROP}: Cropping fails.
  • {@link IMAGE_RESULT_UNKNOWN_FORMAT}: The image format is unknown.
  • {@link IMAGE_RESULT_PLUGIN_REGISTER_FAILED}: The plugin fails to be registered.
  • {@link IMAGE_RESULT_PLUGIN_CREATE_FAILED}: The plugin fails to be created.
  • {@link IMAGE_RESULT_ENCODE_FAILED}: The image fails to be encoded.
  • {@link IMAGE_RESULT_HW_DECODE_UNSUPPORT}: Hardware decoding is not supported.
  • {@link IMAGE_RESULT_HW_DECODE_FAILED}: Hardware decoding fails.
  • {@link IMAGE_RESULT_INDEX_INVALID}: Index fails.
  • {@link IMAGE_RESULT_ALPHA_TYPE_ERROR}: The alpha type is incorrect.
  • {@link IMAGE_RESULT_ALLOCATER_TYPE_ERROR}: The memory allocator type is incorrect.
@see CreateAlphaPixelMap @since 10 @version 1.0