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 #ifndef FRAMEWORKS_KITS_JS_COMMON_INCLUDE_IMAGE_NAPI_KITS_H 17 #define FRAMEWORKS_KITS_JS_COMMON_INCLUDE_IMAGE_NAPI_KITS_H 18 19 #include "common_utils.h" 20 #include "native_image.h" 21 #include "image_napi.h" 22 #include "image_mdk.h" 23 24 namespace OHOS { 25 namespace Media { 26 #ifdef __cplusplus 27 extern "C" { 28 #endif 29 30 struct ImageNapiArgs { 31 int32_t inNum0; 32 struct OhosImageRect* outRect; 33 struct OhosImageSize* outSize; 34 int32_t* outNum0; 35 napi_value* outVal; 36 struct OhosImageComponent* outComponent; 37 }; 38 39 enum { 40 CTX_FUNC_IMAGE_CLIP_RECT, 41 CTX_FUNC_IMAGE_SIZE, 42 CTX_FUNC_IMAGE_FORMAT, 43 CTX_FUNC_IMAGE_GET_COMPONENT 44 }; 45 46 ImageNapi* ImageNapi_Unwrap(napi_env env, napi_value value); 47 int32_t ImageNapiNativeCtxCall(int32_t mode, ImageNapi* native, struct ImageNapiArgs* args); 48 #ifdef __cplusplus 49 }; 50 #endif 51 } // namespace Media 52 } // namespace OHOS 53 54 #endif // FRAMEWORKS_KITS_JS_COMMON_INCLUDE_IMAGE_NAPI_KITS_H 55