vcam_send_buffer

BGRA バッファの送信

vcam_send_buffer buf

buf : BGRA ピクセルデータ変数 (var)

(プラグイン / モジュール : hspvcam)

解説

BGRA 形式のピクセルデータを直接仮想カメラに送信します。
buf には width * height * 4 バイト以上のデータが格納されて
いる必要があります。

ピクセルフォーマットは BGRA (Blue, Green, Red, Alpha) の
4 バイト/ピクセルです。Alpha チャンネルは通常 255 を指定します。
走査方向はトップダウン (先頭バイトが左上ピクセル) です。

stat = 0: 成功, -1: 失敗

この命令は iron_vcam.hsp をインクルードした場合に利用できます。

サンプル

    #include "iron_vcam.hsp"
    w = 640 : h = 480
    vcam_init w, h, 30
    if stat != 0 : end
    ; BGRA バッファを作成 (赤一色)
    sz = w * h * 4
    sdim buf, sz
    repeat w * h
        poke buf, cnt * 4 + 0, 0     ; B
        poke buf, cnt * 4 + 1, 0     ; G
        poke buf, cnt * 4 + 2, 255   ; R
        poke buf, cnt * 4 + 3, 255   ; A
    loop
    vcam_send_buffer buf

関連項目

vcam_send,vcam_send_frame

情報

プラグイン / モジュールhspvcam
バージョン3.8
作成日2026/04/18
著作者IronHSP
URLhttps://github.com/
備考hspvcam.as をインクルードすること。
iron_vcam.hsp を使用する場合は iron_vcam.hsp をインクルードすること。
タイプ拡張命令
グループhspvcam 基本命令
対応環境
  • Windows 版 HSP
hs ファイルhsphelp\iron_vcam.hs