1 .\" Copyright (c) 1994, Oracle and/or its affiliates. All rights reserved.
3 .\" Permission is hereby granted, free of charge, to any person obtaining a
4 .\" copy of this software and associated documentation files (the "Software"),
5 .\" to deal in the Software without restriction, including without limitation
6 .\" the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 .\" and/or sell copies of the Software, and to permit persons to whom the
8 .\" Software is furnished to do so, subject to the following conditions:
10 .\" The above copyright notice and this permission notice (including the next
11 .\" paragraph) shall be included in all copies or substantial portions of the
14 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 .\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 .\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 .\" THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 .\" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 .\" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 .\" DEALINGS IN THE SOFTWARE.
21 .TH rasterfile 5 "29 March 1994"
22 .IX "images" "ras" "images" "rasterfile image format \(em \f3rasterfile\f1(5)"
23 .IX "rasterfile" "" "\f3rasterfile\f1(5) \(em raster image format file " ""
25 rasterfile \- Sun's file format for raster images
27 .B #include <pixrect/rasterfile.h>
30 A rasterfile is composed of three parts:
31 first, a header containing 8 integers;
32 second, a (possibly empty) set of colormap values;
33 and third, the pixel image, stored a line at
36 order. The image is layed out in the file
37 as in a memory pixrect. Each line of the
38 image is rounded up to the nearest 16 bits.
41 The header is defined by the following structure:
61 field always contains the following constant:
63 .B #define \s-1RAS_MAGIC\s0 0x59a66a95
70 fields contain the image's width and height in pixels,
71 and its depth in bits per pixel, respectively.
72 The depth is either 1 or 8, corresponding
73 to standard frame buffer depths. The
75 field contains the length in bytes of the image data.
76 For an unencoded image, this number is
82 fields, but for an encoded image it must be explicitly stored in
83 order to be available without decoding the image itself.
84 Note: the length of the header and of
86 colormap values are not included in the value of the
88 field; it is only the image data length.
89 For historical reasons, files of type
91 will usually have a 0 in the
93 field, and software expecting to encounter such files
94 should be prepared to compute the actual
95 image data length if needed. The
99 fields contain the type and length in
100 bytes of the colormap values, respectively. If
106 is not 0, then the colormap values are the
108 bytes immediately after the header.
109 These values are either uninterpreted
110 bytes (usually with the
114 or the equal length red, green and blue
115 vectors, in that order (when the
118 .SM RMT_EQUAL_RGB\s0).
119 In the latter case, the
121 must be three times the size in bytes
122 of any one of the vectors.