pebble
  • Tutorials
  • Get the SDK
  • Guides
  • Documentation
  • Examples
  • Community
  • Blog
  • More
Privacy
Cookies
Publish

Guides

  • Table of Contents
  • App Resources
    • Animated Image - アニメーション画像
    • App Assets - アセット
    • Converting SVG to PDC
    • Fonts - フォント
    • Images - 画像
    • Pebble Draw Command File Format - PDCファイルについて
    • Platform-specific Resources - 特定のプラットフォーム向けリソースの設定
    • Raw Data Files - 生データ追加とその利用
    • System Fonts - システムフォント一覧
  • Appstore Publishing
  • Best Practices
  • Communication
  • Debugging
  • Design and Interaction
  • Events and Services
  • Graphics and Animations
  • Migrating Older Apps
  • Pebble Packages
  • Pebble Timeline
  • Rocky.js
  • Smartstraps
  • Tools and Resources
  • User Interfaces

Pebble Draw Command File Format - PDCファイルについて

Pebble Draw Commands (PDC) は、画像を構成する各ストローク、塗りつぶしなどの命令を含むバイナリ リソースで構成されるベクター画像ファイルです。これらすべてのコンポーネントのバイト形式を以下の表形式で説明します。

重要: すべてのフィールドはリトルエンディアン形式です!

いくつかの使用制限を持つ実装例は、svg2pdc.py で確認できます。

コンポーネントタイプ

PDC バイナリ ファイルは、次の主要コンポーネントで構成されており、抽象度の昇順に示されています:

  • Draw Command - 描画される単一の線またはパスの命令。

  • Draw Command List - 形状を構成する Draw Command のセット。

  • Draw Command Frame - 1 つのアニメーション フレームを構成する、設定可能な期間を持つ Draw Command List。これらの多くは Draw Command Sequence で使用されます。

  • Draw Command Image - 単一のベクター画像。

  • Draw Command Sequence - ベクター画像のアニメーション シーケンスを構成する Draw Command Frame のセット。

バージョン

PDC Format Version Implemented
1 Firmware 3.0

ファイル形式コンポーネント

Point

Field Offset (bytes) Size (bytes) Description
X 0 2 X 軸座標。Draw Command タイプに応じて 2 つの形式のいずれかを持ちます(以下を参照):

Path/Circle タイプ: 符号付き整数。
Precise path タイプ: 13.3 固定小数点。
Y 2 2 Y 軸座標。Draw Command タイプに応じて 2 つの形式のいずれかを持ちます(以下を参照):

Path/Circle タイプ: 符号付き整数。
Precise path タイプ: 13.3 固定小数点。

View Box

Field Offset (bytes) Size (bytes) Description
Width 0 2 ビュー ボックスの幅(符号付き整数)。
Height 2 2 ビュー ボックスの高さ(符号付き整数)。

Pebble Draw Command

Field Offset (bytes) Size (bytes) Description
Type 0 1 ドロー コマンド タイプ。可能な値:

0 - Invalid
1 - Path
2 - Circle
3 - Precise path
Flags 1 1 ビット 0: Hidden(Draw Command を描画しない)。
ビット 1-7: 予約済み。
Stroke color 2 1 Pebble カラー(整数)。
Stroke width 3 1 ストローク幅(符号なし整数)。
Fill color 4 1 Pebble カラー(整数)。
Path open/radius 5 2 Path/Precise path タイプ: ビット 0 は、パスがオープン(1)またはクローズ(0)のどちらで描画されるかを示します。
Circle タイプ: 円の半径。
Number of points 7 2 ポイント配列内のポイント数(n)。以下を参照。
Point array 9 n x 4 ポイント数(n)のポイント。

Pebble Draw Command List

Field Offset (bytes) Size (bytes) Description
Number of commands 0 2 この Draw Command List 内の Draw Command の数。(0 は無効)。
Draw Command array 2 n x size of Draw Command 上記で指定された形式の Draw Command のリスト。

Pebble Draw Command Frame

Field Offset (bytes) Size (bytes) Description
Duration 0 2 フレームの期間(ミリ秒単位)。0 の場合、フレームはまったく表示されません(シーケンスの最後のフレームでない限り)。
Command list 2 Size of Draw Command List 上記で指定された形式の Pebble Draw Command List。

Pebble Draw Command Image

Field Offset (bytes) Size (bytes) Description
Version 8 1 ファイル バージョン。
Reserved 9 1 予約済みフィールド。0 でなければなりません。
View box 10 4 画像の境界ボックス。すべての Draw Command は、ビュー ボックスの左上隅を基準にして描画されます。
Command list 14 Size of Draw Command List 上記で指定された形式の Pebble Draw Command List。

Pebble Draw Command Sequence

Field Offset (bytes) Size (bytes) Description
Version 8 1 ファイル バージョン。
Reserved 9 1 予約済みフィールド。0 でなければなりません。
View box 10 4 シーケンスの境界ボックス。すべての Draw Command は、ビュー ボックスの左上隅を基準にして描画されます。
Play count 14 2 シーケンスを繰り返す回数。値 0 では再生がまったく行われませんが、値 0xFFFF では無期限に繰り返されます。
Frame count 16 2 シーケンス内のフレーム数。0 は無効です。
Frame list 18 n x size of Draw Command Frame 上記で指定された形式の Draw Command Frame の配列。

ファイル形式

Pebble Draw Command Image File

Field Offset (bytes) Size (bytes) Description
Magic word 0 4 ASCII 文字で「PDCI」と綴られたもの。
Image size 4 4 Pebble Draw Command Image のサイズ(バイト単位)。
Image 8 Size of Pebble Draw Command Image. 上記で指定された形式の Draw Command Image。

Pebble Draw Command Sequence File

Field Offset (bytes) Size (bytes) Description
Magic word 0 4 ASCII 文字で「PDCS」と綴られたもの。
Sequence size 4 4 Pebble Draw Command Sequence のサイズ(バイト単位)。
Sequence 8 Size of Draw Command Sequence 上記で指定された形式の Draw Command Sequence。
You need JavaScript enabled to read and post comments.

Overview

  • コンポーネントタイプ
  • バージョン
  • ファイル形式コンポーネント
  • Point
  • View Box
  • Pebble Draw Command
  • Pebble Draw Command List
  • Pebble Draw Command Frame
  • Pebble Draw Command Image
  • Pebble Draw Command Sequence
  • ファイル形式
  • Pebble Draw Command Image File
  • Pebble Draw Command Sequence File

Related SDK Docs

Examples

  • PDC Sequence
  • Weather Cards Example