Repository navigation
Yoshihiro Yamazaki edited this page Nov 27, 2026
·
2 revisions
クラスごとのプロパティとメソッドの一覧です。ヘッダのキーやタグ型ごとのプロパティは 設計、コード例は 利用方 にあります。
require_once 'IO/ICC.php';
| メソッド | 内容 |
|---|---|
parse($iccdata) |
ICC プロファイルを読む。タグの中身は解釈しない。ヘッダが 128 バイトに足りなければ例外 |
build() |
_header と _tags から ICC プロファイルを作って返す |
dump($opts = array()) |
ヘッダ、タグ表、各タグの中身を表示する。$opts['hexdump'] で 16 進ダンプも、$opts['restrict'] で知らないタグ型を例外にする |
dumpHeader($opts = array()) |
ヘッダを表示する |
dumpTagTable($opts = array()) |
タグ表と各タグの中身を表示する |
| プロパティ | 内容 |
|---|---|
_iccdata |
parse() に渡したデータ |
_header |
ヘッダ (設計 の「ヘッダ」) |
_tagTable |
タグ表 (['Signature', 'Offset', 'Size'] の配列) |
_tags |
IO_ICC_Tag の配列 |
IO_ICC::HEADER_SIZE |
128 |
require_once 'IO/ICC/Editor.php'; (IO_ICC を継承)
| メソッド | 内容 |
|---|---|
rebuild($opts = array()) |
解釈できるタグをすべて解釈し、content を null にする (次の build() で全部作り直す) |
deleteTag($delsig) |
シグネチャが $delsig のタグを _tagTable と _tags から消す |
| メソッド | 内容 |
|---|---|
parseTagContent($opts = array()) |
content を解釈して tag に入れる。解釈済みか、解釈できたら true、知らないタグ型なら false ($opts['restrict'] なら例外) |
build($opts = array()) |
タグの中身のバイト列を返す。content が null なら tag から作る |
buildTagContent() |
tag から中身のバイト列を作る (content があればそれを返す) |
dump($opts = array()) |
タグを表示する |
parse($reader, $tagInfo, $opts = array()) |
タグ表のエントリの位置から中身を読む (IO_ICC::parse() の中で使う) |
| プロパティ | 内容 |
|---|---|
signature |
シグネチャ |
type |
タグ型 (中身の先頭 4 バイト) |
content |
中身のバイト列。null にすると build で作り直す |
tag |
解釈した中身 (IO_ICC_Type_*)。未解釈なら null
|
tagInfo |
タグ表のエントリ |
iccInfo |
['Version' => ProfileVersion] |
_Offset / _Size
|
位置と大きさ (build で更新) |
| メソッド | 内容 |
|---|---|
IO_ICC_Type::makeType($content, $iccInfo, $opts = array()) |
タグの中身から IO_ICC_Type_* を作って解釈する。知らない型は false ($opts['restrict'] なら例外) |
IO_ICC_Type::getTypeInfo($tagType, $key) |
$typeMap の値 ('klass' はクラス名の後半、'version' はその型が入った ICC のバージョン)。無ければ false
|
parseContent($content, $opts = array()) |
中身を解釈する (各 IO_ICC_Type_*) |
buildContent($opts = array()) |
中身のバイト列を作る (各 IO_ICC_Type_*) |
dumpContent($opts = array()) |
中身を表示する (各 IO_ICC_Type_*。$opts['level'] が必要) |
getContentLength() |
中身の長さ。curv と para では解釈した部分の長さで、mAB/mBA の中のカーブを区切るのに使う |
IO_ICC_Type_* のプロパティは 設計 の「タグ型」にあります。クラスは IO/ICC/Type/<クラス名>.php にあり、makeType() が読み込みます。
IO_Bit のメソッドに加えて、次のものがあります。
| メソッド | 内容 |
|---|---|
getU8Fixed8Number() / putU8Fixed8Number($value)
|
u8Fixed8Number (16 ビット) と float。書き込みは丸める |
getS15Fixed16Number() / putS15Fixed16Number($value)
|
s15Fixed16Number (32 ビット) と float。書き込みは丸める |
getXYZNumber() / putXYZNumber($xyz)
|
['X', 'Y', 'Z'] (s15Fixed16 を 3 個) |
getDateTimeNumber() / putDateTimeNumber($datetime)
|
['Year', 'Month', 'Day', 'Hours', 'Minutes', 'Seconds'] (16 ビットを 6 個) |
nByteAlign($nByte, $pad = NULL) |
位置を $nByte の倍数に揃える。$pad が null なら読み飛ばし、それ以外は NUL を書く |
| クラス・メソッド | 内容 |
|---|---|
IO_ICC_FixedArray |
SplFixedArray の拡張。slice($offset, $length), join($glue), shuffle()
|
IO_ICC_String::trimNullTerminate($str) |
最初の NUL の手前までを返す |
IO_ICC_String::fixAsciiZ($str) |
最初の NUL の手前までに NUL を 1 つ付けた文字列を返す |
IO_ICC_Util::alignedLength($length, $align) |
$length を $align の倍数に切り上げる |
IO_ICC_Exception |
IO_ICC の例外 (Exception の派生)。ヘッダが短いときだけは Exception
|