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_PACKER_MDK_KITS_H 17 #define FRAMEWORKS_KITS_JS_COMMON_INCLUDE_IMAGE_PACKER_MDK_KITS_H 18 19 #include "common_utils.h" 20 #include "image_packer_napi.h" 21 #include "image_packer_mdk.h" 22 23 namespace OHOS { 24 namespace Media { 25 #ifdef __cplusplus 26 extern "C" { 27 #endif 28 29 struct ImagePackerArgs { 30 napi_env inEnv; 31 ImagePackerNapi* inNapi; 32 int32_t inNum0 = -1; 33 napi_value inVal; 34 ImagePacker_Opts* inOpts; 35 uint8_t* outData; 36 size_t* dataSize; 37 napi_value* outVal; 38 }; 39 40 enum { 41 ENV_FUNC_IMAGEPACKER_CREATE, 42 CTX_FUNC_IMAGEPACKER_PACKTODATA, 43 CTX_FUNC_IMAGEPACKER_PACKTOFILE, 44 }; 45 ImagePackerNapi* ImagePackerNapi_Unwrap(napi_env env, napi_value value); 46 int32_t ImagePackerNativeCall(int32_t mode, struct ImagePackerArgs* args); 47 #ifdef __cplusplus 48 }; 49 #endif 50 } // namespace Media 51 } // namespace OHOS 52 53 #endif // FRAMEWORKS_KITS_JS_COMMON_INCLUDE_IMAGE_PACKER_MDK_KITS_H 54