add cut bitmask option and debug dump support

Replace auto-cut toggle with --cut bit flags (default 011), wire flags through C/Ruby APIs, and document the new cut/debug-dump behavior in both READMEs.

Made-with: Cursor
This commit is contained in:
knb
2026-04-20 04:22:27 +09:00
parent bfd6adda42
commit e10a430f9e
19 changed files with 255 additions and 38 deletions

View File

@@ -47,6 +47,8 @@ ctest --test-dir build --output-on-failure
**SVG**(拡張子 `.svg`の場合は現在装着中テープの印字可能ドット幅に合わせて自動拡大・縮小しますUSB 接続が必要)。
`--trim-right[=DOTS]` で右側空白列を削減できますDOTS 省略時は左余白ドット、取得失敗時は 0
任意で `-t`0255で二値化しきい値を指定できます。
`--cut BITS` でカット系フラグを指定できます(`[auto-cut][half-cut][chain-print]`、例 `010`)。
指定なしの既定は `011`(オートカットしない / ハーフカットする / つなげて印刷する)です。
**1bit packed ラスター**(行優先、行あたり `ceil(width/8)` バイト × 行数)の場合は `-f` に加え `-w` / `-H` が必須です。
@@ -64,6 +66,12 @@ ctest --test-dir build --output-on-failure
# PNG — しきい値を指定
./build/ptouch-print -n -f label.png -t 160
# カットフラグを指定auto=0, half=1, chain=0
./build/ptouch-print -n -f label.png --cut 010
# デバッグ: USB に送る印字データをファイル保存
./build/ptouch-print -f label.png --debug-dump print_job.bin
# 1bit ラスター — 検証のみ
./build/ptouch-print -n -f sample.raster -w 128 -H 64
@@ -90,6 +98,7 @@ ctest --test-dir build --output-on-failure
- `libptouch_get_status` / `libptouch_status_fprint` — ステータス情報リクエストESC i Sの応答
- `libptouch_get_current_media_info` — 現在テープ幅(mm)・印字可能幅(dots)・DPI・最小余白(mm)を取得
- `libptouch_check_raster` — ラスターバッファの検証のみ
- `libptouch_set_debug_dump_path` — USB bulk OUT へ送った印字データをファイル保存(デバッグ用)
- `libptouch_png_file_to_raster` / `libptouch_free_raster` — PNG を 1bit ラスターに変換libpng
- `libptouch_svg_file_to_raster_fit_current_tape` — SVG を現在テープ幅に合わせて 1bit ラスターへ変換librsvg + cairo、USB 必須)
- `libptouch_print_raster` — ラスター印刷USB・PDF のコマンド列、内部で転置)