Atelier dddo >PainterCollection > Painter共通 >previw.pix > 詳細(2003.09.01)


という訳で、Painter のWindows版のpreviw.pixの内容を
Appleのサイトの情報を参照しながら詳細に解析しますと、
1ピクセル・ラインごとにRun lengthencodingで圧縮された32ビット
(24ビットカラー)のピクセルマップデータであることが判りました。

Run lengthencodingは同じデータが複数回出現した場合、
そのデータを並べる代わりに回数を記述する、ことを基本とした
圧縮方法の総称ですが…
PICTファイルでの圧縮の詳細は発見できてません(^^;;
…が、適当に規則的なファイルを使うことで解析可能かと。。。?

ちなみにPainterのMac版のプレビューデータは圧縮無しの32ビットデータでした。
(下記のデータのpackTypeが$0001)

header of preview.pix
参考)Version and Header Opcodes
http://developer.apple.com/documentation/mac/QuickDraw/QuickDraw-463.html#MARKER-9-252

0C 8A /* picture size; don't use this value for picture size*/
00 00, 00 00, 00 78, 00 78 /* bounding rectangle of picture */
00 11 /* VersionOp opcode; always $0011 for version 2 */
02 FF /* Version opcode; always $02FF for version 2 */
0C 00 /* HeaderOp opcode; always $0C00 for version 2 */
FF FF FF FF /* version; always -1 (long) for version 2 */
00 00 00 00, 00 00 00 00,
00 78 00 00, 00 78 00 00,
/* fixed-point bounding rectangle for picture */
00 00 00 00 /* reserved */
00 01
/* Clip opcode to define clipping region for picture */
00 0A /* region size */
00 00, 00 00, 00 78, 00 78
/* bounding rectangle for clipping region */

参考)Opcodes in Pictures
http://developer.apple.com/documentation/mac/QuickDraw/QuickDraw-461.html#HEADING461-0
============
00 1A Foreground color ( RGBColor ) 6 byte
00 00 00 00 00 00
00 1B Background color ( RGBColor ) 6 byte
FF FF FF FF FF FF

00 9A DirectBitsRect
PixMap ,srcRect ,dstRect ,mode (Integer ), PixData Variable
PixMap:

http://developer.apple.com/documentation/Carbon/Reference/QuickDraw_Manager/qdref_main/data_type_41.html#//apple_ref/c/tdef/PixMap
00 00 00 FF baseAddr
80 C0 rowBytes
00 00, 00 00, 00 30, 00 30 bounds
00 00 pmVersion
00 04packType
Run length encoding one component at a time, one scan
line at a time, red component first--supported only for
32-bit pixels (24-bit data)
00 00 00 00 packSize
00 60 00 00 hRes
00 60 00 00 vRes
00 10 pixelType
00 20 pixelSize
00 04 cmpCount
00 08 cmpSize
00 00 00 00 planeBytes
00 00 00 00 pmTable
00 00 00 00 pmReserved

00 00 00 00 00 30 00 30 srcRect
00 0A 00 0A 00 3A 00 3A dstRect
00 40 mode (Integer )

PixData
scan lines bounds.bottom($0030) - bounds.top($0000) =$30=48
each scan line consists of [byteCount(=byte)] [data]
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
0A A2 FF 00 19 D2 FF 00 19 D1 FF
(この行にRGB=19,19,FFのピクセルが一つ)
04 82 FF C0 FF
0A A3 FF 00 6C D2 FF 00 6C D0 FF
0A A3 FF 00 16 D2 FF 00 16 D0 FF
0A A3 FF 00 B6 D2 FF 00 B6 D0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
0A A4 FF 00 92 D2 FF 00 92 CF FF
0A A4 FF 00 47 D2 FF 00 47 CF FF
0A A4 FF 00 1E D2 FF 00 1E CF FF
0A A4 FF 00 16 D2 FF 00 16 CF FF
0A A4 FF 00 1C D2 FF 00 1C CF FF
0A A4 FF 00 20 D2 FF 00 20 CF FF
0A A4 FF 00 3B D2 FF 00 3B CF FF
0A A4 FF 00 87 D2 FF 00 87 CF FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
10 A5 FF 03 A3 FF FF 2F D5 FF 03 A3 FF FF 2F D1 FF
0C A5 FF 01 19 20 D3 FF 01 19 20 CF FF
10 A8 FF 03 4C 19 FF 42 D5 FF 03 4C 19 FF 42 CE FF
14 AB FF 01 4F 1E FD FF 00 29 D8 FF 01 4F 1E FD FF 00 29 CE FF
14 AE FF 01 63 21 FA FF 00 1D DB FF 01 63 21 FA FF 00 1D CE FF
14 B1 FF 01 74 19 F7 FF 00 1C DE FF 01 74 19 F7 FF 00 1C CE FF
14 B4 FF 01 7C 1A F4 FF 00 19 E1 FF 01 7C 1A F4 FF 00 19 CE FF
14 B7 FF 01 6A 14 F1 FF 00 19 E4 FF 01 6A 14 F1 FF 00 19 CE FF
14 BA FF 01 67 17 EE FF 00 16 E7 FF 01 67 17 EE FF 00 16 CE FF
14 BD FF 01 5D 1F EB FF 00 1F EA FF 01 5D 1F EB FF 00 1F CE FF
14 C0 FF 01 2F 2C E8 FF 00 55 ED FF 01 2F 2C E8 FF 00 55 CE FF
18 C5 FF 03 45 1F 16 C1 E5 FF 00 4A F2 FF 03 45 1F 16 C1 E5 FF 00 4ACE FF
0A A5 FF 00 1E D2 FF 00 1E CE FF

00 9A DirectBitsRect
PixMap ,srcRect ,dstRect ,mode (Integer ), PixData Variable
00 00 00 FF
80 C0
00 00 00 00 00 30 00 30
00 00
00 04
00 00 00 00
00 60 00 00
00 60 00 00
00 10
00 20
00 04
00 08
00 00 00 00
00 00 00 00
00 00 00 00

00 00 00 00 00 30 00 30
00 0A 00 3A 00 3A 00 6A
00 40
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
0A AE FF 00 1E D2 FF 00 1E C5 FF
0A B0 FF 00 11 D2 FF 00 11 C3 FF
0A B2 FF 00 54 D2 FF 00 54 C1 FF
0A B3 FF 00 1F D2 FF 00 1F C0 FF
0A B5 FF 00 19 D2 FF 00 19 BE FF
0A B7 FF 00 11 D2 FF 00 11 BC FF
0C BA FF 01 6C 29 D3 FF 01 6C 29 BA FF
0C BC FF 01 27 AE D3 FF 01 27 AE B8 FF
0A BE FF 00 18 D2 FF 00 18 B5 FF
0A C0 FF 00 16 D2 FF 00 16 B3 FF
0C C3 FF 01 23 6B D3 FF 01 23 6B B1 FF
0C C6 FF 01 86 16 D3 FF 01 86 16 AE FF
0C C9 FF 01 52 16 D3 FF 01 52 16 AB FF
0C CC FF 01 2C 2B D3 FF 01 2C 2B A8 FF
0C CF FF 01 2C 37 D3 FF 01 2C 37 A5 FF
0A D1 FF 00 29 D2 FF 00 29 A2 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
0A BF FF 00 12 D2 FF 00 12 B4 FF
0A BF FF 00 19 D2 FF 00 19 B4 FF
1A C2 FF 08 6C 20 1C 02 14 1F 2E 24 35 DA FF 08 6C 20 1C 02 14 1F 2E24 35 B9 FF
1E C6 FF 01 72 17 FC FF 00 A7 F9 FF 01 18 13 E3 FF 01 72 17 FC FF 00A7 F9 FF 01 18 13 BE FF
12 C8 FF 00 16 EE FF 00 14 E6 FF 00 16 EE FF 00 14 BF FF
14 CB FF 01 6B 31 F8 FF 00 A2 DD FF 01 6B 31 F8 FF 00 A2 B3 FF

00 9A DirectBitsRect
PixMap ,srcRect ,dstRect ,mode (Integer ), PixData Variable
00 00 00 FF
80 10
00 00, 00 00, 00 30, 00 04
00 00
00 04
00 00 00 00
00 60 00 00
00 60 00 00
00 10
00 20
00 04
00 08
00 00 00 00
00 00 00 00
00 00 00 00

00 00 00 00 00 30 00 04
00 0A 00 6A 00 3A 00 6E
00 40

02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF

00 9A DirectBitsRect
PixMap ,srcRect ,dstRect ,mode (Integer ), PixData Variable
00 00 00 FF
80 C0
00 00 00 00 00 30 00 30
00 00
00 04
00 00 00 00
00 60 00 00
00 60 00 00
00 10
00 20
00 04
00 08
00 00 00 00
00 00 00 00
00 00 00 00

00 00 00 00 00 30 00 30
00 3A 00 0A 00 6A 00 3A
00 40

0A A5 FF 00 19 D2 FF 00 19 CE FF
0A A5 FF 00 71 D2 FF 00 71 CE FF
04 82 FF C0 FF
0A A3 FF 00 1A D2 FF 00 1A D0 FF
0C A5 FF 01 25 6A D3 FF 01 25 6A CF FF
0E A6 FF 02 1B FF 12 D4 FF 02 1B FF 12 CF FF
10 A7 FF 03 20 FF FF 28 D5 FF 03 20 FF FF 28 CF FF
0A A8 FF 00 1B D2 FF 00 1B CB FF
0A A9 FF 00 23 D2 FF 00 23 CA FF
12 AA FF 00 2B FB FF 00 25 D9 FF 00 2B FB FF 00 25 D0 FF
12 AB FF 00 57 FA FF 00 25 DA FF 00 57 FA FF 00 25 D0 FF
04 82 FF C0 FF
0A AC FF 00 A2 D2 FF 00 A2 C7 FF
12 AD FF 00 27 F7 FF 00 16 DD FF 00 27 F7 FF 00 16 D1 FF
12 AE FF 00 1B F6 FF 00 A3 DE FF 00 1B F6 FF 00 A3 D1 FF
0A AF FF 00 CD D2 FF 00 CD C4 FF
04 82 FF C0 FF
0A B0 FF 00 29 D2 FF 00 29 C3 FF
0A B1 FF 00 22 D2 FF 00 22 C2 FF
04 82 FF C0 FF
0A B2 FF 00 71 D2 FF 00 71 C1 FF
0A B3 FF 00 16 D2 FF 00 16 C0 FF
0A B4 FF 00 87 D2 FF 00 87 BF FF
0A B4 FF 00 CF D2 FF 00 CF BF FF
0A B5 FF 00 1C D2 FF 00 1C BE FF
0A B5 FF 00 19 D2 FF 00 19 BE FF
0A B5 FF 00 12 D2 FF 00 12 BE FF
0A B5 FF 00 16 D2 FF 00 16 BE FF
0A B5 FF 00 15 D2 FF 00 15 BE FF
0A B5 FF 00 1C D2 FF 00 1C BE FF
0A B5 FF 00 D5 D2 FF 00 D5 BE FF
04 82 FF C0 FF
0A B4 FF 00 26 D2 FF 00 26 BF FF
0A B4 FF 00 3B D2 FF 00 3B BF FF
0A B3 FF 00 69 D2 FF 00 69 C0 FF
04 82 FF C0 FF
12 B2 FF 00 6E F2 FF 00 15 E2 FF 00 6E F2 FF 00 15 D1 FF
16 B0 FF 01 18 CF F7 FF 01 4A D9 DF FF 01 18 CF F7 FF 01 4A D9 D0FF
1A AE FF 01 8A 17 FD FF 03 6A 20 16 A0 DB FF 01 8A 17 FD FF 03 6A 2016 A0 CE FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF

00 9A DirectBitsRect
PixMap ,srcRect ,dstRect ,mode (Integer ), PixData Variable
00 00 00 FF
80 C0
00 00 00 00 00 30 00 30
00 00
00 04
00 00 00 00
00 60 00 00
00 60 00 00
00 10
00 20
00 04
00 08
00 00 00 00
00 00 00 00
00 00 00 00

00 00 00 00 00 30 00 30
00 3A 00 3A 00 6A 00 6A
00 40

14 CD FF 01 33 B1 F6 FF 00 12 DF FF 01 33 B1 F6 FF 00 12 B3 FF
12 CF FF 00 1A F3 FF 00 5D E1 FF 00 1A F3 FF 00 5D B3 FF
12 D1 FF 00 16 E4 FF 00 A6 F0 FF 00 16 E4 FF 00 A6 C0 FF
12 C1 FF 00 B6 F4 FF 00 49 E0 FF 00 B6 F4 FF 00 49 C0 FF
12 C1 FF 00 13 F4 FF 00 1D E0 FF 00 13 F4 FF 00 1D C0 FF
0A B3 FF 00 15 D2 FF 00 15 C0 FF
12 C2 FF 00 64 F3 FF 00 19 E1 FF 00 64 F3 FF 00 19 C0 FF
12 C2 FF 00 25 F3 FF 00 18 E1 FF 00 25 F3 FF 00 18 C0 FF
0A B3 FF 00 3D D2 FF 00 3D C0 FF
12 C3 FF 00 1E F2 FF 00 56 E2 FF 00 1E F2 FF 00 56 C0 FF
0A B3 FF 00 8D D2 FF 00 8D C0 FF
0A C4 FF 00 62 D2 FF 00 62 AF FF
0A C4 FF 00 22 D2 FF 00 22 AF FF
04 82 FF C0 FF
0A C5 FF 00 1C D2 FF 00 1C AE FF
0A C5 FF 00 A6 D2 FF 00 A6 AE FF
0A D1 FF 00 12 D2 FF 00 12 A2 FF
0A C6 FF 00 12 D2 FF 00 12 AD FF
0A D0 FF 00 50 D2 FF 00 50 A3 FF
1A D0 FF 00 44 F9 FF 00 38 EE FF 00 AF EF FF 00 44 F9 FF 00 38 EE FF00 AF C0 FF
12 C7 FF 00 4C EE FF 00 86 E6 FF 00 4C EE FF 00 86 C0 FF
12 CF FF 00 1D E6 FF 00 67 EE FF 00 1D E6 FF 00 67 C0 FF
12 C8 FF 00 14 ED FF 00 38 E7 FF 00 14 ED FF 00 38 C0 FF
12 CE FF 00 16 E7 FF 00 13 ED FF 00 16 E7 FF 00 13 C0 FF
12 C9 FF 00 14 EC FF 00 39 E8 FF 00 14 EC FF 00 39 C0 FF
0A CD FF 00 21 D2 FF 00 21 A6 FF
12 CA FF 00 17 EC FF 00 6E E8 FF 00 17 EC FF 00 6E BF FF
12 CC FF 00 13 EA FF 00 23 EA FF 00 13 EA FF 00 23 BF FF
0A CB FF 00 1A D2 FF 00 1A A8 FF
14 CC FF 01 32 16 EC FF 00 36 E9 FF 01 32 16 EC FF 00 36 BE FF
0A B5 FF 00 39 D2 FF 00 39 BE FF
10 CD FF 03 66 FF FF 12 D5 FF 03 66 FF FF 12 A9 FF
12 CE FF 00 20 EA FF 00 18 EA FF 00 20 EA FF 00 18 BD FF
1A CF FF 00 18 FC FF 00 22 EF FF 00 B1 EB FF 00 18 FC FF 00 22 EF FF00 B1 BD FF
12 D0 FF 00 36 FA FF 00 23 DA FF 00 36 FA FF 00 23 AB FF
12 D1 FF 00 52 E8 FF 00 17 EC FF 00 52 E8 FF 00 17 BC FF
0A C7 FF 00 52 D2 FF 00 52 AC FF
12 C6 FF 00 17 F4 FF 00 77 E0 FF 00 17 F4 FF 00 77 BB FF
12 C5 FF 00 12 F5 FF 00 1E DF FF 00 12 F5 FF 00 1E BB FF
0A C4 FF 00 77 D2 FF 00 77 AF FF
0A B9 FF 00 1F D2 FF 00 1F BA FF
04 82 FF C0 FF
0A BA FF 00 19 D2 FF 00 19 B9 FF
04 82 FF C0 FF
0A BB FF 00 55 D2 FF 00 55 B8 FF
0A BC FF 00 18 D2 FF 00 18 B7 FF
0A BD FF 00 92 D2 FF 00 92 B6 FF
04 82 FF C0 FF

00 9A DirectBitsRect
PixMap ,srcRect ,dstRect ,mode (Integer ), PixData Variable
00 00 00 FF
80 10
00 00 00 00 00 30 00 04
00 00
00 04
00 00 00 00
00 60 00 00
00 60 00 00
00 10
00 20
00 04
00 08
00 00 00 00
00 00 00 00
00 00 00 00

00 00 00 00 00 30 00 04
00 3A 00 6A 00 6A 00 6E
00 40
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF
02 F1 FF

00 9A DirectBitsRect
PixMap ,srcRect ,dstRect ,mode (Integer ), PixData Variable
00 00 00 FF
80 C0
00 00 00 00 00 04 00 30
00 00
00 04
00 00 00 00
00 60 00 00
00 60 00 00
00 10
00 20
00 04
00 08
00 00 00 00
00 00 00 00
00 00 00 00

00 00 00 00 00 04 00 30
00 6A 00 0A 00 6E 00 3A
00 40

04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF

00 9A DirectBitsRect
PixMap ,srcRect ,dstRect ,mode (Integer ), PixData Variable
00 00 00 FF
80 C0
00 00 00 00 00 04 00 30
00 00
00 04
00 00 00 00
00 60 00 00
00 60 00 00
00 10
00 20
00 04
00 08
00 00 00 00
00 00 00 00
00 00 00 00

00 00 00 00 00 04 00 30
00 6A 00 3A 00 6E 00 6A
00 40

04 82 FF C0 FF (1000 0010 1111 1111 1100 0000 1111 1111
04 82 FF C0 FF
04 82 FF C0 FF
04 82 FF C0 FF

00 9A
DirectBitsRect
PixMap ,srcRect ,dstRect ,mode (Integer ), PixData Variable
00 00 00 FF
80 10
00 00 00 00 00 04 00 04
00 00
00 04
00 00 00 00
00 60 00 00
00 60 00 00
00 10
00 20
00 04
00 08
00 00 00 00
00 00 00 00
00 00 00 00

00 00 00 00 00 04 00 04
00 6A 00 6A 00 6E 00 6E
00 40

02 F1 FF (1111 0001 1111 1111
02 F1 FF
02 F1 FF
02 F1 FF

00 FF

以上