GIFストリーム・メタデータ形式は、各ファイルのヘッダーに格納された情報、つまりファイルのバージョン、論理表示画面記述子、およびグローバル・カラー表をエンコードします。
論理表示画面記述子には、動画ファイル全体の幅と高さのほかに、カラー解像度(ピクセルごとのビット数)とピクセル縦横比についての情報が記述されています。
グローバル・カラー表には、独自のローカル・カラー表を持たないイメージに使用される色のルックアップ表が含まれています。
<!DOCTYPE "javax_imageio_gif_stream_1.0" [
<!ELEMENT "javax_imageio_gif_stream_1.0" (Version?,
LogicalScreenDescriptor?, GlobalColorTable?)>
<!ELEMENT "Version" EMPTY>
<!-- The file version, either 87a or 89a -->
<!ATTLIST "Version" "value" ("87a" | "89a") #REQUIRED>
<!-- The version string -->
<!ELEMENT "LogicalScreenDescriptor" EMPTY>
<!-- The logical screen descriptor, except for the global color table -->
<!ATTLIST "LogicalScreenDescriptor" "logicalScreenWidth" #CDATA
#REQUIRED>
<!-- The width in pixels of the whole picture -->
<!-- Data type: Integer -->
<!-- Min value: 1 (inclusive) -->
<!-- Max value: 65535 (inclusive) -->
<!ATTLIST "LogicalScreenDescriptor" "logicalScreenHeight" #CDATA
#REQUIRED>
<!-- The height in pixels of the whole picture -->
<!-- Data type: Integer -->
<!-- Min value: 1 (inclusive) -->
<!-- Max value: 65535 (inclusive) -->
<!ATTLIST "LogicalScreenDescriptor" "colorResolution" #CDATA
#REQUIRED>
<!-- The number of bits of color resolution, beteen 1 and 8 -->
<!-- Data type: Integer -->
<!-- Min value: 1 (inclusive) -->
<!-- Max value: 8 (inclusive) -->
<!ATTLIST "LogicalScreenDescriptor" "pixelAspectRatio" #CDATA
#REQUIRED>
<!-- If 0, indicates square pixels, else W/H = (value + 15)/64 -->
<!-- Data type: Integer -->
<!-- Min value: 0 (inclusive) -->
<!-- Max value: 255 (inclusive) -->
<!ELEMENT "GlobalColorTable" (ColorTableEntry)*>
<!-- The global color table -->
<!-- Min children: 2 -->
<!-- Max children: 256 -->
<!ATTLIST "GlobalColorTable" "sizeOfGlobalColorTable" ("2" |
"4" | "8" | "16" | "32" | "64" | "128" | "256") #REQUIRED>
<!-- The number of entries in the global color table -->
<!ATTLIST "GlobalColorTable" "backgroundColorIndex" #CDATA
#REQUIRED>
<!-- The index of the color table entry to be used as a background -->
<!-- Data type: Integer -->
<!-- Min value: 0 (inclusive) -->
<!-- Max value: 255 (inclusive) -->
<!ATTLIST "GlobalColorTable" "sortFlag" ("TRUE" | "FALSE")
#REQUIRED>
<!-- True if the global color table is sorted by frequency -->
<!ELEMENT "ColorTableEntry" EMPTY>
<!-- A global color table entry -->
<!ATTLIST "ColorTableEntry" "index" #CDATA #REQUIRED>
<!-- The index of the color table entry -->
<!-- Data type: Integer -->
<!-- Min value: 0 (inclusive) -->
<!-- Max value: 255 (inclusive) -->
<!ATTLIST "ColorTableEntry" "red" #CDATA #REQUIRED>
<!-- The red value for the color table entry -->
<!-- Data type: Integer -->
<!-- Min value: 0 (inclusive) -->
<!-- Max value: 255 (inclusive) -->
<!ATTLIST "ColorTableEntry" "green" #CDATA #REQUIRED>
<!-- The green value for the color table entry -->
<!-- Data type: Integer -->
<!-- Min value: 0 (inclusive) -->
<!-- Max value: 255 (inclusive) -->
<!ATTLIST "ColorTableEntry" "blue" #CDATA #REQUIRED>
<!-- The blue value for the color table entry -->
<!-- Data type: Integer -->
<!-- Min value: 0 (inclusive) -->
<!-- Max value: 255 (inclusive) -->
]>
GIFイメージ・メタデータ形式は、画像記述子、ローカル・カラー表、およびGIFファイル内の単一のイメージに関連付けられた、アニメーションのフレームなどの拡張情報をエンコードします。
画像記述子には、ストリーム・メタデータ内に記述される論理表示画面内のフレームのオフセットのほかに、フレームの幅と高さ、およびインタレース・エンコーディングが使用されているかどうかが含まれています。
ローカル・カラー表が存在する場合は、現在のフレームのグローバル・カラー表より優先されます。
このグラフィック制御の拡張には、フレームがアニメーションにどのように組み込まれるかについての情報が含まれています。 破棄メソッドは、後続のフレームを表示する前に、現在のフレームを維持するか(doNotDispose)、ストリーム・メタデータで指定された背景色に復元するか(restoreToBackgroundColor)、以前のフレーム・コンテンツに復元するか(restoreToPrevious)を示します。
ユーザー入力フラグは、次のフレームに進む前にユーザー入力のためにアニメーションを一時停止するかどうかを示します。 透明色のフラグおよびインデックスは、フレームのピクセルを描画しないカラー・インデックスを示します。 遅延時間は、フレームが表示される時間を100分の1秒単位で示します。 ユーザー入力フラグを設定し、遅延時間を0にした場合、フレームはユーザー入力でのみ進むことになります。
<!DOCTYPE "javax_imageio_gif_image_1.0" [
<!ELEMENT "javax_imageio_gif_image_1.0" (ImageDescriptor?,
LocalColorTable?, GraphicControlExtension?, PlainTextExtension?,
ApplicationExtensions?, CommentExtensions?)>
<!ELEMENT "ImageDescriptor" EMPTY>
<!-- The image descriptor -->
<!ATTLIST "ImageDescriptor" "imageLeftPosition" #CDATA #REQUIRED>
<!-- The X offset of the image relative to the screen origin -->
<!-- Data type: Integer -->
<!-- Min value: 0 (inclusive) -->
<!-- Max value: 65535 (inclusive) -->
<!ATTLIST "ImageDescriptor" "imageTopPosition" #CDATA #REQUIRED>
<!-- The Y offset of the image relative to the screen origin -->
<!-- Data type: Integer -->
<!-- Min value: 0 (inclusive) -->
<!-- Max value: 65535 (inclusive) -->
<!ATTLIST "ImageDescriptor" "imageWidth" #CDATA #REQUIRED>
<!-- The width of the image -->
<!-- Data type: Integer -->
<!-- Min value: 1 (inclusive) -->
<!-- Max value: 65535 (inclusive) -->
<!ATTLIST "ImageDescriptor" "imageHeight" #CDATA #REQUIRED>
<!-- The height of the image -->
<!-- Data type: Integer -->
<!-- Min value: 1 (inclusive) -->
<!-- Max value: 65535 (inclusive) -->
<!ATTLIST "ImageDescriptor" "interlaceFlag" ("TRUE" | "FALSE")
#REQUIRED>
<!-- True if the image is stored using interlacing -->
<!ELEMENT "LocalColorTable" (ColorTableEntry)*>
<!-- The local color table -->
<!-- Min children: 2 -->
<!-- Max children: 256 -->
<!ATTLIST "LocalColorTable" "sizeOfLocalColorTable" ("2" |
"4" | "8" | "16" | "32" | "64" | "128" | "256") #REQUIRED>
<!-- The number of entries in the local color table -->
<!ATTLIST "LocalColorTable" "sortFlag" ("TRUE" | "FALSE")
#REQUIRED>
<!-- True if the local color table is sorted by frequency -->
<!ELEMENT "ColorTableEntry" EMPTY>
<!-- A local color table entry -->
<!ATTLIST "ColorTableEntry" "index" #CDATA #REQUIRED>
<!-- The index of the color table entry -->
<!-- Data type: Integer -->
<!-- Min value: 0 (inclusive) -->
<!-- Max value: 255 (inclusive) -->
<!ATTLIST "ColorTableEntry" "red" #CDATA #REQUIRED>
<!-- The red value for the color table entry -->
<!-- Data type: Integer -->
<!-- Min value: 0 (inclusive) -->
<!-- Max value: 255 (inclusive) -->
<!ATTLIST "ColorTableEntry" "green" #CDATA #REQUIRED>
<!-- The green value for the color table entry -->
<!-- Data type: Integer -->
<!-- Min value: 0 (inclusive) -->
<!-- Max value: 255 (inclusive) -->
<!ATTLIST "ColorTableEntry" "blue" #CDATA #REQUIRED>
<!-- The blue value for the color table entry -->
<!-- Data type: Integer -->
<!-- Min value: 0 (inclusive) -->
<!-- Max value: 255 (inclusive) -->
<!ELEMENT "GraphicControlExtension" EMPTY>
<!-- A graphic control extension -->
<!ATTLIST "GraphicControlExtension" "disposalMethod" ("none" |
"doNotDispose" | "restoreToBackgroundColor" |
"restoreToPrevious" | "undefinedDisposalMethod4" |
"undefinedDisposalMethod5" | "undefinedDisposalMethod6" |
"undefinedDisposalMethod7") #REQUIRED>
<!-- The disposal method for this frame -->
<!ATTLIST "GraphicControlExtension" "userInputFlag" ("TRUE" |
"FALSE") #REQUIRED>
<!-- True if the frame should be advanced based on user input -->
<!ATTLIST "GraphicControlExtension" "transparentColorFlag" (
"TRUE" | "FALSE") #REQUIRED>
<!-- True if a transparent color exists -->
<!ATTLIST "GraphicControlExtension" "delayTime" #CDATA #REQUIRED>
<!-- The time to delay between frames, in hundredths of a second -->
<!-- Data type: Integer -->
<!-- Min value: 0 (inclusive) -->
<!-- Max value: 65535 (inclusive) -->
<!ATTLIST "GraphicControlExtension" "transparentColorIndex"
#CDATA #REQUIRED>
<!-- The transparent color, if transparentColorFlag is true -->
<!-- Data type: Integer -->
<!-- Min value: 0 (inclusive) -->
<!-- Max value: 255 (inclusive) -->
<!ELEMENT "PlainTextExtension" EMPTY>
<!-- A plain text (text grid) extension -->
<!ATTLIST "PlainTextExtension" "textGridLeft" #CDATA #REQUIRED>
<!-- The X offset of the text grid -->
<!-- Data type: Integer -->
<!-- Min value: 0 (inclusive) -->
<!-- Max value: 65535 (inclusive) -->
<!ATTLIST "PlainTextExtension" "textGridTop" #CDATA #REQUIRED>
<!-- The Y offset of the text grid -->
<!-- Data type: Integer -->
<!-- Min value: 0 (inclusive) -->
<!-- Max value: 65535 (inclusive) -->
<!ATTLIST "PlainTextExtension" "textGridWidth" #CDATA #REQUIRED>
<!-- The number of columns in the text grid -->
<!-- Data type: Integer -->
<!-- Min value: 1 (inclusive) -->
<!-- Max value: 65535 (inclusive) -->
<!ATTLIST "PlainTextExtension" "textGridHeight" #CDATA #REQUIRED>
<!-- The number of rows in the text grid -->
<!-- Data type: Integer -->
<!-- Min value: 1 (inclusive) -->
<!-- Max value: 65535 (inclusive) -->
<!ATTLIST "PlainTextExtension" "characterCellWidth" #CDATA
#REQUIRED>
<!-- The width of a character cell -->
<!-- Data type: Integer -->
<!-- Min value: 1 (inclusive) -->
<!-- Max value: 65535 (inclusive) -->
<!ATTLIST "PlainTextExtension" "characterCellHeight" #CDATA
#REQUIRED>
<!-- The height of a character cell -->
<!-- Data type: Integer -->
<!-- Min value: 1 (inclusive) -->
<!-- Max value: 65535 (inclusive) -->
<!ATTLIST "PlainTextExtension" "textForegroundColor" #CDATA
#REQUIRED>
<!-- The text foreground color index -->
<!-- Data type: Integer -->
<!-- Min value: 0 (inclusive) -->
<!-- Max value: 255 (inclusive) -->
<!ATTLIST "PlainTextExtension" "textBackgroundColor" #CDATA
#REQUIRED>
<!-- The text background color index -->
<!-- Data type: Integer -->
<!-- Min value: 0 (inclusive) -->
<!-- Max value: 255 (inclusive) -->
<!ELEMENT "ApplicationExtensions" (ApplicationExtension)*>
<!-- A set of application extensions -->
<!-- Min children: 1 -->
<!-- Max children: 2147483647 -->
<!ELEMENT "ApplicationExtension" EMPTY>
<!-- An application extension -->
<!-- User object: array of byte -->
<!-- Min length: 0 -->
<!-- Max length: 2147483647 -->
<!ATTLIST "ApplicationExtension" "applicationID" #CDATA
#REQUIRED>
<!-- The application ID -->
<!-- Data type: String -->
<!ATTLIST "ApplicationExtension" "authenticationCode" #CDATA
#REQUIRED>
<!-- The authentication code -->
<!-- Data type: String -->
<!ELEMENT "CommentExtensions" (CommentExtension)*>
<!-- A set of comments -->
<!-- Min children: 1 -->
<!-- Max children: 2147483647 -->
<!ELEMENT "CommentExtension" EMPTY>
<!-- A comment -->
<!ATTLIST "CommentExtension" "value" #CDATA #REQUIRED>
<!-- The comment -->
<!-- Data type: String -->
]>
| 標準メタデータ・コンポーネント | GIFネイティブ・ストリーム・メタデータ・コンポーネント |
|---|---|
| /Chroma/Palette/PaletteEntry@index | /GlobalColorTable/ColorTableEntry@index |
| /Chroma/Palette/PaletteEntry@red | /GlobalColorTable/ColorTableEntry@red |
| /Chroma/Palette/PaletteEntry@green | /GlobalColorTable/ColorTableEntry@green |
| /Chroma/Palette/PaletteEntry@blue | /GlobalColorTable/ColorTableEntry@blue |
| /Chroma/BackgroundIndex@value | /GlobalColorTable@backgroundColorIndex |
| /Data/BitsPerSample@value | /LogicalScreenDescriptor@colorResolution |
| /Dimension/PixelAspectRatio@value | /LogicalScreenDescriptor@pixelAspectRatio |
| /Dimension/HorizontalScreenSize@value | /LogicalScreenDescriptor@logicalScreenWidth |
| /Dimension/VerticalScreenSize@value | /LogicalScreenDescriptor@logicalScreenHeight |
| /Document/FormatVersion@value | /Version@value |
| 標準メタデータ・コンポーネント | GIFネイティブ・イメージ・メタデータ・コンポーネント |
|---|---|
| /Chroma/Palette/PaletteEntry@index | /LocalColorTable/ColorTableEntry@index |
| /Chroma/Palette/PaletteEntry@red | /LocalColorTable/ColorTableEntry@red |
| /Chroma/Palette/PaletteEntry@green | /LocalColorTable/ColorTableEntry@green |
| /Chroma/Palette/PaletteEntry@blue | /LocalColorTable/ColorTableEntry@blue |
| /Dimension/HorizontalPixelOffset@value | /ImageDescriptor@imageLeftPosition |
| /Dimension/VerticalPixelOffset@value | /ImageDescriptor@imageTopPosition |
| /Text/TextEntry@value | /CommentExtensions/CommentExtension@value |
| /Transparency/TransparentIndex@value | /GraphicControlExtension@transparentColorIndex (/GraphicControlExtension@transparentColorFlagも「TRUE」に設定されています) |
バグを報告する、または機能強化を提案する
さらにAPIリファレンスと開発者ドキュメントについては、概念的な概要、用語の定義、回避策、および作業コードの例など、より詳細な開発者向けの説明が含まれている「Java SEドキュメンテーション」を参照してください。
Javaは、米国およびその他の国におけるOracleおよび/またはその関連会社の商標または登録商標です。
Copyright © 1993, 2018, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. 使用は「ライセンス条項」と「ドキュメンテーション再配布ポリシー」に従います。