ruby binding 追加

- FFI gem (libptouch)、exe ptouch-print-png(PNG のみ)
- ステータス 32 バイトを Hash に展開(parse_status / status_hash)
- CMake: libptouch 共有ライブラリ(ptouch_shared)
- RuboCop、gemspec(homepage / source_code_uri)

Made-with: Cursor
This commit is contained in:
knb
2026-04-12 16:06:10 +09:00
parent d649b1b014
commit c5c7c2ba52
16 changed files with 889 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ Brother P-touch シリーズ向けのラベル印刷用 **C コアライブラ
| `src/libptouch.c` | ライブラリ本体(スタブ) |
| `src/cli/main.c` | `ptouch-print` エントリ |
| `samples/` | 試験用サンプル画像の置き場PNG 等) |
| `ruby/` | Ruby FFI gem`libptouch`)・コマンド `ptouch-print-png`PNG のみ)— `ruby/README.md` |
| `reference/` | 仕様・参考資料(例: ラスター PDF |
## ビルド
@@ -28,8 +29,13 @@ cmake --build build
成果物(`build/` 以下):
- `libptouch.a` — 静的ライブラリ
- `libptouch.so` — 共有ライブラリRuby FFI 用)
- `ptouch-print` — CLI
### Ruby gem
共有ライブラリをビルドしたうえで、`ruby/``bundle install``gem build libptouch.gemspec` など(手順は `ruby/README.md`)。
## CLI の使い方(雛形)
**PNG**(拡張子 `.png` または PNG シグネチャ)の場合は幅・高さは画像から取得します。任意で `-t`0255で二値化しきい値を指定できます。