forked from lvgl/lv_lib_split_jpg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lv_sjpg.h
81 lines (63 loc) · 1.44 KB
/
lv_sjpg.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/**
* @file lv_sjpg.h
*
*/
#ifndef _LV_SJPEG_
#define _LV_SJPEG_
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include <stdio.h>
#include "lvgl/lvgl.h"
#include "tjpgd.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
enum io_source_type {
SJPEG_IO_SOURCE_C_ARRAY,
SJPEG_IO_SOURCE_DISK,
};
typedef struct {
enum io_source_type type;
#if LV_USE_FILESYSTEM
lv_fs_file_t lv_file;
#endif
uint8_t* img_cache_buff;
int img_cache_x_res;
int img_cache_y_res;
union {
uint8_t *raw_sjpg_data;
uint32_t file_seek_offset;
};
} io_source_t;
typedef struct {
uint8_t *sjpeg_data;
int sjpeg_x_res;
int sjpeg_y_res;
int sjpeg_total_frames;
int sjpeg_single_frame_height;
int sjpeg_cache_frame_index;
uint8_t **frame_base_array; //to save base address of each split frames upto sjpeg_total_frames.
int *frame_base_offset; //to save base offset for fseek
uint8_t *frame_cache;
uint8_t* workb; //JPG work buffer for jpeg library
JDEC *tjpeg_jd;
io_source_t io;
} SJPEG;
/**********************
* GLOBAL PROTOTYPES
**********************/
void lv_split_jpeg_init(void);
/**********************
* MACROS
**********************/
#ifdef __cplusplus
}
#endif
#endif /* _LV_JPEG_WRAPPER */