Deep Zoom Composer 出力ファイルフォーマットを考える

TechCollab2008-05-28


今更ではあるが今日はDeepZoom関連のネタを書いてみようと思う。Silverlight 2では新しくMultiScaleImage Classが追加され、ある処理を施された画像データインタラクティブに操作することができる(具体的な実装についてはhttp://blogs.msdn.com/mohno/archive/2008/03/12/silverlight-2-deep-zoom.aspxなどで紹介されているため省略)。
Deep Zoom の簡単なデモ
しかし、このある処理が施されたということに一癖あって、MultiScaleImageを利用する際には、事前にDeep Zoom Composerで画像の処理をおこない、そこで出力されたデータをSource Propertyに指定するということになっている。

<MultiScaleImage Source="DeepZoomData/info.bin" 
      ViewportWidth="1.0" Width="300" Height="300">
</MultiScaleImage>

このようにMultiScaleImageという一見何か汎用的なことが出来そうな感じのするクラスだがいかんせん限定的なものとなってしまっている。これは他の方々も思っていることであるようだ(下はFirst Look: Silverlight 2.0 UI Controls: ASP Allianceからの引用)。

The MultiScaleImage control is perhaps the worst named control in the current Silverlight 2 UI controls collection. The control is really the required front-end tool for taking advantage of Silverlight's new Deep Zoom technology (formerly Sea Dragon in MS Labs). Deep Zoom enables you to display HUGE images on the web in a ZUI (zoomable user interface) with smooth, animated transitions that give the illusion of seamless image zooming.

じゃあ、Deep Zoop Composerの出力するファイルフォーマット(ex. info.bin)って具体的にどうなっているのだろう、ということを考えてみたところ、色々と調べている方がいた。またここらの話題は各種フォーラムでも話題になっているようだ。そもそも、Deep Zoom Composerに同梱されているSparseImageTool.exeやImageTool.exeを利用してコマンドラインからDeep Zoomファイルを出力することができる。ここではそこらを使いつつうまく解析をしている模様。
Project Silverlight: Deep Zoom items.bin file decoded

彼のフォーマット予想は次の通り。

Bytes (Hex)
00 Version (2)
01-04 UseStringsFile (0)
05-08 MinLevel (0)
09-0C MaxLevel (8)
0D-10 PageSizeLog2 (8)
11-14 ?? - PageQuality? (1)
15-1C ?? - PageFormat? (jpg)
1D-20 NextItemId (6)
21-24 ItemCount (6)
Thumbnail information for 1 thumbnail (Repeat for each thumbnail)
25-28 Thumbnail Id (0)
29-2C MinLevel (0)
2D-30 MaxLevel (8)
31-34 SizeX (0.6953125)
35-38 SizeY (0.521484375)
Item information (Repeat for each item)
9D-A0 Item Id (0)
A0-A4 Init Length (24)
A4-BC Init (test2_images\DSCF0067.sdi)
BD Relative (1)
BE-C1 Type Length (16)
C2-D1 Type (ImagePixelSource)
D2-D5 Thumb (0)

実際に出力されたファイルを見てみてもそのような感じになっているようだ(ちゃんとは見てないが。。。)。

まだBetaの段階なのでなんともいえないが、フォーマット仕様の公開とMultiScaleImageの汎用的な用途が示されればここらはもうちょっとありがたみのあるものになると思う。

今日の本

キャズム

キャズム

ハイテク分野に限らずマーケティング本としてかなりお気に入りの本。