Loading...
Searching...
No Matches
music_art.h
Go to the documentation of this file.
1
15#pragma once
16#include <stdbool.h>
17#include <stdint.h>
18
19// MUSIC_ART_SIDE_MAX and MUSIC_ART_COLOURS_MAX are generated from the phone's cap table, so the two
20// sides cannot drift
21#include "wire/wire_caps.g.h"
22
27
29#define MUSIC_ART_HEADER 3
30
35typedef struct
36{
37 uint8_t width;
38 uint8_t height;
39 uint8_t colours;
40 const uint8_t *palette;
41 const uint8_t *pixels;
42 uint16_t row_bytes;
43} MusicArt;
44
54bool music_art_read(const uint8_t *buf, uint16_t len, MusicArt *out);
55
65void music_art_copy_rows(const MusicArt *art, uint8_t *dst, uint16_t dst_row_bytes);
66
void music_art_copy_rows(const MusicArt *art, uint8_t *dst, uint16_t dst_row_bytes)
Copies the art's rows into a bitmap's own rows.
Definition music_art.c:51
bool music_art_read(const uint8_t *buf, uint16_t len, MusicArt *out)
Reads art off the wire.
Definition music_art.c:11
Art read off the wire. It points into the bytes it was read from, so it lives only as long as they do...
Definition music_art.h:36
const uint8_t * palette
One GColor8 byte for each colour.
Definition music_art.h:40
uint8_t width
Width in pixels, 1 to MUSIC_ART_SIDE_MAX.
Definition music_art.h:37
const uint8_t * pixels
The rows, each row_bytes long.
Definition music_art.h:41
uint8_t colours
How many palette entries follow, 1 to MUSIC_ART_COLOURS_MAX.
Definition music_art.h:39
uint8_t height
Height in pixels, 1 to MUSIC_ART_SIDE_MAX.
Definition music_art.h:38
uint16_t row_bytes
Bytes in one row of pixels, (width + 1) / 2.
Definition music_art.h:42
Strip caps and marker values shared by the phone and the watch.