From b1b8259aa53819faaba76d27fbfc4b8fd8bd5499 Mon Sep 17 00:00:00 2001 From: Cao Chuan Date: Sun, 25 Jun 2023 14:26:13 +0800 Subject: [PATCH] Revert image pixel map api change Signed-off-by: Cao Chuan --- .../src/main/cpp/napi/image_pixel_map_imgndk_test.cpp | 7 +++---- .../entry/src/main/cpp/napi/imagePixelmap.cpp | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/multimedia/image/image_js_standard/imagePixelMapNDK/entry/src/main/cpp/napi/image_pixel_map_imgndk_test.cpp b/multimedia/image/image_js_standard/imagePixelMapNDK/entry/src/main/cpp/napi/image_pixel_map_imgndk_test.cpp index be1ff6f05..3ecaf62d4 100644 --- a/multimedia/image/image_js_standard/imagePixelMapNDK/entry/src/main/cpp/napi/image_pixel_map_imgndk_test.cpp +++ b/multimedia/image/image_js_standard/imagePixelMapNDK/entry/src/main/cpp/napi/image_pixel_map_imgndk_test.cpp @@ -162,8 +162,7 @@ napi_value ImagePixelMapNDKTest::CreatePixelMap(napi_env env, napi_callback_info if (!parseCreateOptions(env, argValue[NUM_1], &createOps)) { return udfVar; } - int32_t res = OH_PixelMap_CreatePixelMap(env, createOps, - static_cast(buffer), bufferSize, &pixelmap); + int32_t res = OH_PixelMap_CreatePixelMap(env, createOps, buffer, bufferSize, &pixelmap); if (res != OHOS_IMAGE_RESULT_SUCCESS || pixelmap == nullptr) { return udfVar; } @@ -565,7 +564,7 @@ napi_value ImagePixelMapNDKTest::GetImageInfo(napi_env env, napi_callback_info i return result; } - struct OhosPixelMapInfo pixelmapInfo; + OhosPixelMapInfo pixelmapInfo; int32_t res = OH_PixelMap_GetImageInfo(native, &pixelmapInfo); if (res != OHOS_IMAGE_RESULT_SUCCESS) { return result; @@ -588,7 +587,7 @@ napi_value ImagePixelMapNDKTest::AccessPixels(napi_env env, napi_callback_info i return result; } - uint8_t* pixelAddr = nullptr; + void* pixelAddr = nullptr; int32_t res = OH_PixelMap_AccessPixels(native, &pixelAddr); if (res != OHOS_IMAGE_RESULT_SUCCESS || pixelAddr == nullptr) { return result; diff --git a/multimedia/image/image_js_standard/image_ndk_test/entry/src/main/cpp/napi/imagePixelmap.cpp b/multimedia/image/image_js_standard/image_ndk_test/entry/src/main/cpp/napi/imagePixelmap.cpp index 502cd6963..49130f9aa 100644 --- a/multimedia/image/image_js_standard/image_ndk_test/entry/src/main/cpp/napi/imagePixelmap.cpp +++ b/multimedia/image/image_js_standard/image_ndk_test/entry/src/main/cpp/napi/imagePixelmap.cpp @@ -45,7 +45,7 @@ static napi_value TestAccessPixels(napi_env env, napi_callback_info info) napi_get_cb_info(env, info, &argCount, argValue, &thisVar, nullptr); - uint8_t* addrPtr = nullptr; + void* addrPtr = nullptr; OH_AccessPixels(env, argValue[0], &addrPtr); return result; } -- GitLab