GIFのデータ構造
大カテゴリは以下の3ブロックで構成される。 そのうち、「Extension-Blocks」と「Image-Blocks」はアニメーションなどのデータが入ると複数存在する事になる。Header-Block Extension-Blocks (4 pattern) Image-Blocks Tarminate-block (1 byte) [0x3B]更にサブカテゴリとして、書くブロックは以下のような構造になっている
Header-Block
Signature (3byte) [FWS or CWS] | |||
Version (3byte) [87a or 89a] | |||
Width (2byte) | |||
Height (2byte) | |||
Global Color Flag (1bite) |
Color Resolution (3bite) |
Sort Flag (1bite) |
Global Color Size (3bite) |
Pixel Ratio (1byte) | |||
Global Color Table (n x 3byte) |
Extension-Block (Graphic Control)
Extension Separator (1byte) [0x21] | |||
Extension Label (1byte) [0xF9] | |||
Block Size (1byte) [0x04] | |||
Reserved (3bite) |
Disposal Mothod (3bite) |
User Input Flag (1bite) |
Transparent Color Flag (1bite) |
Delay Time (2byte) | |||
Transparent Color Index (1byte) | |||
Block Terminator (1byte) [0x00] |
Extension-Block (Comment)
Extension Separator (1byte) [0x21] |
Extension Label (1byte) [0xFE] |
Block Size (1byte) |
Comment Data (n byte) |
Block Terminator (1byte) [0x00] |
Extension-Block (Text Control)
Extension Separator (1byte) [0x21] |
Extension Label (1byte) [0x01] |
Block Size (1byte) [0x0C] |
Text Grid Left Position (2byte) |
Text Grid Top Position (2byte) |
Text Grid Width (2byte) |
Text Grid Height (2byte) |
Character Cell Width (1byte) |
Character Cell Height (1byte) |
Text Foreground Color Index (1byte) |
Text Background Color Index (1byte) |
Block Size #2 (1byte) |
Plain Text Data (n byte) |
Block Terminator (1byte) [0x00] |
Extension-Block (Application)
Extension Separator (1byte) [0x21] |
Extension Label (1byte) [0xFF] |
Block Size (1byte) [0x0B] |
Application Identifier (8byte) |
Application Authentication Code (3byte) |
Application Data (n byte) |
Block Terminator (1byte) [0x00] |
Image-Block
Image Separator (1byte) [0x2c] | ||||
Left Position (2byte) | ||||
Top Position (2byte) | ||||
Width (2byte) | ||||
Height (2byte) | ||||
Local Color Flg (1bite) |
Interlace Flg (1bite) |
Sort Flag (1bite) |
Reserved (2bite) |
Size of Local Color Table (3bite) |
Local Color Table (n x 3byte) | ||||
LZW Minimum Code Side (1byte) | ||||
Block Size (1byte) | ||||
Image Data (n byte) | ||||
Block Terminator (1byte) [0x00] |
0 件のコメント:
コメントを投稿