メタファイル (英: metafile) は、中間情報を記録するためのファイルフォーマット。データそのものではなく、データを再現するためのデータ(メタデータ)を含む。
メタデータを記録して、必要に応じて再生する方式を採用することにより、情報量を削減できるなどのメリットがある。
以下に代表例を示す。 コンピュータグラフィックス (CG) の画像データ(ベクター画像)を保存する形式の一つである。画像そのものではなく、直線や矩形といった図形の描画命令を記録するのが特徴。ラスター画像データ (ビットマップ) を内部に含むことができるものも存在する。 通例、メタファイルは、オペレーティングシステム (OS) の描画APIを経由したグラフィックス描画命令(コマンド)を、モニターやプリンターといったハードウェアデバイス(に関連付けられているメモリ内のデバイスコンテキスト)ではなく、ファイルに出力して記録する。画像を再現するにはそのファイルに記録された描画命令を実行すれば同じ画像が得られる。ただし、グラフィックス描画命令やグラフィックス描画エンジンにOS間の互換性がなく、結果としてメタファイルにも互換性がないことがある。例えば、MacintoshのメタファイルであるPICT(の一部)とOS/2のメタファイルには互換性がないし、WindowsやX Window Systemにも互換性がない。 プリンターレベルで描画を制御する言語をプリンター制御言語ないし ページ記述言語 (PDL) と呼ぶが、PDLの一種であるPostScriptは特に広く用いられたためあたかもメタファイルのような扱いを受け、文書をコンピュータ上でやりとりするためのデータ形式としても用いられた。3DMF
コンピュータグラフィックス・メタファイル
Windowsでのグラフィックスメタファイルの代表的なものとしては、Graphics Device Interface (GDI) APIに対応するWindows Metafileが挙げられる。
プラットフォーム非依存の2次元コンピュータグラフィックスのメタファイル標準規格としては、Computer Graphics Metafile (CGM) やScalable Vector Graphics (SVG) が挙げられる。
3次元コンピュータグラフィックスやCADで使われるファイル形式は多数存在するが、いずれも3次元空間における頂点あるいは面の位置情報や法線情報などを記録するメタファイルである。代表例としてWavefront OBJやDXFが挙げられる。
そのほか、Microsoft Wordのドキュメントファイル (.doc/.docx) やアドビのPortable Document Format (PDF) などもメタファイルの一種である。 ストリーミングで使う、メディアファイル
ストリーミングメディア・メタファイル
ストリーミングの配信者は、メディアファイルの代わりにメタファイルを公開し、メディアファイルへの直接アクセスはプロトコルなどで制限する。
Windows Mediaメタファイル (ASX、WAX、WVX)
RealMediaメタファイル (RAM、RMM)
QuickTimeメタファイル (QTL)
関連項目
MIDI
HTML
.mw-parser-output .asbox{position:relative;overflow:hidden}.mw-parser-output .asbox table{background:transparent}.mw-parser-output .asbox p{margin:0}.mw-parser-output .asbox p+p{margin-top:0.25em}.mw-parser-output .asbox{font-size:90%}.mw-parser-output .asbox-note{font-size:90%}.mw-parser-output .asbox .navbar{position:absolute;top:-0.90em;right:1em;display:none}
この項目は、コンピュータに関連した書きかけの項目です。この項目を加筆・訂正などしてくださる協力者を求めています(PJ:コンピュータ/P:コンピュータ)。
.mw-parser-output .hlist ul,.mw-parser-output .hlist ol{padding-left:0}.mw-parser-output .hlist li,.mw-parser-output .hlist dd,.mw-parser-output .hlist dt{margin-right:0;display:inline-block;white-space:nowrap}.mw-parser-output .hlist dt:after,.mw-parser-output .hlist dd:after,.mw-parser-output .hlist li:after{white-space:normal}.mw-parser-output .hlist li:after,.mw-parser-output .hlist dd:after{content:" ・\a0 ";font-weight:bold}.mw-parser-output .hlist dt:after{content:": "}.mw-parser-output .hlist-pipe dd:after,.mw-parser-output .hlist-pipe li:after{content:" |\a0 ";font-weight:normal}.mw-parser-output .hlist-hyphen dd:after,.mw-parser-output .hlist-hyphen li:after{content:" -\a0 ";font-weight:normal}.mw-parser-output .hlist-comma dd:after,.mw-parser-output .hlist-comma li:after{content:"、";font-weight:normal}.mw-parser-output .hlist-slash dd:after,.mw-parser-output .hlist-slash li:after{content:" /\a0 ";font-weight:normal}.mw-parser-output .hlist dd:last-child:after,.mw-parser-output .hlist dt:last-child:after,.mw-parser-output .hlist li:last-child:after{content:none}.mw-parser-output .hlist dd dd:first-child:before,.mw-parser-output .hlist dd dt:first-child:before,.mw-parser-output .hlist dd li:first-child:before,.mw-parser-output .hlist dt dd:first-child:before,.mw-parser-output .hlist dt dt:first-child:before,.mw-parser-output .hlist dt li:first-child:before,.mw-parser-output .hlist li dd:first-child:before,.mw-parser-output .hlist li dt:first-child:before,.mw-parser-output .hlist li li:first-child:before{content:" (";font-weight:normal}.mw-parser-output .hlist dd dd:last-child:after,.mw-parser-output .hlist dd dt:last-child:after,.mw-parser-output .hlist dd li:last-child:after,.mw-parser-output .hlist dt dd:last-child:after,.mw-parser-output .hlist dt dt:last-child:after,.mw-parser-output .hlist dt li:last-child:after,.mw-parser-output .hlist li dd:last-child:after,.mw-parser-output .hlist li dt:last-child:after,.mw-parser-output .hlist li li:last-child:after{content:")\a0 ";font-weight:normal}.mw-parser-output .hlist ol{counter-reset:listitem}.mw-parser-output .hlist ol>li{counter-increment:listitem}.mw-parser-output .hlist ol>li:before{content:" "counter(listitem)" ";white-space:nowrap}.mw-parser-output .hlist dd ol>li:first-child:before,.mw-parser-output .hlist dt ol>li:first-child:before,.mw-parser-output .hlist li ol>li:first-child:before{content:" ("counter(listitem)" "}.mw-parser-output .navbar{display:inline;font-size:75%;font-weight:normal}.mw-parser-output .navbar-collapse{float:left;text-align:left}.mw-parser-output .navbar-boxtext{word-spacing:0}.mw-parser-output .navbar ul{display:inline-block;white-space:nowrap;line-height:inherit}.mw-parser-output .navbar-brackets::before{margin-right:-0.125em;content:"[ "}.mw-parser-output .navbar-brackets::after{margin-left:-0.125em;content:" ]"}.mw-parser-output .navbar li{word-spacing:-0.125em}.mw-parser-output .navbar-mini abbr{font-variant:small-caps;border-bottom:none;text-decoration:none;cursor:inherit}.mw-parser-output .navbar-ct-full{font-size:114%;margin:0 7em}.mw-parser-output .navbar-ct-mini{font-size:114%;margin:0 4em}.mw-parser-output .infobox .navbar{font-size:88%}.mw-parser-output .navbox .navbar{display:block;font-size:88%}.mw-parser-output .navbox-title .navbar{float:left;text-align:left;margin-right:0.5em}