• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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 IMAGE_RECEIVER_TEST_H
17 #define IMAGE_RECEIVER_TEST_H
18 
19 #include <memory>
20 #include <string>
21 #include "napi/native_api.h"
22 
23 namespace OHOS {
24 namespace Media {
25 
26 class ImageReceiverTest {
27 public:
28     static napi_value JsCreateImageReceiverOptions(napi_env env, napi_callback_info info);
29     static napi_value JsImageReceiverOptionsGetSize(napi_env env, napi_callback_info info);
30     static napi_value JsImageReceiverOptionsSetSize(napi_env env, napi_callback_info info);
31     static napi_value JsImageReceiverOptionsGetCapacity(napi_env env, napi_callback_info info);
32     static napi_value JsImageReceiverOptionsSetCapacity(napi_env env, napi_callback_info info);
33     static napi_value JsReleaseImageReceiverOptions(napi_env env, napi_callback_info info);
34 
35 public:
36     static napi_value JsCreateImageReceiver(napi_env env, napi_callback_info info);
37     static napi_value JsGetReceivingSurfaceId(napi_env env, napi_callback_info info);
38     static napi_value JsReadLatestImage(napi_env env, napi_callback_info info);
39     static napi_value JsReadNextImage(napi_env env, napi_callback_info info);
40     static napi_value JsOn(napi_env env, napi_callback_info info);
41     static napi_value JsOff(napi_env env, napi_callback_info info);
42     static napi_value JsGetSize(napi_env env, napi_callback_info info);
43     static napi_value JsGetCapacity(napi_env env, napi_callback_info info);
44     static napi_value JsReleaseImageReceiver(napi_env env, napi_callback_info info);
45 
46 public:
47     static napi_value JsGetImageSize(napi_env env, napi_callback_info info);
48     static napi_value JsGetImageComponentTypes(napi_env env, napi_callback_info info);
49     static napi_value JsGetImageByteBuffer(napi_env env, napi_callback_info info);
50     static napi_value JsGetImageBufferSize(napi_env env, napi_callback_info info);
51     static napi_value JsGetImageRowStride(napi_env env, napi_callback_info info);
52     static napi_value JsGetImagePixelStride(napi_env env, napi_callback_info info);
53     static napi_value JsReleaseImage(napi_env env, napi_callback_info info);
54 };
55 
56 } // namespace Media
57 } // namespace OHOS
58 
59 #endif // IMAGE_RECEIVER_TEST_H