Win32 API 日本語リファレンス
ホームMedia.MediaFoundation › DetectedFaceBound

DetectedFaceBound

構造体
サイズx64: 32 バイト / x86: 32 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
sizeInBytesDWORD4+0+0この構造体のバイトサイズ。
normalizedXPositionFLOAT4+4+4検出顔領域左上のX座標(0.0〜1.0の正規化値)。
normalizedYPositionFLOAT4+8+8検出顔領域左上のY座標(0.0〜1.0の正規化値)。
normalizedWidthFLOAT4+12+12検出顔領域の幅(0.0〜1.0の正規化値)。
normalizedHeightFLOAT4+16+16検出顔領域の高さ(0.0〜1.0の正規化値)。
confidenceValueINT4+20+20顔検出の信頼度を示す値。
flagsULONGLONG8+24+24検出顔に関する属性を示す64ビットのビットフラグ。

各言語での定義

#include <windows.h>

// DetectedFaceBound  (x64 32 / x86 32 バイト)
typedef struct DetectedFaceBound {
    DWORD sizeInBytes;
    FLOAT normalizedXPosition;
    FLOAT normalizedYPosition;
    FLOAT normalizedWidth;
    FLOAT normalizedHeight;
    INT confidenceValue;
    ULONGLONG flags;
} DetectedFaceBound;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DetectedFaceBound
{
    public uint sizeInBytes;
    public float normalizedXPosition;
    public float normalizedYPosition;
    public float normalizedWidth;
    public float normalizedHeight;
    public int confidenceValue;
    public ulong flags;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DetectedFaceBound
    Public sizeInBytes As UInteger
    Public normalizedXPosition As Single
    Public normalizedYPosition As Single
    Public normalizedWidth As Single
    Public normalizedHeight As Single
    Public confidenceValue As Integer
    Public flags As ULong
End Structure
import ctypes
from ctypes import wintypes

class DetectedFaceBound(ctypes.Structure):
    _fields_ = [
        ("sizeInBytes", wintypes.DWORD),
        ("normalizedXPosition", ctypes.c_float),
        ("normalizedYPosition", ctypes.c_float),
        ("normalizedWidth", ctypes.c_float),
        ("normalizedHeight", ctypes.c_float),
        ("confidenceValue", ctypes.c_int),
        ("flags", ctypes.c_ulonglong),
    ]
#[repr(C)]
pub struct DetectedFaceBound {
    pub sizeInBytes: u32,
    pub normalizedXPosition: f32,
    pub normalizedYPosition: f32,
    pub normalizedWidth: f32,
    pub normalizedHeight: f32,
    pub confidenceValue: i32,
    pub flags: u64,
}
import "golang.org/x/sys/windows"

type DetectedFaceBound struct {
	sizeInBytes uint32
	normalizedXPosition float32
	normalizedYPosition float32
	normalizedWidth float32
	normalizedHeight float32
	confidenceValue int32
	flags uint64
}
type
  DetectedFaceBound = record
    sizeInBytes: DWORD;
    normalizedXPosition: Single;
    normalizedYPosition: Single;
    normalizedWidth: Single;
    normalizedHeight: Single;
    confidenceValue: Integer;
    flags: UInt64;
  end;
const DetectedFaceBound = extern struct {
    sizeInBytes: u32,
    normalizedXPosition: f32,
    normalizedYPosition: f32,
    normalizedWidth: f32,
    normalizedHeight: f32,
    confidenceValue: i32,
    flags: u64,
};
type
  DetectedFaceBound {.bycopy.} = object
    sizeInBytes: uint32
    normalizedXPosition: float32
    normalizedYPosition: float32
    normalizedWidth: float32
    normalizedHeight: float32
    confidenceValue: int32
    flags: uint64
struct DetectedFaceBound
{
    uint sizeInBytes;
    float normalizedXPosition;
    float normalizedYPosition;
    float normalizedWidth;
    float normalizedHeight;
    int confidenceValue;
    ulong flags;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DetectedFaceBound サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; sizeInBytes : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; normalizedXPosition : FLOAT (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; normalizedYPosition : FLOAT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; normalizedWidth : FLOAT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; normalizedHeight : FLOAT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; confidenceValue : INT (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; flags : ULONGLONG (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DetectedFaceBound
    #field int sizeInBytes
    #field float normalizedXPosition
    #field float normalizedYPosition
    #field float normalizedWidth
    #field float normalizedHeight
    #field int confidenceValue
    #field int64 flags
#endstruct

stdim st, DetectedFaceBound        ; NSTRUCT 変数を確保
st->sizeInBytes = 100
mes "sizeInBytes=" + st->sizeInBytes