Pebble App Framework
v7.1.1
How It Works
CLI
Device API
Phone API
C Coverage
TS Coverage
GitHub
Theme
Pebble App Framework: Device API
Toggle main menu visibility
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
35
typedef
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
54
bool
music_art_read
(
const
uint8_t *buf, uint16_t len,
MusicArt
*out);
55
65
void
music_art_copy_rows
(
const
MusicArt
*art, uint8_t *dst, uint16_t dst_row_bytes);
66
music_art_copy_rows
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
music_art_read
bool music_art_read(const uint8_t *buf, uint16_t len, MusicArt *out)
Reads art off the wire.
Definition
music_art.c:11
MusicArt
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
MusicArt::palette
const uint8_t * palette
One GColor8 byte for each colour.
Definition
music_art.h:40
MusicArt::width
uint8_t width
Width in pixels, 1 to MUSIC_ART_SIDE_MAX.
Definition
music_art.h:37
MusicArt::pixels
const uint8_t * pixels
The rows, each row_bytes long.
Definition
music_art.h:41
MusicArt::colours
uint8_t colours
How many palette entries follow, 1 to MUSIC_ART_COLOURS_MAX.
Definition
music_art.h:39
MusicArt::height
uint8_t height
Height in pixels, 1 to MUSIC_ART_SIDE_MAX.
Definition
music_art.h:38
MusicArt::row_bytes
uint16_t row_bytes
Bytes in one row of pixels, (width + 1) / 2.
Definition
music_art.h:42
wire_caps.g.h
Strip caps and marker values shared by the phone and the watch.
src
c
core
wire
music_art.h
Generated by
1.18.0