static const char _name ## __raw[] = _file; \
static const char _name ## __file \
[ sizeof ( _name ## __raw ) + 1 ] = _file; \
static const uint32_t _name ## __data[] = _data; \
static struct image _name ## __image = { \
.name = #_name, \
.
data = _name ## __file, \
.
len = (
sizeof ( _name ## __file ) - 1 ), \
}; \
.type = _type, \
.image = & _name ## __image, \
.
data = _name ## __data, \
.
len =
sizeof ( _name ## __data ), \
.width = _width, \
.height = _height, \
};
uint8_t data[48]
Additional event data.
#define IMAGE_STATIC_NAME
Image name is statically allocated.
#define IMAGE_STATIC
Image is statically allocated.
void ref_no_free(struct refcnt *refcnt __unused)
Do not free reference-counted object.
#define REF_INIT(free_fn)
Initialise a static reference counter.
const void * data
Read-only data.
size_t len
Length of pixel data.
Define a pixel buffer test.
38#define PIX( _name, _type, _file, _width, _height, _data ) \
39 static const char _name ## __raw[] = _file; \
40 static const char _name ## __file \
41 [ sizeof ( _name ## __raw ) + 1 ] = _file; \
42 static const uint32_t _name ## __data[] = _data; \
43 static struct image _name ## __image = { \
44 .refcnt = REF_INIT ( ref_no_free ), \
45 .name = #_name, \
46 .flags = ( IMAGE_STATIC | IMAGE_STATIC_NAME ), \
47 .data = _name ## __file, \
48 .len = ( sizeof ( _name ## __file ) - 1 ), \
49 }; \
50 static struct pixel_buffer_test _name = { \
51 .type = _type, \
52 .image = & _name ## __image, \
53 .data = _name ## __data, \
54 .len = sizeof ( _name ## __data ), \
55 .width = _width, \
56 .height = _height, \
57 };