1 /* 2 * Copyright (c) 2022 HiSilicon (Shanghai) Technologies CO., LIMITED. 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 #ifndef SAMPLE_UTILS_H 16 #define SAMPLE_UTILS_H 17 18 #include <stdlib.h> 19 #include <string.h> 20 #include "hi_type.h" 21 22 #ifdef __cplusplus 23 #if __cplusplus 24 extern "C" { 25 #endif 26 #endif /* End of #ifdef __cplusplus */ 27 28 #ifdef __HuaweiLite__ 29 #define SCREEN_WIDTH 320 30 #define SCREEN_HEIGHT 240 31 #else 32 #define SCREEN_WIDTH 240 33 #define SCREEN_HEIGHT 320 34 #endif 35 36 #ifdef __HuaweiLite__ 37 #define RES_PATH "/home/test/auto_sample/res/" 38 #else 39 #define RES_PATH "./res/" 40 #endif 41 42 #define SBFONT_FILE RES_PATH"font/ttf/simhei.ttf" 43 #define MBFONT_FILE RES_PATH"font/ttf/simhei.ttf" 44 45 #define INVALID_HANDLE 0x0 46 47 #define HIGV_CHECK(Function, ret) \ 48 do { \ 49 if ((ret) != HI_SUCCESS) { \ 50 printf("[Func: %s, Line: %d] %s fail ret(x):%x, ret(d): %d\n", \ 51 __FUNCTION__, __LINE__, Function, ret, ret); \ 52 } \ 53 } while (0) 54 55 #ifdef __cplusplus 56 #if __cplusplus 57 } 58 #endif 59 #endif /* End of #ifdef __cplusplus */ 60 61 #endif 62