From: huffman@donna.gsfc.nasa.gov (George Huffman)
Newsgroups: comp.soft-sys.khoros
Subject: Annotation file format
Date: 24 Jul 92 12:38:16 GMT

Hi - I've been using annotation in editimage to produce publication-ready
images, and discovered that I couldn't find a reference to the annotation
file format.  Recent mail by John Rasure to another user implied the
same thing.  However, I am making many images with minor changes in
the labels, so I'd rather edit the annotation file (it's ASCII),
rather than doing interactive modifications.  Anyway, I've taken a cut at
interpreting the format.  This summary is pretty terse, so the first
time through I'd suggest creating an annotation file in editimage and
comparing that example to my notes.  Corrections and amplifications
are welcome!

George Huffman


-----------------------------------------------------------------------

Khoros Annotation File Format

Khoros 1.0 Patch 5
July 23, 1992
George Huffman/USRA/NASA-GSFC

The Khoros Annotation File is an ASCII text consisting of a header,
then N blocks describing N graphics overlay objects.  All elements
occur on successive lines with no separator lines or indicators.
There is no trailer block or line.  Following the decode explanations
there is an example of a label, a line, and a filled polygon (in that
order) that were created to overlay the Khoros example 'ball.xv'.

----------------- Start header block decode -------------------------- 
Khoros overlay file                          Note! no '#' on first line
#
# Overlay File created with an image of
# the following dimensions:
#
#       width   = W                          Replace W with width
#       height  = H                          Replace H with height
#
-----------------  End header block decode  ---------------------------

----------------- Start object block decode ---------------------------
type                     'line','text','polygon','circle',...
num_of_points            1,2,n for text,line|circle,polygon
X1                       X position of first point
Y1                       Y position of first point
...                      }
Xn                       } additional points (as needed)
Yn                       }
line_width               0 for text
color                    'white','red','green','blue',...
fill                     0|1=F|T; default='0'
text_string              default='*'
font                     default='*'; helvetica-bold.14 is nice on SGI
left_margin_position     x_left-5 for figures, x_left-1 for text
top_margin_position      y_top-5 for figures, y_top-13 for text
object_width             x_right-x_left+10 fig., 11 for single letter
object_height            y_bottom-y_top+10 fig., 15 for single letter
-----------------  End object block decode  ---------------------------

Notes: 

x_left, x_right, y_top, y_bottom refer to the bounding pixel positions
of the object.

The 'text' and 'letter' values in the last 4 lines assume the
helvetica-bold.14 font on SGI; top_margin_position, object_width, and
object_height for text are font-dependent.


----------------- Start annotation file example -----------------------
Khoros overlay file
#
# Overlay File created with an image of
# the following dimensions:
#
#	width   = 512
#	height  = 512
#
text
1
150
83
0
white
0
Underlying image is ball.xv
-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1
149
70
191
18
line
2
171
160
346
344
3
coral
0
*
*
166
155
185
194
polygon
5
200
141
322
146
209
374
312
371
312
371
1
seagreen
1
*
*
196
137
131
242
-----------------  End annotation file example  -----------------------