ホーム › Graphics.Imaging › WICJpegFrameHeader
WICJpegFrameHeader
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Width | DWORD | 4 | +0 | +0 | JPEGフレームの幅(ピクセル単位)。 |
| Height | DWORD | 4 | +4 | +4 | JPEGフレームの高さ(ピクセル単位)。 |
| TransferMatrix | WICJpegTransferMatrix | 4 | +8 | +8 | 色空間変換に用いる転送行列を示すWICJpegTransferMatrix列挙値。 |
| ScanType | WICJpegScanType | 4 | +12 | +12 | 走査方式(ベースライン/プログレッシブ等)を示すWICJpegScanType列挙値。 |
| cComponents | DWORD | 4 | +16 | +16 | フレーム内の色成分数。グレースケールは1、YCbCrは3等。 |
| ComponentIdentifiers | DWORD | 4 | +20 | +20 | 各色成分の識別子をパックしたDWORD。最大4成分分を格納する。 |
| SampleFactors | DWORD | 4 | +24 | +24 | 各成分の水平・垂直サンプリング係数をパックしたDWORD。 |
| QuantizationTableIndices | DWORD | 4 | +28 | +28 | 各成分が使用する量子化テーブルのインデックスをパックしたDWORD。 |
各言語での定義
#include <windows.h>
// WICJpegFrameHeader (x64 32 / x86 32 バイト)
typedef struct WICJpegFrameHeader {
DWORD Width;
DWORD Height;
WICJpegTransferMatrix TransferMatrix;
WICJpegScanType ScanType;
DWORD cComponents;
DWORD ComponentIdentifiers;
DWORD SampleFactors;
DWORD QuantizationTableIndices;
} WICJpegFrameHeader;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WICJpegFrameHeader
{
public uint Width;
public uint Height;
public int TransferMatrix;
public int ScanType;
public uint cComponents;
public uint ComponentIdentifiers;
public uint SampleFactors;
public uint QuantizationTableIndices;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WICJpegFrameHeader
Public Width As UInteger
Public Height As UInteger
Public TransferMatrix As Integer
Public ScanType As Integer
Public cComponents As UInteger
Public ComponentIdentifiers As UInteger
Public SampleFactors As UInteger
Public QuantizationTableIndices As UInteger
End Structureimport ctypes
from ctypes import wintypes
class WICJpegFrameHeader(ctypes.Structure):
_fields_ = [
("Width", wintypes.DWORD),
("Height", wintypes.DWORD),
("TransferMatrix", ctypes.c_int),
("ScanType", ctypes.c_int),
("cComponents", wintypes.DWORD),
("ComponentIdentifiers", wintypes.DWORD),
("SampleFactors", wintypes.DWORD),
("QuantizationTableIndices", wintypes.DWORD),
]#[repr(C)]
pub struct WICJpegFrameHeader {
pub Width: u32,
pub Height: u32,
pub TransferMatrix: i32,
pub ScanType: i32,
pub cComponents: u32,
pub ComponentIdentifiers: u32,
pub SampleFactors: u32,
pub QuantizationTableIndices: u32,
}import "golang.org/x/sys/windows"
type WICJpegFrameHeader struct {
Width uint32
Height uint32
TransferMatrix int32
ScanType int32
cComponents uint32
ComponentIdentifiers uint32
SampleFactors uint32
QuantizationTableIndices uint32
}type
WICJpegFrameHeader = record
Width: DWORD;
Height: DWORD;
TransferMatrix: Integer;
ScanType: Integer;
cComponents: DWORD;
ComponentIdentifiers: DWORD;
SampleFactors: DWORD;
QuantizationTableIndices: DWORD;
end;const WICJpegFrameHeader = extern struct {
Width: u32,
Height: u32,
TransferMatrix: i32,
ScanType: i32,
cComponents: u32,
ComponentIdentifiers: u32,
SampleFactors: u32,
QuantizationTableIndices: u32,
};type
WICJpegFrameHeader {.bycopy.} = object
Width: uint32
Height: uint32
TransferMatrix: int32
ScanType: int32
cComponents: uint32
ComponentIdentifiers: uint32
SampleFactors: uint32
QuantizationTableIndices: uint32struct WICJpegFrameHeader
{
uint Width;
uint Height;
int TransferMatrix;
int ScanType;
uint cComponents;
uint ComponentIdentifiers;
uint SampleFactors;
uint QuantizationTableIndices;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WICJpegFrameHeader サイズ: 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 も可)
; TransferMatrix : WICJpegTransferMatrix (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ScanType : WICJpegScanType (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; cComponents : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ComponentIdentifiers : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; SampleFactors : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; QuantizationTableIndices : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WICJpegFrameHeader
#field int Width
#field int Height
#field int TransferMatrix
#field int ScanType
#field int cComponents
#field int ComponentIdentifiers
#field int SampleFactors
#field int QuantizationTableIndices
#endstruct
stdim st, WICJpegFrameHeader ; NSTRUCT 変数を確保
st->Width = 100
mes "Width=" + st->Width