summaryrefslogtreecommitdiff
path: root/bsp/nxp/imx/imxrt/libraries/drivers/vglite/elementary/src/elm_headers.h
blob: 70937c8ad0c5d32311e8c950e8ea8e3b3ef72ad9 (plain)
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
/****************************************************************************
*
*    Copyright 2021 Vivante Corporation, Santa Clara, California.
*    All Rights Reserved.
*
*    Permission is hereby granted, free of charge, to any person obtaining
*    a copy of this software and associated documentation files (the
*    'Software'), to deal in the Software without restriction, including
*    without limitation the rights to use, copy, modify, merge, publish,
*    distribute, sub license, and/or sell copies of the Software, and to
*    permit persons to whom the Software is furnished to do so, subject
*    to the following conditions:
*
*    The above copyright notice and this permission notice (including the
*    next paragraph) shall be included in all copies or substantial
*    portions of the Software.
*
*    THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
*    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
*    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
*    IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
*    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
*    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
*    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*****************************************************************************/

#ifndef __ELM_HEADERS_H__
#define __ELM_HEADERS_H__


#define ATTR_PACKED __attribute__((packed, aligned(4)))


typedef struct {
    vg_lite_matrix_t          matrix;
    uint32_t                  reserved;
    uint32_t                  stop_count;
    uint32_t                  stop_offset;
    uint32_t                  color_offset;
} el_EVO_GradData;

typedef struct {
    vg_lite_radial_gradient_parameter_t params;
    vg_lite_radial_gradient_spreadmode_t spread_mode;
} el_EVO_RadGradDataExt;

struct el_PaintType_t {
    uint32_t                  paint:28;
    uint32_t                  flags:1;
    uint32_t                  is_image:1;
    uint32_t                  is_pattern:1;
    uint32_t                  has_pattern:1;
};

typedef struct ATTR_PACKED {
    uint32_t                  type;
    vg_lite_float_t           min_x, min_y, max_x, max_y;
    uint32_t                  format;
    uint32_t                  length:31;
    uint32_t                  arc_flag:1;
    uint32_t                  offset;
    vg_lite_matrix_t          matrix;
    uint32_t                  reserved;
    uint32_t                  quality;
    uint32_t                  fill_rule;
    uint32_t                  blend;
    union {
        uint32_t              paint_data;
        struct el_PaintType_t paint_type;
    };
    vg_lite_color_t           color;
    el_EVO_GradData           grad;
} el_EVO_Polygon;

typedef struct ATTR_PACKED {
    uint32_t                  type;
    uint32_t                  namelength;
    char                      eboname[76];
    union {
        uint32_t              paint_data;
        struct el_PaintType_t paint_type;
    };
    vg_lite_matrix_t          matrix;
    uint32_t                  width;
    uint32_t                  height;
} el_EVO_Image;

typedef struct ATTR_PACKED {
    union {
        el_EVO_Polygon        polygon;
        el_EVO_Image          image;
    };
} el_EVO_Header;

typedef struct ATTR_PACKED {
    uint32_t                  type;
    uint32_t                  size_font_block;
    uint32_t                  num_ttf_fonts;
    uint32_t                  num_vector_fonts;
    uint32_t                  num_text_fonts;
    uint32_t                  ttf_fonts_block_offset;
    uint32_t                  ttf_fonts_block_length;
    uint32_t                  vector_fonts_block_offset;
    uint32_t                  vector_fonts_block_length;
    uint32_t                  text_fonts_block_offset;
    uint32_t                  text_fonts_block_length;
    uint32_t                  property_block_offset;
    uint32_t                  property_block_length;
} el_Font_Header;

struct el_TextFlags_t {
    uint32_t                  flags1:1;
    uint32_t                  text_anchor:2;
    uint32_t                  flags2:29;
};

typedef struct ATTR_PACKED {
    uint32_t                  type;
    uint32_t                  size_text_block;
    uint32_t                  tspan_has_dx_dy;
    float                     x_pos;
    float                     y_pos;
    float                     font_size;
    uint32_t                  font_id;
    uint32_t                  color;
    union {
        uint32_t              flags_data;
        struct el_TextFlags_t text_flags;
    };
    vg_lite_matrix_t          matrix;
    uint32_t                  reserved;
    uint16_t                  data_length;
} el_Text_Header;

typedef struct ATTR_PACKED {
    uint32_t                  type;
    uint32_t                  width;
    uint32_t                  height;
    uint32_t                  stride;
    uint32_t                  tiled;
    uint32_t                  format;
    uint32_t                  data_offset;
} el_EBO_Header;

typedef struct ATTR_PACKED {
    uint32_t                  clut_count;
    uint32_t                  clut_data_offset;
} el_EBO_Palette;

typedef struct ATTR_PACKED {
    uint32_t                  type;
    vg_lite_matrix_t          matrix;
    uint32_t                  count;
} el_EGO_Header;


#endif /* __ELM_HEADERS_H__ */