1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--Converted with LaTeX2HTML 99.2beta8 (1.46)
original version by: Nikos Drakos, CBLU, University of Leeds
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>B.3 Sun raster files</TITLE>
<META NAME="description" CONTENT="B.3 Sun raster files">
<META NAME="keywords" CONTENT="GMT_Docs">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="LaTeX2HTML v99.2beta8">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="GMT_Docs.css">
<LINK REL="previous" HREF="node113.html">
<LINK REL="up" HREF="node109.html">
<LINK REL="next" HREF="node120.html">
</HEAD>
<BODY bgcolor="#ffffff">
<!--Navigation Panel-->
<A NAME="tex2html2716"
HREF="node120.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.gif"></A>
<A NAME="tex2html2710"
HREF="node109.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.gif"></A>
<A NAME="tex2html2706"
HREF="node118.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.gif"></A>
<A NAME="tex2html2712"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.gif"></A>
<A NAME="tex2html2714"
HREF="node149.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.gif"></A>
<BR>
<B> Next:</B> <A NAME="tex2html2717"
HREF="node120.html">C. Making GMT Encapsulated</A>
<B> Up:</B> <A NAME="tex2html2711"
HREF="node109.html">B. GMT file formats</A>
<B> Previous:</B> <A NAME="tex2html2707"
HREF="node118.html">B.2.3 Boundary Conditions for</A>
  <B> <A NAME="tex2html2713"
HREF="node1.html">Contents</A></B>
  <B> <A NAME="tex2html2715"
HREF="node149.html">Index</A></B>
<BR>
<BR>
<!--End of Navigation Panel-->
<H1><A NAME="SECTION001730000000000000000"></A>
<A NAME="13361"></A>
<BR>
B.3 Sun raster files
</H1>
<P>
The Sun raster file format consists of a header followed by a series
of unsigned 1-byte integers that represents the bit-pattern. Bits
are scanline oriented, and each row must contain an even number of
bytes. The predefined 1-bit
patterns in <A NAME="tex2html596"
HREF="http://www.soest.hawaii.edu/gmt"><B>GMT</B></A> have dimensions of 64 by 64, but other sizes will be
accepted when using the <B>-Gp<IMG
WIDTH="8" HEIGHT="31" ALIGN="MIDDLE" BORDER="0"
SRC="img21.gif"
ALT="$\vert$">P</B> option. The Sun header structure
is outline in Table <A HREF="node119.html#tbl:sunheader">B.2</A>.
<P>
<BR><P></P>
<DIV ALIGN="CENTER"><A NAME="13390"></A>
<TABLE>
<CAPTION><STRONG>Table B.2:</STRONG>
Structure of a Sun rasterfile</CAPTION>
<TR><TD>
<DIV ALIGN="CENTER"></DIV>
<P>
<DIV ALIGN="CENTER"><TABLE CELLPADDING=3 BORDER="1">
<TR><TD ALIGN="CENTER" COLSPAN=1><I>Parameter</I></TD>
<TD ALIGN="CENTER" COLSPAN=1><I>Description</I></TD>
</TR>
<TR><TD ALIGN="LEFT"><B>int</B> <I>ras_magic</I></TD>
<TD ALIGN="LEFT">Magic number</TD>
</TR>
<TR><TD ALIGN="LEFT"><B>int</B> <I>ras_width</I></TD>
<TD ALIGN="LEFT">Width (pixels) of image</TD>
</TR>
<TR><TD ALIGN="LEFT"><B>int</B> <I>ras_height</I></TD>
<TD ALIGN="LEFT">Height (pixels) of image</TD>
</TR>
<TR><TD ALIGN="LEFT"><B>int</B> <I>ras_depth</I></TD>
<TD ALIGN="LEFT">Depth (1, 8, 24, 32 bits) of pixel</TD>
</TR>
<TR><TD ALIGN="LEFT"><B>int</B> <I>ras_length</I></TD>
<TD ALIGN="LEFT">Length (bytes) of image</TD>
</TR>
<TR><TD ALIGN="LEFT"><B>int</B> <I>ras_type</I></TD>
<TD ALIGN="LEFT">Type of file; see RT_* below</TD>
</TR>
<TR><TD ALIGN="LEFT"><B>int</B> <I>ras_maptype</I></TD>
<TD ALIGN="LEFT">Type of colormap; see RMT_* below</TD>
</TR>
<TR><TD ALIGN="LEFT"><B>int</B> <I>ras_maplength</I></TD>
<TD ALIGN="LEFT">Length (bytes) of following map</TD>
</TR>
</TABLE>
</DIV>
<P>
<DIV ALIGN="CENTER">
<A NAME="tbl:sunheader"></A></DIV></TD></TR>
</TABLE>
</DIV><P></P>
<BR>
<P>
After the header, the color map (if <I>ras_maptype</I> is not RMT_NONE)
follows for <I>ras_maplength</I> bytes, followed by an image of
<I>ras_length</I> bytes. Some related definitions are given in Table <A HREF="node119.html#tbl:sundef">B.3</A>.
<P>
<BR><P></P>
<DIV ALIGN="CENTER"><A NAME="13408"></A>
<TABLE>
<CAPTION><STRONG>Table B.3:</STRONG>
Sun macro definitions relevant to rasterfiles</CAPTION>
<TR><TD><A NAME="13398"></A>
<DIV ALIGN="CENTER"><TABLE CELLPADDING=3 BORDER="1">
<TR><TD ALIGN="CENTER" COLSPAN=1><I>Macro name</I></TD>
<TD ALIGN="CENTER" COLSPAN=1><I>Description</I></TD>
</TR>
<TR><TD ALIGN="LEFT">RAS_MAGIC</TD>
<TD ALIGN="LEFT">0x59a66a95</TD>
</TR>
<TR><TD ALIGN="LEFT">RT_STANDARD</TD>
<TD ALIGN="LEFT">1 (Raw pixrect image in 68000 byte order)</TD>
</TR>
<TR><TD ALIGN="LEFT">RT_BYTE_ENCODED</TD>
<TD ALIGN="LEFT">2 (Run-length compression of bytes)</TD>
</TR>
<TR><TD ALIGN="LEFT">RT_FORMAT_RGB</TD>
<TD ALIGN="LEFT">3 ([X]RGB instead of [X]BGR)</TD>
</TR>
<TR><TD ALIGN="LEFT">RMT_NONE</TD>
<TD ALIGN="LEFT">0 (ras_maplength is expected to be 0)</TD>
</TR>
<TR><TD ALIGN="LEFT">RMT_EQUAL_RGB</TD>
<TD ALIGN="LEFT">1 (red[ras_maplength/3],green[],blue[])</TD>
</TR>
</TABLE>
</DIV>
<P>
<DIV ALIGN="CENTER">
<A NAME="tbl:sundef"></A></DIV></TD></TR>
</TABLE>
</DIV><P></P>
<BR>
<P>
Numerous public-domain programs exist, such as <I>xv</I><A NAME="13591"></A> and
<I>convert</I><A NAME="13596"></A> (in the ImageMagick package), that will translate
between various rasterfile formats such as tiff, gif, jpeg, and
Sun raster. Raster patterns may be created with <A NAME="tex2html597"
HREF="http://www.soest.hawaii.edu/gmt"><B>GMT</B></A> plotting
tools by generating <I>PostScript</I> plots that can be rasterized
by <I>ghostscript</I><A NAME="13605"></A> and translated into the right raster format.
<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html2716"
HREF="node120.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.gif"></A>
<A NAME="tex2html2710"
HREF="node109.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.gif"></A>
<A NAME="tex2html2706"
HREF="node118.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.gif"></A>
<A NAME="tex2html2712"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.gif"></A>
<A NAME="tex2html2714"
HREF="node149.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.gif"></A>
<BR>
<B> Next:</B> <A NAME="tex2html2717"
HREF="node120.html">C. Making GMT Encapsulated</A>
<B> Up:</B> <A NAME="tex2html2711"
HREF="node109.html">B. GMT file formats</A>
<B> Previous:</B> <A NAME="tex2html2707"
HREF="node118.html">B.2.3 Boundary Conditions for</A>
  <B> <A NAME="tex2html2713"
HREF="node1.html">Contents</A></B>
  <B> <A NAME="tex2html2715"
HREF="node149.html">Index</A></B>
<!--End of Navigation Panel-->
<ADDRESS>
Paul Wessel
2001-04-18
</ADDRESS>
</BODY>
</HTML>
|