ホーム › Graphics.Imaging › WICDdsParameters
WICDdsParameters
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Width | DWORD | 4 | +0 | +0 | DDSテクスチャの幅(ピクセル単位)。 |
| Height | DWORD | 4 | +4 | +4 | DDSテクスチャの高さ(ピクセル単位)。 |
| Depth | DWORD | 4 | +8 | +8 | 3Dテクスチャの奥行き(スライス数)。2Dでは1。 |
| MipLevels | DWORD | 4 | +12 | +12 | ミップマップのレベル数。 |
| ArraySize | DWORD | 4 | +16 | +16 | テクスチャ配列の要素数。キューブマップでは6の倍数となる。 |
| DxgiFormat | DXGI_FORMAT | 4 | +20 | +20 | テクスチャのピクセル形式を示すDXGI_FORMAT列挙値。 |
| Dimension | WICDdsDimension | 4 | +24 | +24 | テクスチャの次元(1D/2D/3D)を示すWICDdsDimension列挙値。 |
| AlphaMode | WICDdsAlphaMode | 4 | +28 | +28 | アルファの扱い(プリマルチプライ等)を示すWICDdsAlphaMode列挙値。 |
各言語での定義
#include <windows.h>
// WICDdsParameters (x64 32 / x86 32 バイト)
typedef struct WICDdsParameters {
DWORD Width;
DWORD Height;
DWORD Depth;
DWORD MipLevels;
DWORD ArraySize;
DXGI_FORMAT DxgiFormat;
WICDdsDimension Dimension;
WICDdsAlphaMode AlphaMode;
} WICDdsParameters;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WICDdsParameters
{
public uint Width;
public uint Height;
public uint Depth;
public uint MipLevels;
public uint ArraySize;
public int DxgiFormat;
public int Dimension;
public int AlphaMode;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WICDdsParameters
Public Width As UInteger
Public Height As UInteger
Public Depth As UInteger
Public MipLevels As UInteger
Public ArraySize As UInteger
Public DxgiFormat As Integer
Public Dimension As Integer
Public AlphaMode As Integer
End Structureimport ctypes
from ctypes import wintypes
class WICDdsParameters(ctypes.Structure):
_fields_ = [
("Width", wintypes.DWORD),
("Height", wintypes.DWORD),
("Depth", wintypes.DWORD),
("MipLevels", wintypes.DWORD),
("ArraySize", wintypes.DWORD),
("DxgiFormat", ctypes.c_int),
("Dimension", ctypes.c_int),
("AlphaMode", ctypes.c_int),
]#[repr(C)]
pub struct WICDdsParameters {
pub Width: u32,
pub Height: u32,
pub Depth: u32,
pub MipLevels: u32,
pub ArraySize: u32,
pub DxgiFormat: i32,
pub Dimension: i32,
pub AlphaMode: i32,
}import "golang.org/x/sys/windows"
type WICDdsParameters struct {
Width uint32
Height uint32
Depth uint32
MipLevels uint32
ArraySize uint32
DxgiFormat int32
Dimension int32
AlphaMode int32
}type
WICDdsParameters = record
Width: DWORD;
Height: DWORD;
Depth: DWORD;
MipLevels: DWORD;
ArraySize: DWORD;
DxgiFormat: Integer;
Dimension: Integer;
AlphaMode: Integer;
end;const WICDdsParameters = extern struct {
Width: u32,
Height: u32,
Depth: u32,
MipLevels: u32,
ArraySize: u32,
DxgiFormat: i32,
Dimension: i32,
AlphaMode: i32,
};type
WICDdsParameters {.bycopy.} = object
Width: uint32
Height: uint32
Depth: uint32
MipLevels: uint32
ArraySize: uint32
DxgiFormat: int32
Dimension: int32
AlphaMode: int32struct WICDdsParameters
{
uint Width;
uint Height;
uint Depth;
uint MipLevels;
uint ArraySize;
int DxgiFormat;
int Dimension;
int AlphaMode;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WICDdsParameters サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; Width : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Height : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Depth : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; MipLevels : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ArraySize : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; DxgiFormat : DXGI_FORMAT (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; Dimension : WICDdsDimension (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; AlphaMode : WICDdsAlphaMode (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WICDdsParameters
#field int Width
#field int Height
#field int Depth
#field int MipLevels
#field int ArraySize
#field int DxgiFormat
#field int Dimension
#field int AlphaMode
#endstruct
stdim st, WICDdsParameters ; NSTRUCT 変数を確保
st->Width = 100
mes "Width=" + st->Width