2003-07-10 03:28:22 +08:00
|
|
|
|
|
|
|
The GIMP Pattern File Format Version 1 (.pat)
|
|
|
|
------------------------------------------------
|
|
|
|
|
|
|
|
HEADER
|
|
|
|
------
|
|
|
|
|
|
|
|
Bytes 0 - 3: header_size:
|
|
|
|
Type: 32 bit unsigned int
|
|
|
|
Value: size of pattern header (24) + length of pattern name
|
|
|
|
|
|
|
|
Bytes 4 - 7: version
|
|
|
|
Type: 32 bit unsigned int
|
|
|
|
Value: The file format version.
|
|
|
|
|
|
|
|
Bytes 8 - 11: width
|
|
|
|
Type: 32 bit unsigned int
|
|
|
|
Value: Pattern width
|
|
|
|
|
|
|
|
Bytes 12 - 15: height
|
|
|
|
Type: 32 bit unsigned int
|
|
|
|
Value: Pattern height
|
|
|
|
|
|
|
|
Bytes 16 - 19: bytes
|
|
|
|
Type: 32 bit unsigned int
|
2009-06-20 02:44:49 +08:00
|
|
|
Value: Colour depth of pattern
|
2003-07-10 03:28:22 +08:00
|
|
|
1 = greyscale, 2 = greyscale + A, 3 = RGB, 4 = RGBA
|
|
|
|
|
|
|
|
Bytes 20 - 23: magic_number
|
|
|
|
Type: 32 bit unsigned int
|
2009-06-20 02:44:49 +08:00
|
|
|
Value: GIMP pattern magic number.
|
2009-07-07 04:08:45 +08:00
|
|
|
('G' << 24) + ('P' << 16) + ('A' << 8) + 'T'
|
2003-07-10 03:28:22 +08:00
|
|
|
|
2009-06-20 02:44:49 +08:00
|
|
|
Bytes 24 - (header_size - 1):
|
2003-07-10 03:28:22 +08:00
|
|
|
Type: char *
|
2009-06-20 02:44:49 +08:00
|
|
|
Value: UTF-8 string - name of pattern
|
2003-07-10 03:28:22 +08:00
|
|
|
|
|
|
|
|
|
|
|
BODY
|
|
|
|
----
|
|
|
|
Size: width * height * bytes
|
|
|
|
Type: uchar *
|
|
|
|
Value: Pixel values (row-first) for pattern
|
|
|
|
|