Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
nbgl_image_utils.h
Go to the documentation of this file.
1
6
7#ifndef NBGL_IMAGE_UTILS_H
8#define NBGL_IMAGE_UTILS_H
9
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16/*********************
17 * INCLUDES
18 *********************/
19#include "nbgl_types.h"
20
21/*********************
22 * DEFINES
23 *********************/
27#define WIDTH_OFFSET 0
28
32#define HEIGHT_OFFSET 2
33
37#define BPP_COMPRESS_OFFSET 4
38
43#define BUFFER_LEN_OFFSET 5
44
49#define BUFFER_OFFSET 8
50
54#define IMAGE_FILE_HEADER_SIZE 8
55
56/**********************
57 * MACROS
58 **********************/
59
64#define GET_IMAGE_FILE_WIDTH(image_file) \
65 (image_file[WIDTH_OFFSET] | (image_file[WIDTH_OFFSET + 1] << 8))
66
71#define GET_IMAGE_FILE_HEIGHT(image_file) \
72 (image_file[HEIGHT_OFFSET] | (image_file[HEIGHT_OFFSET + 1] << 8))
73
78#define GET_IMAGE_FILE_BPP(image_file) (image_file[BPP_COMPRESS_OFFSET] >> 4)
79
84#define GET_IMAGE_FILE_COMPRESSION(image_file) (image_file[BPP_COMPRESS_OFFSET] & 0xF)
85
90#define GET_IMAGE_FILE_BUFFER_LEN(image_file) \
91 (image_file[BUFFER_LEN_OFFSET] | (image_file[BUFFER_LEN_OFFSET + 1] << 8) \
92 | (image_file[BUFFER_LEN_OFFSET + 2] << 16))
93
98#define GET_IMAGE_FILE_BUFFER(image_file) (&image_file[BUFFER_OFFSET])
99
100#ifdef __cplusplus
101} /* extern "C" */
102#endif
103
104#endif /* NBGL_IMAGE_UTILS_H */
Included by every low-level NBGL header, to forbid them in apollo app code.
common types for Graphical Library