Pebble Draw Commands are the vector-graphics format behind
GDrawCommand: an image (.pdc / PDCI) or animation sequence (PDCS) of
stroke/fill commands rendered at runtime. The packed structs and file
magics are defined in fw/applib/graphics/gdraw_command_private.h;
files are generated from SVG or JSON by tools/generate_pdcs/ (the
serializers and format docstring live in
tools/generate_pdcs/pebble_commands.py), and tools/pdc2png renders
them back to PNG. All multi-byte fields are little-endian.
Field |
Type |
Notes |
|---|---|---|
type |
|
1 = path, 2 = circle, 3 = precise path (0 = invalid) |
flags |
|
bit 0: hidden; bits 1–7 reserved |
stroke color |
|
ARGB8 |
stroke width |
|
|
fill color |
|
ARGB8 |
path: open |
|
1 = open path, 0 = closed; second byte unused |
circle: radius |
|
(shares the two bytes above) |
num_points |
|
1 for circles |
points |
|
x, y per point |
Path points are whole pixels; precise-path points are 13.3 fixed-point
(eighths of a pixel). A command list is a uint16_t command count
followed by that many commands.
The SVG converters translate input coordinates by (-0.5, -0.5) and round,
so source coordinates must sit on the half-pixel grid: multiples of
0.5 px for paths and circles, 0.125 px (1/8) for precise paths. Off-grid
points are snapped to the nearest supported coordinate and flagged
(convert_to_pebble_coordinates in
tools/generate_pdcs/pebble_commands.py and the annotation emitted by
tools/libs/pblconvert/pblconvert/svg2pdc/pdc.py).
PDCI (image):
Field |
Type |
|---|---|
magic |
|
payload size |
|
version |
|
reserved |
|
view-box width, height |
|
command list |
PDCS (sequence) replaces the command list with animation frames:
Field |
Type |
|---|---|
magic |
|
payload size |
|
version, reserved, view-box |
as PDCI |
play count |
|
frame count |
|
frames |
|
Generated from PebbleOS 91af4a22c. This page is maintained in the pebbleos repository: docs/reference/formats/pdc.md.