mirror of
https://gitee.com/openharmony/multimedia_image_framework
synced 2024-11-27 09:10:54 +00:00
!1248 跨平台支持colorspace
Merge pull request !1248 from zhangqiang183/master
This commit is contained in:
commit
33bf725122
@ -21,8 +21,8 @@
|
||||
#include "image_pixel_map_napi.h"
|
||||
#include "image_trace.h"
|
||||
#include "log_tags.h"
|
||||
#if !defined(IOS_PLATFORM) && !defined(A_PLATFORM)
|
||||
#include "color_space_object_convertor.h"
|
||||
#if !defined(IOS_PLATFORM) && !defined(A_PLATFORM)
|
||||
#include "js_runtime_utils.h"
|
||||
#include "napi_message_sequence.h"
|
||||
#endif
|
||||
@ -86,9 +86,7 @@ struct PixelMapAsyncContext {
|
||||
double yArg = 0;
|
||||
bool xBarg = false;
|
||||
bool yBarg = false;
|
||||
#if !defined(IOS_PLATFORM) && !defined(A_PLATFORM)
|
||||
std::shared_ptr<OHOS::ColorManager::ColorSpace> colorSpace;
|
||||
#endif
|
||||
std::string surfaceId;
|
||||
};
|
||||
|
||||
@ -2319,9 +2317,7 @@ napi_value PixelMapNapi::SetColorSpace(napi_env env, napi_callback_info info)
|
||||
"Pixelmap has crossed threads . SetColorSpace failed"),
|
||||
HiLog::Error(LABEL, "Pixelmap has crossed threads . SetColorSpace failed"));
|
||||
#ifdef IMAGE_COLORSPACE_FLAG
|
||||
#if !defined(IOS_PLATFORM) && !defined(A_PLATFORM)
|
||||
nVal.context->colorSpace = ColorManager::GetColorSpaceByJSObject(env, nVal.argv[NUM_0]);
|
||||
#endif
|
||||
if (nVal.context->colorSpace == nullptr) {
|
||||
return ImageNapiUtils::ThrowExceptionError(
|
||||
env, ERR_IMAGE_INVALID_PARAMETER, "ColorSpace mismatch");
|
||||
@ -2394,9 +2390,7 @@ static void ParseColorSpaceVal(napi_env env, napi_value val, PixelMapAsyncContex
|
||||
}
|
||||
|
||||
#ifdef IMAGE_COLORSPACE_FLAG
|
||||
#if !defined(IOS_PLATFORM) && !defined(A_PLATFORM)
|
||||
context->colorSpace = ColorManager::GetColorSpaceByJSObject(env, val);
|
||||
#endif
|
||||
if (context->colorSpace == nullptr) {
|
||||
context->status = ERR_IMAGE_INVALID_PARAMETER;
|
||||
}
|
||||
|
@ -16,7 +16,10 @@ import("//foundation/arkui/ace_engine/ace_config.gni")
|
||||
import("//foundation/multimedia/image_framework/ide/image_decode_config.gni")
|
||||
import("//third_party/flutter/flutter_config.gni")
|
||||
|
||||
image_native_android_cflags = [ "-DIMAGE_DEBUG_FLAG" ]
|
||||
image_native_android_cflags = [
|
||||
"-DIMAGE_DEBUG_FLAG",
|
||||
"-DIMAGE_COLORSPACE_FLAG",
|
||||
]
|
||||
|
||||
image_native_android_sources = [
|
||||
# manager
|
||||
|
@ -16,7 +16,10 @@ import("//foundation/arkui/ace_engine/ace_config.gni")
|
||||
import("//foundation/multimedia/image_framework/ide/image_decode_config.gni")
|
||||
import("//third_party/flutter/flutter_config.gni")
|
||||
|
||||
image_native_ios_cflags = [ "-DIMAGE_DEBUG_FLAG" ]
|
||||
image_native_ios_cflags = [
|
||||
"-DIMAGE_DEBUG_FLAG",
|
||||
"-DIMAGE_COLORSPACE_FLAG",
|
||||
]
|
||||
|
||||
image_native_ios_sources = [
|
||||
# plugin_manager
|
||||
|
Loading…
Reference in New Issue
Block a user