1 #ifndef __MAIN_H__ 2 #define __MAIN_H__ 3 4 #include <errno.h> 5 #include <fcntl.h> 6 #include <inttypes.h> 7 #include <limits.h> 8 #include <malloc.h> 9 #include <math.h> 10 #include <png.h> 11 #include <poll.h> 12 #include <pthread.h> 13 #include <signal.h> 14 #include <stdbool.h> 15 #include <stdint.h> 16 #include <stdio.h> 17 #include <stdlib.h> 18 #include <string.h> 19 #include <stdarg.h> 20 #include <sys/ioctl.h> 21 #include <sys/mman.h> 22 #include <sys/stat.h> 23 #include <time.h> 24 #include <unistd.h> 25 26 #include <lvgl/lvgl.h> 27 28 #include "lv_port_file.h" 29 #include "lv_port_indev.h" 30 #include "timestamp.h" 31 32 #define ALIGN(x, a) (((x) + (a - 1)) & ~(a - 1)) 33 #define FAKE_FD 1234 34 35 enum { 36 SCALE_MODE_FILL = 0x0, // full screen stretch 37 SCALE_MODE_CONTAIN, // keep the scale, The side with the larger ratio 38 // is aligned with the container, and the other 39 // side is scaled equally 40 SCALE_MODE_COVER, // keep the scale, The side with the smaller ratio 41 // is aligned with the container, and the other 42 // side is scaled equally 43 SCALE_MODE_NONE, 44 }; 45 46 #define RK_LV_IMG_DSC_MAGIC 0x6996a55a 47 48 typedef struct 49 { 50 lv_img_dsc_t img_dsc; 51 uint32_t magic; 52 void (*free)(void *para); 53 void *para; 54 int rot; 55 } rk_lv_img_dsc_t; 56 57 int app_disp_rotation(void); 58 59 #endif 60 61