提交 b1b8259a 编写于 作者: C Cao Chuan

Revert image pixel map api change

Signed-off-by: NCao Chuan <caochuan@huawei.com>
上级 9491bb09
...@@ -162,8 +162,7 @@ napi_value ImagePixelMapNDKTest::CreatePixelMap(napi_env env, napi_callback_info ...@@ -162,8 +162,7 @@ napi_value ImagePixelMapNDKTest::CreatePixelMap(napi_env env, napi_callback_info
if (!parseCreateOptions(env, argValue[NUM_1], &createOps)) { if (!parseCreateOptions(env, argValue[NUM_1], &createOps)) {
return udfVar; return udfVar;
} }
int32_t res = OH_PixelMap_CreatePixelMap(env, createOps, int32_t res = OH_PixelMap_CreatePixelMap(env, createOps, buffer, bufferSize, &pixelmap);
static_cast<uint8_t*>(buffer), bufferSize, &pixelmap);
if (res != OHOS_IMAGE_RESULT_SUCCESS || pixelmap == nullptr) { if (res != OHOS_IMAGE_RESULT_SUCCESS || pixelmap == nullptr) {
return udfVar; return udfVar;
} }
...@@ -565,7 +564,7 @@ napi_value ImagePixelMapNDKTest::GetImageInfo(napi_env env, napi_callback_info i ...@@ -565,7 +564,7 @@ napi_value ImagePixelMapNDKTest::GetImageInfo(napi_env env, napi_callback_info i
return result; return result;
} }
struct OhosPixelMapInfo pixelmapInfo; OhosPixelMapInfo pixelmapInfo;
int32_t res = OH_PixelMap_GetImageInfo(native, &pixelmapInfo); int32_t res = OH_PixelMap_GetImageInfo(native, &pixelmapInfo);
if (res != OHOS_IMAGE_RESULT_SUCCESS) { if (res != OHOS_IMAGE_RESULT_SUCCESS) {
return result; return result;
...@@ -588,7 +587,7 @@ napi_value ImagePixelMapNDKTest::AccessPixels(napi_env env, napi_callback_info i ...@@ -588,7 +587,7 @@ napi_value ImagePixelMapNDKTest::AccessPixels(napi_env env, napi_callback_info i
return result; return result;
} }
uint8_t* pixelAddr = nullptr; void* pixelAddr = nullptr;
int32_t res = OH_PixelMap_AccessPixels(native, &pixelAddr); int32_t res = OH_PixelMap_AccessPixels(native, &pixelAddr);
if (res != OHOS_IMAGE_RESULT_SUCCESS || pixelAddr == nullptr) { if (res != OHOS_IMAGE_RESULT_SUCCESS || pixelAddr == nullptr) {
return result; return result;
......
...@@ -45,7 +45,7 @@ static napi_value TestAccessPixels(napi_env env, napi_callback_info info) ...@@ -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); napi_get_cb_info(env, info, &argCount, argValue, &thisVar, nullptr);
uint8_t* addrPtr = nullptr; void* addrPtr = nullptr;
OH_AccessPixels(env, argValue[0], &addrPtr); OH_AccessPixels(env, argValue[0], &addrPtr);
return result; return result;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册