home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / sgi / 19155 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  28.3 KB

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!olivea!sgigate!sgi!twilight!story
  2. From: story@sgi.com (David (Duis) Story)
  3. Newsgroups: comp.sys.sgi
  4. Subject: Re: SGI FILE FORMAT (please post)
  5. Message-ID: <vcaub1c@twilight.wpd.sgi.com>
  6. Date: 26 Jan 93 19:29:26 GMT
  7. References: <1993Jan22.145252.17916@alchemy.chem.utoronto.ca> <30741@castle.ed.ac.uk>
  8. Sender: news@twilight.wpd.sgi.com ( CNews Account at twilight.wpd.sgi.com )
  9. Organization: Silicon Graphics, Inc.
  10. Lines: 1692
  11.  
  12. In article <30741@castle.ed.ac.uk> eonu24@castle.ed.ac.uk (I Reid) writes:
  13. >Malcolm Bersohn asked:
  14. >  >    Does anyone know where I can find a detailed description of the
  15. >  >file format of the SGI image files?
  16.  
  17. The image format is quite public, it just isn't well publiSHED.
  18.  
  19. Here is a postscript file describing the image file format and the
  20. routines in libimage.a for accessing SGI Images.  See also 'man
  21. istat'.
  22.  
  23. Cheers,
  24.  
  25. David Story                                    Silicon Graphics, Inc.
  26. story@bent.wpd.sgi.com                Mountain View, California
  27.  
  28. I've changed my name, so duis@sgi.com may bounce, please use story@sgi.com.
  29.  
  30. %!PS-Adobe-1.0
  31. %%Creator: manray:paul (Paul Haeberli)
  32. %%Title: stdin (ditroff)
  33. %%CreationDate: Thu Oct 24 13:29:43 1991
  34. %%EndComments
  35. % Start of psdit.pro -- prolog for ditroff translator
  36. % Copyright (c) 1985,1987 Adobe Systems Incorporated. All Rights Reserved. 
  37. % GOVERNMENT END USERS: See Notice file in TranScript library directory
  38. % -- probably /usr/lib/ps/Notice
  39. % RCS: $Header: /cypress/att/usr/src/apps/trscript/lib/RCS/psdit.pro,v 1.3 89/04/26 19:34:25 wiltse Exp $
  40. /$DITroff 140 dict def $DITroff begin
  41. /fontnum 1 def /fontsize 10 def /fontheight 10 def /fontslant 0 def
  42. /xi {0 72 11 mul translate 72 resolution div dup neg scale 0 0 moveto
  43.   /fontnum 1 def /fontsize 10 def /fontheight 10 def /fontslant 0 def F
  44.   /pagesave save def}def
  45. /PB{save /psv exch def currentpoint translate
  46.   resolution 72 div dup neg scale 0 0 moveto}def
  47. /PE{psv restore}def
  48. /m1 matrix def /m2 matrix def /m3 matrix def /oldmat matrix def
  49. /tan{dup sin exch cos div}bind def
  50. /point{resolution 72 div mul}bind def
  51. /dround    {transform round exch round exch itransform}bind def
  52. /xT{/devname exch def}def
  53. /xr{/mh exch def /my exch def /resolution exch def}def
  54. /xp{}def
  55. /xs{docsave restore end}def
  56. /xt{}def
  57. /xf{/fontname exch def /slotno exch def fontnames slotno get fontname eq not
  58.  {fonts slotno fontname findfont put fontnames slotno fontname put}if}def
  59. /xH{/fontheight exch def F}bind def
  60. /xS{/fontslant exch def F}bind def
  61. /s{/fontsize exch def /fontheight fontsize def F}bind def
  62. /f{/fontnum exch def F}bind def
  63. /F{fontheight 0 le {/fontheight fontsize def}if
  64.    fonts fontnum get fontsize point 0 0 fontheight point neg 0 0 m1 astore
  65.    fontslant 0 ne{1 0 fontslant tan 1 0 0 m2 astore m3 concatmatrix}if
  66.    makefont setfont .04 fontsize point mul 0 dround pop setlinewidth}bind def
  67. /X{exch currentpoint exch pop moveto show}bind def
  68. /N{3 1 roll moveto show}bind def
  69. /Y{exch currentpoint pop exch moveto show}bind def
  70. /S /show load def
  71. /ditpush{}def/ditpop{}def
  72. /AX{3 -1 roll currentpoint exch pop moveto 0 exch ashow}bind def
  73. /AN{4 2 roll moveto 0 exch ashow}bind def
  74. /AY{3 -1 roll currentpoint pop exch moveto 0 exch ashow}bind def
  75. /AS{0 exch ashow}bind def
  76. /MX{currentpoint exch pop moveto}bind def
  77. /MY{currentpoint pop exch moveto}bind def
  78. /MXY /moveto load def
  79. /cb{pop}def    % action on unknown char -- nothing for now
  80. /n{}def/w{}def
  81. /p{pop showpage pagesave restore /pagesave save def}def
  82. /abspoint{currentpoint exch pop add exch currentpoint pop add exch}def
  83. /dstroke{currentpoint stroke moveto}bind def
  84. /Dl{2 copy gsave rlineto stroke grestore rmoveto}bind def
  85. /arcellipse{oldmat currentmatrix pop
  86.  currentpoint translate 1 diamv diamh div scale /rad diamh 2 div def
  87.  rad 0 rad -180 180 arc oldmat setmatrix}def
  88. /Dc{gsave dup /diamv exch def /diamh exch def arcellipse dstroke 
  89.     grestore diamh 0 rmoveto}def
  90. /De{gsave /diamv exch def /diamh exch def arcellipse dstroke
  91.     grestore diamh 0 rmoveto}def
  92. /Da{currentpoint /by exch def /bx exch def /fy exch def /fx exch def
  93.    /cy exch def /cx exch def /rad cx cx mul cy cy mul add sqrt def
  94.    /ang1 cy neg cx neg atan def /ang2 fy fx atan def cx bx add cy by add
  95.    2 copy rad ang1 ang2 arcn stroke exch fx add exch fy add moveto}def
  96. /Barray 200 array def % 200 values in a wiggle
  97. /D~{mark}def
  98. /D~~{counttomark Barray exch 0 exch getinterval astore /Bcontrol exch def pop
  99.  /Blen Bcontrol length def Blen 4 ge Blen 2 mod 0 eq and
  100.  {Bcontrol 0 get Bcontrol 1 get abspoint /Ycont exch def /Xcont exch def
  101.   Bcontrol 0 2 copy get 2 mul put Bcontrol 1 2 copy get 2 mul put
  102.   Bcontrol Blen 2 sub 2 copy get 2 mul put
  103.   Bcontrol Blen 1 sub 2 copy get 2 mul put
  104.   /Ybi /Xbi currentpoint 3 1 roll def def 0 2 Blen 4 sub
  105.   {/i exch def
  106.    Bcontrol i get 3 div Bcontrol i 1 add get 3 div
  107.    Bcontrol i get 3 mul Bcontrol i 2 add get add 6 div
  108.    Bcontrol i 1 add get 3 mul Bcontrol i 3 add get add 6 div
  109.    /Xbi Xcont Bcontrol i 2 add get 2 div add def
  110.    /Ybi Ycont Bcontrol i 3 add get 2 div add def
  111.    /Xcont Xcont Bcontrol i 2 add get add def
  112.    /Ycont Ycont Bcontrol i 3 add get add def
  113.    Xbi currentpoint pop sub Ybi currentpoint exch pop sub rcurveto
  114.   }for dstroke}if}def
  115. end
  116. /ditstart{$DITroff begin
  117.  /nfonts 60 def            % NFONTS makedev/ditroff dependent!
  118.  /fonts[nfonts{0}repeat]def
  119.  /fontnames[nfonts{()}repeat]def
  120. /docsave save def
  121. }def
  122.  
  123. % character outcalls
  124. /oc {/pswid exch def /cc exch def /name exch def
  125.    /ditwid pswid fontsize mul resolution mul 72000 div def
  126.    /ditsiz fontsize resolution mul 72 div def
  127.    ocprocs name known{ocprocs name get exec}{name cb}
  128.    ifelse}def
  129. /fractm [.65 0 0 .6 0 0] def
  130. /fraction
  131.  {/fden exch def /fnum exch def gsave /cf currentfont def
  132.   cf fractm makefont setfont 0 .3 dm 2 copy neg rmoveto
  133.   fnum show rmoveto currentfont cf setfont(\244)show setfont fden show 
  134.   grestore ditwid 0 rmoveto} def
  135. /oce {grestore ditwid 0 rmoveto}def
  136. /dm {ditsiz mul}def
  137. /ocprocs 50 dict def ocprocs begin
  138. (14){(1)(4)fraction}def
  139. (12){(1)(2)fraction}def
  140. (34){(3)(4)fraction}def
  141. (13){(1)(3)fraction}def
  142. (23){(2)(3)fraction}def
  143. (18){(1)(8)fraction}def
  144. (38){(3)(8)fraction}def
  145. (58){(5)(8)fraction}def
  146. (78){(7)(8)fraction}def
  147. (sr){gsave .05 dm .16 dm rmoveto(\326)show oce}def
  148. (is){gsave 0 .15 dm rmoveto(\362)show oce}def
  149. (->){gsave 0 .02 dm rmoveto(\256)show oce}def
  150. (<-){gsave 0 .02 dm rmoveto(\254)show oce}def
  151. (==){gsave 0 .05 dm rmoveto(\272)show oce}def
  152. end
  153. % DIThacks fonts for some special chars
  154. 50 dict dup begin
  155. /FontType 3 def
  156. /FontName /DIThacks def
  157. /FontMatrix [.001 0.0 0.0 .001 0.0 0.0] def
  158. /FontBBox [-220 -280 900 900] def% a lie but ...
  159. /Encoding 256 array def
  160. 0 1 255{Encoding exch /.notdef put}for
  161. Encoding
  162.  dup 8#040/space put %space
  163.  dup 8#110/rc put %right ceil
  164.  dup 8#111/lt put %left  top curl
  165.  dup 8#112/bv put %bold vert
  166.  dup 8#113/lk put %left  mid curl
  167.  dup 8#114/lb put %left  bot curl
  168.  dup 8#115/rt put %right top curl
  169.  dup 8#116/rk put %right mid curl
  170.  dup 8#117/rb put %right bot curl
  171.  dup 8#120/rf put %right floor
  172.  dup 8#121/lf put %left  floor
  173.  dup 8#122/lc put %left  ceil
  174.  dup 8#140/sq put %square
  175.  dup 8#141/bx put %box
  176.  dup 8#142/ci put %circle
  177.  dup 8#143/br put %box rule
  178.  dup 8#144/rn put %root extender
  179.  dup 8#145/vr put %vertical rule
  180.  dup 8#146/ob put %outline bullet
  181.  dup 8#147/bu put %bullet
  182.  dup 8#150/ru put %rule
  183.  dup 8#151/ul put %underline
  184.  pop
  185. /DITfd 100 dict def
  186. /BuildChar{0 begin
  187.  /cc exch def /fd exch def
  188.  /charname fd /Encoding get cc get def
  189.  /charwid fd /Metrics get charname get def
  190.  /charproc fd /CharProcs get charname get def
  191.  charwid 0 fd /FontBBox get aload pop setcachedevice
  192.  40 setlinewidth
  193.  newpath 0 0 moveto gsave charproc grestore
  194.  end}def
  195. /BuildChar load 0 DITfd put
  196. %/UniqueID 5 def
  197. /CharProcs 50 dict def
  198. CharProcs begin
  199. /space{}def
  200. /.notdef{}def
  201. /ru{500 0 rls}def
  202. /rn{0 750 moveto 500 0 rls}def
  203. /vr{20 800 moveto 0 -770 rls}def
  204. /bv{20 800 moveto 0 -1000 rls}def
  205. /br{20 770 moveto 0 -1040 rls}def
  206. /ul{0 -250 moveto 500 0 rls}def
  207. /ob{200 250 rmoveto currentpoint newpath 200 0 360 arc closepath stroke}def
  208. /bu{200 250 rmoveto currentpoint newpath 200 0 360 arc closepath fill}def
  209. /sq{80 0 rmoveto currentpoint dround newpath moveto
  210.     640 0 rlineto 0 640 rlineto -640 0 rlineto closepath stroke}def
  211. /bx{80 0 rmoveto currentpoint dround newpath moveto
  212.     640 0 rlineto 0 640 rlineto -640 0 rlineto closepath fill}def
  213. /ci{355 333 rmoveto currentpoint newpath 333 0 360 arc
  214.     50 setlinewidth stroke}def
  215.  
  216. /lt{20 -200 moveto 0 550 rlineto currx 800 2cx s4 add exch s4 a4p stroke}def
  217. /lb{20 800 moveto 0 -550 rlineto currx -200 2cx s4 add exch s4 a4p stroke}def
  218. /rt{20 -200 moveto 0 550 rlineto currx 800 2cx s4 sub exch s4 a4p stroke}def
  219. /rb{20 800 moveto 0 -500 rlineto currx -200 2cx s4 sub exch s4 a4p stroke}def
  220. /lk{20 800 moveto 20 300 -280 300 s4 arcto pop pop 1000 sub
  221.     currentpoint stroke moveto
  222.     20 300 4 2 roll s4 a4p 20 -200 lineto stroke}def
  223. /rk{20 800 moveto 20 300 320 300 s4 arcto pop pop 1000 sub
  224.     currentpoint stroke moveto
  225.     20 300 4 2 roll s4 a4p 20 -200 lineto stroke}def
  226. /lf{20 800 moveto 0 -1000 rlineto s4 0 rls}def
  227. /rf{20 800 moveto 0 -1000 rlineto s4 neg 0 rls}def
  228. /lc{20 -200 moveto 0 1000 rlineto s4 0 rls}def
  229. /rc{20 -200 moveto 0 1000 rlineto s4 neg 0 rls}def
  230. end
  231.  
  232. /Metrics 50 dict def Metrics begin
  233. /.notdef 0 def
  234. /space 500 def
  235. /ru 500 def
  236. /br 0 def
  237. /lt 250 def
  238. /lb 250 def
  239. /rt 250 def
  240. /rb 250 def
  241. /lk 250 def
  242. /rk 250 def
  243. /rc 250 def
  244. /lc 250 def
  245. /rf 250 def
  246. /lf 250 def
  247. /bv 250 def
  248. /ob 350 def
  249. /bu 350 def
  250. /ci 750 def
  251. /bx 750 def
  252. /sq 750 def
  253. /rn 500 def
  254. /ul 500 def
  255. /vr 0 def
  256. end
  257.  
  258. DITfd begin
  259. /s2 500 def /s4 250 def /s3 333 def
  260. /a4p{arcto pop pop pop pop}def
  261. /2cx{2 copy exch}def
  262. /rls{rlineto stroke}def
  263. /currx{currentpoint pop}def
  264. /dround{transform round exch round exch itransform} def
  265. end
  266. end
  267. /DIThacks exch definefont pop
  268.  
  269. ditstart
  270. (psc)xT
  271. 576 1 1 xr
  272. 1(Times-Roman)xf 1 f
  273. 2(Times-Italic)xf 2 f
  274. 3(Times-Bold)xf 3 f
  275. 4(Times-BoldItalic)xf 4 f
  276. 5(Helvetica)xf 5 f
  277. 6(Helvetica-Bold)xf 6 f
  278. 7(Courier)xf 7 f
  279. 8(Courier-Bold)xf 8 f
  280. 9(Symbol)xf 9 f
  281. 10(DIThacks)xf 10 f
  282. 10 s
  283. 1 f
  284. xi
  285. %%EndProlog
  286.  
  287. %%Page: 1 1
  288. 10 s 0 xH 0 xS 1 f
  289. 12 s
  290. 3 f
  291. 1429 688(libimage.a:)N
  292. 1910(Using)X
  293. 2168(The)X
  294. 2352(IRIS)X
  295. 2572(Image)X
  296. 2852(Library)X
  297. 1 f
  298. 10 s
  299. 776 908(IRIS)N
  300. 947(image)X
  301. 1163(\256les)X
  302. 1316(are)X
  303. 1435(used)X
  304. 1602(to)X
  305. 1684(store)X
  306. 1860(1)X
  307. 1920(2)X
  308. 1980(and)X
  309. 2116(3)X
  310. 2177(dimensional)X
  311. 2589(arrays)X
  312. 2807(of)X
  313. 2895(pixel)X
  314. 3076(values)X
  315. 3302(that)X
  316. 3443(contain)X
  317. 3700(either)X
  318. 3904(1)X
  319. 3965(or)X
  320. 576 1004(2)N
  321. 639(bytes)X
  322. 831(per)X
  323. 957(pixel.)X
  324. 1180(Pixel)X
  325. 1367(values)X
  326. 1595(are)X
  327. 1717(signed)X
  328. 1949(integers)X
  329. 2226(that)X
  330. 2369(cover)X
  331. 2571(the)X
  332. 2692(range)X
  333. 2894(0..255)X
  334. 3116(or)X
  335. 3205(-32768..32767)X
  336. 3694(\(i.e.)X
  337. 3841(1)X
  338. 3903(or)X
  339. 3992(2)X
  340. 576 1100(bytes\).)N
  341. 845(Image)X
  342. 1079(\256les)X
  343. 1245(are)X
  344. 1377(currently)X
  345. 1700(used)X
  346. 1880(to)X
  347. 1975(store)X
  348. 2164(rgb)X
  349. 2304(screen)X
  350. 2543(dumps,)X
  351. 2809(black)X
  352. 3016(and)X
  353. 3165(white)X
  354. 3376(images,)X
  355. 3656(color)X
  356. 3854(index)X
  357. 576 1196(images,)N
  358. 846(as)X
  359. 935(well)X
  360. 1095(as)X
  361. 1184(colormaps.)X
  362. 1580(To)X
  363. 1691(use)X
  364. 1820(the)X
  365. 1940(image)X
  366. 2158(library,)X
  367. 2414(put)X
  368. 2538(the)X
  369. 2658(token)X
  370. 2858(-limage)X
  371. 3125(on)X
  372. 3227(the)X
  373. 3347(compile)X
  374. 3627(line)X
  375. 3769(for)X
  376. 3885(your)X
  377. 576 1292(program.)N
  378. 913(Also,)X
  379. 1109(be)X
  380. 1210(sure)X
  381. 1369(to)X
  382. 1456(include)X
  383. 1717(image.h)X
  384. 1998(from)X
  385. 2179(/usr/include/gl)X
  386. 2666(in)X
  387. 2753(any)X
  388. 2894(source)X
  389. 3129(\256les)X
  390. 3287(that)X
  391. 3432(use)X
  392. 3564(these)X
  393. 3754(routines.)X
  394. 576 1388(The)N
  395. 721(following)X
  396. 1052(routines)X
  397. 1330(provide)X
  398. 1595(a)X
  399. 1651(procedural)X
  400. 2015(interface)X
  401. 2317(to)X
  402. 2399(image)X
  403. 2615(\256les:)X
  404. 3 f
  405. 576 1676(Opening)N
  406. 888(and)X
  407. 1036(Closing)X
  408. 1313(an)X
  409. 1417(Image)X
  410. 1651(File)X
  411. 8 f
  412. 864 1820(IMAGE)N
  413. 1152(*iopen\(file,)X
  414. 1776(mode)X
  415. 2016([,)X
  416. 2160(type,)X
  417. 2448(dim,)X
  418. 2688(xsize,)X
  419. 3024(ysize,)X
  420. 3360(zsize]\))X
  421. 864 1916(char)N
  422. 1104(*file;)X
  423. 864 2012(register)N
  424. 1296(char)X
  425. 1536(*mode;)X
  426. 864 2108(unsigned)N
  427. 1296(int)X
  428. 1488(type,)X
  429. 1776(dim,)X
  430. 2016(xsize,)X
  431. 2352(ysize,)X
  432. 2688(zsize;)X
  433. 1 f
  434. 776 2280(Opens)N
  435. 1006(an)X
  436. 1107(image)X
  437. 1328(\256le)X
  438. 1455(for)X
  439. 1574(reading)X
  440. 1840(or)X
  441. 1932(writing)X
  442. 2188(and)X
  443. 2329(returns)X
  444. 2577(a)X
  445. 2638(pointer)X
  446. 2890(to)X
  447. 2977(IMAGE)X
  448. 3265(in)X
  449. 3352(the)X
  450. 3475(same)X
  451. 3665(style)X
  452. 3841(as)X
  453. 3934(the)X
  454. 576 2376(UNIX)N
  455. 801(standard)X
  456. 1097(i/o)X
  457. 1205(library.)X
  458. 1483(A)X
  459. 1565(return)X
  460. 1781(value)X
  461. 1979(of)X
  462. 2070(0)X
  463. 2134(means)X
  464. 2363(the)X
  465. 2485(function)X
  466. 2776(failed)X
  467. 2983(to)X
  468. 3069(successfully)X
  469. 3485(open)X
  470. 3665(the)X
  471. 3787(\256le)X
  472. 3912(that)X
  473. 576 2472(was)N
  474. 721(named.)X
  475. 776 2596(To)N
  476. 890(open)X
  477. 1071(an)X
  478. 1172(image)X
  479. 1393(\256le)X
  480. 1520(for)X
  481. 1639(reading,)X
  482. 1925(iopen)X
  483. 2128(should)X
  484. 2366(be)X
  485. 2467(called)X
  486. 2684(with)X
  487. 2851(2)X
  488. 2916(arguments,)X
  489. 3295(the)X
  490. 3419(name)X
  491. 3619(of)X
  492. 3712(the)X
  493. 3836(image)X
  494. 576 2692(\256le)N
  495. 707(to)X
  496. 798(open)X
  497. 983(and)X
  498. 1128(a)X
  499. 1193(mode)X
  500. 1400(of)X
  501. 1496("r".)X
  502. 1657(The)X
  503. 1810(dimensions)X
  504. 2202(of)X
  505. 2297(the)X
  506. 2423(image)X
  507. 2647(may)X
  508. 2813(be)X
  509. 2917(determined)X
  510. 3306(by)X
  511. 3414(referencing)X
  512. 3809(image-)X
  513. 576 2788(>xsize,)N
  514. 831(image->ysize,)X
  515. 1309(and)X
  516. 1450(image->zsize,)X
  517. 1924(where)X
  518. 2146(image)X
  519. 2367(is)X
  520. 2445(the)X
  521. 2568(value)X
  522. 2767(returned)X
  523. 3060(by)X
  524. 3165(iopen.)X
  525. 3409(xsize)X
  526. 3600(and)X
  527. 3742(ysize)X
  528. 3933(are)X
  529. 576 2884(de\256ned)N
  530. 833(in)X
  531. 916(terms)X
  532. 1115(of)X
  533. 1202(pixels)X
  534. 1413(while)X
  535. 1611(zsize)X
  536. 1792(describes)X
  537. 2111(the)X
  538. 2229(number)X
  539. 2494(of)X
  540. 2581(channels)X
  541. 2882(\(i.e.)X
  542. 3027(layers\))X
  543. 3266(the)X
  544. 3384(image)X
  545. 3600(contains.)X
  546. 3907(The)X
  547. 576 2980(value)N
  548. 776(of)X
  549. 869(image->dim)X
  550. 1287(indicates)X
  551. 1598(whether)X
  552. 1883(the)X
  553. 2007(image)X
  554. 2229(is)X
  555. 2308(just)X
  556. 2449(a)X
  557. 2511(single)X
  558. 2728(row)X
  559. 2880(\(one)X
  560. 3050(dimensional\))X
  561. 3495(or)X
  562. 3589(is)X
  563. 3669(an)X
  564. 3772(array)X
  565. 3965(of)X
  566. 576 3076(rows)N
  567. 752(\(two)X
  568. 919(dimensional\))X
  569. 1357(or)X
  570. 1444(is)X
  571. 1517(an)X
  572. 1613(array)X
  573. 1799(of)X
  574. 1886(2)X
  575. 1946(dimensional)X
  576. 2357(images)X
  577. 2604(\(three)X
  578. 2812(dimensional\).)X
  579. 776 3200(An)N
  580. 894(rgb)X
  581. 1021(image)X
  582. 1238(can)X
  583. 1371(be)X
  584. 1468(thought)X
  585. 1733(of)X
  586. 1821(as)X
  587. 1909(a)X
  588. 1966(set)X
  589. 2076(of)X
  590. 2164(three)X
  591. 2346(2)X
  592. 2407(dimensional)X
  593. 2819(images.)X
  594. 3107(Sometimes)X
  595. 3483(this)X
  596. 3619(is)X
  597. 3693(referred)X
  598. 3970(to)X
  599. 576 3296(as)N
  600. 668(a)X
  601. 729(3)X
  602. 794(channel)X
  603. 1069(image.)X
  604. 1330(An)X
  605. 1453(rgb)X
  606. 1585(color)X
  607. 1775(image)X
  608. 1996(consists)X
  609. 2273(of)X
  610. 2364(3)X
  611. 2428(channels)X
  612. 2733(\(one)X
  613. 2900(channel)X
  614. 3174(each)X
  615. 3346(for)X
  616. 3464(the)X
  617. 3586(red)X
  618. 3713(green)X
  619. 3916(and)X
  620. 576 3392(blue)N
  621. 736(components)X
  622. 1145(of)X
  623. 1234(the)X
  624. 1354(image\))X
  625. 1599(and)X
  626. 1737(is)X
  627. 1812(represented)X
  628. 2205(as)X
  629. 2295(a)X
  630. 2354(three)X
  631. 2538(dimensional)X
  632. 2952(image)X
  633. 3171(that)X
  634. 3314(is)X
  635. 3390(xsize)X
  636. 3578(by)X
  637. 3681(ysize)X
  638. 3869(by)X
  639. 3972(3.)X
  640. 576 3488(A)N
  641. 660(black)X
  642. 860(and)X
  643. 1002(white)X
  644. 1206(image)X
  645. 1428(has)X
  646. 1561(one)X
  647. 1703(channel)X
  648. 1979(and)X
  649. 2121(is)X
  650. 2200(represented)X
  651. 2597(as)X
  652. 2690(a)X
  653. 2752(two)X
  654. 2898(dimensional)X
  655. 3315(image)X
  656. 3537(that)X
  657. 3683(is)X
  658. 3762(xsize)X
  659. 3952(by)X
  660. 576 3584(ysize.)N
  661. 776 3708(Other)N
  662. 988(information)X
  663. 1395(may)X
  664. 1563(be)X
  665. 1669(found)X
  666. 1886(in)X
  667. 1978(image->name)X
  668. 2450(\(holds)X
  669. 2680(the)X
  670. 2808(string)X
  671. 3020(that)X
  672. 3170(is)X
  673. 3253(usually)X
  674. 3514(the)X
  675. 3642(same)X
  676. 3837(as)X
  677. 3934(the)X
  678. 576 3804(actual)N
  679. 801(image)X
  680. 1030(\256lename\),)X
  681. 1386(image->colormap)X
  682. 1990(\(de\256nes)X
  683. 2277(whether)X
  684. 2569(the)X
  685. 2700(image)X
  686. 2929(is)X
  687. 3015(a)X
  688. 3084(series)X
  689. 3300(of)X
  690. 3400(intensity)X
  691. 3708(values,)X
  692. 3965(or)X
  693. 576 3900(color)N
  694. 776(lookup)X
  695. 1033(table)X
  696. 1224(indices,)X
  697. 1506(or)X
  698. 1608(an)X
  699. 1719(actual)X
  700. 1946(colormap\),)X
  701. 2331(image->max)X
  702. 2772(\(the)X
  703. 2933(maximum)X
  704. 3293(intensity)X
  705. 3604(stored)X
  706. 3836(in)X
  707. 3934(the)X
  708. 576 3996(image\),)N
  709. 839(and)X
  710. 975(image->min)X
  711. 1387(\(the)X
  712. 1532(minimum)X
  713. 1862(intensity)X
  714. 2157(stored)X
  715. 2373(in)X
  716. 2455(the)X
  717. 2573(image\).)X
  718. 776 4120(To)N
  719. 890(open)X
  720. 1071(an)X
  721. 1172(image)X
  722. 1393(\256le)X
  723. 1521(for)X
  724. 1641(writing,)X
  725. 1918(iopen)X
  726. 2122(should)X
  727. 2361(be)X
  728. 2463(called)X
  729. 2681(with)X
  730. 2849(7)X
  731. 2915(arguments,)X
  732. 3295(the)X
  733. 3419(name)X
  734. 3619(of)X
  735. 3712(the)X
  736. 3836(image)X
  737. 576 4216(\256le)N
  738. 703(to)X
  739. 790(open,)X
  740. 991(and)X
  741. 1132(a)X
  742. 1193(mode)X
  743. 1396(of)X
  744. 1488("w",)X
  745. 1657(followed)X
  746. 1967(by)X
  747. 2072(the)X
  748. 2195(type,)X
  749. 2378(the)X
  750. 2501(number)X
  751. 2771(of)X
  752. 2863(dimensions)X
  753. 3252(and)X
  754. 3393(the)X
  755. 3516(xsize,)X
  756. 3726(ysize)X
  757. 3916(and)X
  758. 576 4312(zsize)N
  759. 761(of)X
  760. 852(the)X
  761. 974(image.)X
  762. 1234(The)X
  763. 1383(type)X
  764. 1545(indicates)X
  765. 1854(how)X
  766. 2016(many)X
  767. 2218(bytes)X
  768. 2411(are)X
  769. 2535(stored)X
  770. 2756(per)X
  771. 2884(pixel)X
  772. 3069(value,)X
  773. 3288(and)X
  774. 3429(whether)X
  775. 3713(the)X
  776. 3836(image)X
  777. 576 4408(\256le)N
  778. 705(should)X
  779. 945(be)X
  780. 1048(run-length)X
  781. 1409(encoded.)X
  782. 1744(Type)X
  783. 1936(may)X
  784. 2101(be)X
  785. 2204(given)X
  786. 2408(as)X
  787. 2501(RLE\(1\),)X
  788. 2792(RLE\(2\),)X
  789. 3083(VERBATIM\(1\),)X
  790. 3641(or)X
  791. 3734(VERBA-)X
  792. 576 4504(TIM\(2\).)N
  793. 885(Run-length)X
  794. 1273(encoded)X
  795. 1569(\(RLE\))X
  796. 1802(image)X
  797. 2026(\256les)X
  798. 2187(are)X
  799. 2314(more)X
  800. 2507(ef\256ciently)X
  801. 2860(stored)X
  802. 3084(than)X
  803. 3250(verbatim)X
  804. 3564(\256les)X
  805. 3726(where)X
  806. 3952(no)X
  807. 576 4600(compression)N
  808. 1006(algorithm)X
  809. 1342(is)X
  810. 1420(used.)X
  811. 1632(1)X
  812. 1697(or)X
  813. 1789(2)X
  814. 1854(in)X
  815. 1941(the)X
  816. 2064(above)X
  817. 2281(speci\256es)X
  818. 2582(how)X
  819. 2745(many)X
  820. 2948(bytes)X
  821. 3142(are)X
  822. 3265(used)X
  823. 3436(for)X
  824. 3554(each)X
  825. 3726(pixel)X
  826. 3910(in)X
  827. 3996(a)X
  828. 576 4696(colormap)N
  829. 907(image,)X
  830. 1151(or)X
  831. 1246(for)X
  832. 1369(each)X
  833. 1546(channel)X
  834. 1825(in)X
  835. 1916(an)X
  836. 2021(rgb)X
  837. 2157(image.)X
  838. 2422(RLE\(2\))X
  839. 2696(or)X
  840. 2792(VERBATIM\(2\))X
  841. 3333(is)X
  842. 3415(used)X
  843. 3591(to)X
  844. 3682(store)X
  845. 3867(color)X
  846. 576 4792(index)N
  847. 785(images)X
  848. 1043(that)X
  849. 1194(contain)X
  850. 1461(12)X
  851. 1572(bits)X
  852. 1718(per)X
  853. 1851(pixel.)X
  854. 2081(RLE\(1\))X
  855. 2356(is)X
  856. 2439(the)X
  857. 2567(recommended)X
  858. 3052(default)X
  859. 3305(for)X
  860. 3429(rgb)X
  861. 3566(and)X
  862. 3712(black)X
  863. 3916(and)X
  864. 576 4888(white)N
  865. 774(images.)X
  866. 8 f
  867. 864 5224(iclose\(image\))N
  868. 864 5320(register)N
  869. 1296(IMAGE)X
  870. 1664(*image;)X
  871. 1 f
  872. 776 5492(Closes)N
  873. 1010(an)X
  874. 1107(image)X
  875. 1324(\256le)X
  876. 1447(that)X
  877. 1588(was)X
  878. 1734(open)X
  879. 1911(for)X
  880. 2026(reading)X
  881. 2288(or)X
  882. 2376(writing.)X
  883. 2668(All)X
  884. 2791(output)X
  885. 3016(is)X
  886. 3090(\257ushed)X
  887. 3342(to)X
  888. 3426(the)X
  889. 3546(output)X
  890. 3772(\256le,)X
  891. 3916(and)X
  892. 576 5588(the)N
  893. 694(output)X
  894. 918(\256le)X
  895. 1040(is)X
  896. 1113(closed.)X
  897.  
  898. 2 p
  899. %%Page: 2 2
  900. 10 s 0 xH 0 xS 1 f
  901. 2237 384(-)N
  902. 2284(2)X
  903. 2344(-)X
  904. 3 f
  905. 576 960(Reading)N
  906. 880(and)X
  907. 1028(Writing)X
  908. 1319(an)X
  909. 1423(Image)X
  910. 1657(File)X
  911. 1 f
  912. 776 1084(The)N
  913. 929(following)X
  914. 1268(functions)X
  915. 1594(allow)X
  916. 1800(pixels)X
  917. 2019(to)X
  918. 2109(be)X
  919. 2213(transferred)X
  920. 2591(to)X
  921. 2682(and)X
  922. 2827(from)X
  923. 3012(an)X
  924. 3117(image)X
  925. 3342(\256le.)X
  926. 3513(These)X
  927. 3734(functions)X
  928. 576 1180(provide)N
  929. 844(an)X
  930. 943(interface)X
  931. 1248(to)X
  932. 1333(an)X
  933. 1431(image)X
  934. 1649(\256le)X
  935. 1773(that)X
  936. 1915(is)X
  937. 1990(independent)X
  938. 2404(of)X
  939. 2493(whether)X
  940. 2774(the)X
  941. 2894(image)X
  942. 3112(\256le)X
  943. 3236(happens)X
  944. 3521(to)X
  945. 3605(be)X
  946. 3703(run)X
  947. 3832(length)X
  948. 576 1276(encoded,)N
  949. 884(and)X
  950. 1020(independent)X
  951. 1432(of)X
  952. 1519(whether)X
  953. 1798(it)X
  954. 1862(maintains)X
  955. 2193(1)X
  956. 2253(or)X
  957. 2340(2)X
  958. 2400(bytes)X
  959. 2589(per)X
  960. 2712(pixel.)X
  961. 8 f
  962. 864 1420(putrow\(image,buffer,y,z\))N
  963. 864 1516(register)N
  964. 1296(IMAGE)X
  965. 1664(*image;)X
  966. 864 1612(unsigned)N
  967. 1296(short)X
  968. 1664(*buffer;)X
  969. 864 1708(unsigned)N
  970. 1464(y,)X
  971. 1608(z;)X
  972. 1 f
  973. 776 1880(Writes)N
  974. 1010(a)X
  975. 1066(row)X
  976. 1211(of)X
  977. 1298(pixels)X
  978. 1509(to)X
  979. 1591(the)X
  980. 1710(speci\256ed)X
  981. 2016(image)X
  982. 2233(\256le.)X
  983. 2376(The)X
  984. 2522(buffer)X
  985. 2740(should)X
  986. 2974(be)X
  987. 3071(an)X
  988. 3168(array)X
  989. 3355(of)X
  990. 3443(shorts)X
  991. 3655(that)X
  992. 3796(contain)X
  993. 576 1976(the)N
  994. 697(pixel)X
  995. 880(values)X
  996. 1108(of)X
  997. 1198(a)X
  998. 1257(colormap)X
  999. 1583(image)X
  1000. 1802(or)X
  1001. 1892(one)X
  1002. 2031(of)X
  1003. 2121(the)X
  1004. 2242(3)X
  1005. 2305(channels)X
  1006. 2609(of)X
  1007. 2698(an)X
  1008. 2796(rgb)X
  1009. 2925(image.)X
  1010. 3183(If)X
  1011. 3259(the)X
  1012. 3379(image)X
  1013. 3597(\256le)X
  1014. 3721(maintains)X
  1015. 576 2072(only)N
  1016. 740(one)X
  1017. 879(byte)X
  1018. 1040(per)X
  1019. 1166(pixel,)X
  1020. 1369(then)X
  1021. 1530(the)X
  1022. 1651(values)X
  1023. 1879(passed)X
  1024. 2116(in)X
  1025. 2201(the)X
  1026. 2322(buffer)X
  1027. 2542(should)X
  1028. 2778(be)X
  1029. 2877(in)X
  1030. 2962(the)X
  1031. 3083(range)X
  1032. 3285(0..255.)X
  1033. 3548(The)X
  1034. 3696(row)X
  1035. 3844(of)X
  1036. 3934(the)X
  1037. 576 2168(image)N
  1038. 794(to)X
  1039. 878(be)X
  1040. 976(written)X
  1041. 1225(is)X
  1042. 1300(given)X
  1043. 1500(by)X
  1044. 1602(y,)X
  1045. 1684(while)X
  1046. 1884(z)X
  1047. 1942(selects)X
  1048. 2178(which)X
  1049. 2396(channel)X
  1050. 2668(of)X
  1051. 2757(the)X
  1052. 2877(image)X
  1053. 3095(to)X
  1054. 3179(write)X
  1055. 3366(to.)X
  1056. 3490(The)X
  1057. 3637(\256rst)X
  1058. 3782(channel)X
  1059. 576 2264(of)N
  1060. 671(the)X
  1061. 797(image)X
  1062. 1022(is)X
  1063. 1104(channel)X
  1064. 1383(0.)X
  1065. 1492(A)X
  1066. 1579(black)X
  1067. 1782(and)X
  1068. 1927(white)X
  1069. 2134(image)X
  1070. 2359(will)X
  1071. 2512(have)X
  1072. 2693(only)X
  1073. 2864(1)X
  1074. 2933(channel)X
  1075. 3212(while)X
  1076. 3419(rgb)X
  1077. 3555(images)X
  1078. 3811(have)X
  1079. 3992(3)X
  1080. 576 2360(channels.)N
  1081. 918(In)X
  1082. 1006(an)X
  1083. 1103(rgb)X
  1084. 1231(image,)X
  1085. 1468(channel)X
  1086. 1739(0)X
  1087. 1800(is)X
  1088. 1874(used)X
  1089. 2042(to)X
  1090. 2125(store)X
  1091. 2302(red)X
  1092. 2425(while)X
  1093. 2623(channel)X
  1094. 2893(1)X
  1095. 2953(stores)X
  1096. 3160(green,)X
  1097. 3379(and)X
  1098. 3515(channel)X
  1099. 3785(2)X
  1100. 3845(stores)X
  1101. 576 2456(blue)N
  1102. 745(pixel)X
  1103. 936(data.)X
  1104. 1141(The)X
  1105. 1297(y)X
  1106. 1368(argument)X
  1107. 1702(should)X
  1108. 1946(be)X
  1109. 2053(greater)X
  1110. 2308(than)X
  1111. 2477(or)X
  1112. 2575(equal)X
  1113. 2780(to)X
  1114. 2873(zero)X
  1115. 3043(and)X
  1116. 3190(less)X
  1117. 3341(than)X
  1118. 3510(the)X
  1119. 3639(ysize)X
  1120. 3835(of)X
  1121. 3934(the)X
  1122. 576 2552(image.)N
  1123. 832(The)X
  1124. 977(rows)X
  1125. 1153(of)X
  1126. 1240(the)X
  1127. 1358(image)X
  1128. 1574(\256le)X
  1129. 1696(may)X
  1130. 1854(be)X
  1131. 1950(written)X
  1132. 2197(in)X
  1133. 2279(any)X
  1134. 2415(order.)X
  1135. 8 f
  1136. 864 2696(getrow\(image,buffer,y,z\))N
  1137. 864 2792(register)N
  1138. 1296(IMAGE)X
  1139. 1584(*image;)X
  1140. 864 2888(unsigned)N
  1141. 1296(short)X
  1142. 1584(*buffer;)X
  1143. 864 2984(register)N
  1144. 1296(unsigned)X
  1145. 1728(int)X
  1146. 1920(y,)X
  1147. 2064(z;)X
  1148. 1 f
  1149. 776 3156(Reads)N
  1150. 1004(a)X
  1151. 1072(row)X
  1152. 1229(of)X
  1153. 1329(pixels)X
  1154. 1553(from)X
  1155. 1742(the)X
  1156. 1873(speci\256ed)X
  1157. 2191(image)X
  1158. 2420(\256le.)X
  1159. 2595(The)X
  1160. 2753(buffer)X
  1161. 2983(should)X
  1162. 3229(be)X
  1163. 3338(an)X
  1164. 3447(array)X
  1165. 3646(of)X
  1166. 3746(shorts)X
  1167. 3970(to)X
  1168. 576 3252(receive)N
  1169. 833(pixel)X
  1170. 1017(values)X
  1171. 1246(of)X
  1172. 1337(a)X
  1173. 1397(colormap)X
  1174. 1724(image)X
  1175. 1944(or)X
  1176. 2034(one)X
  1177. 2173(of)X
  1178. 2263(the)X
  1179. 2384(3)X
  1180. 2447(channels)X
  1181. 2751(of)X
  1182. 2841(an)X
  1183. 2940(rgb)X
  1184. 3070(image.)X
  1185. 3329(The)X
  1186. 3477(row)X
  1187. 3625(of)X
  1188. 3715(the)X
  1189. 3836(image)X
  1190. 576 3348(to)N
  1191. 664(be)X
  1192. 766(read)X
  1193. 931(is)X
  1194. 1010(given)X
  1195. 1214(by)X
  1196. 1320(y,)X
  1197. 1406(while)X
  1198. 1610(z)X
  1199. 1672(selects)X
  1200. 1912(which)X
  1201. 2134(channel)X
  1202. 2410(of)X
  1203. 2503(the)X
  1204. 2627(image)X
  1205. 2849(to)X
  1206. 2937(read)X
  1207. 3102(from.)X
  1208. 3324(The)X
  1209. 3475(\256rst)X
  1210. 3625(channel)X
  1211. 3902(of)X
  1212. 3996(a)X
  1213. 576 3444(image)N
  1214. 799(is)X
  1215. 879(channel)X
  1216. 1156(0.)X
  1217. 1263(A)X
  1218. 1348(black)X
  1219. 1549(and)X
  1220. 1692(white)X
  1221. 1897(image)X
  1222. 2120(will)X
  1223. 2271(have)X
  1224. 2450(only)X
  1225. 2619(1)X
  1226. 2686(channel,)X
  1227. 2983(while)X
  1228. 3187(an)X
  1229. 3289(rgb)X
  1230. 3422(image)X
  1231. 3644(will)X
  1232. 3794(have)X
  1233. 3972(3.)X
  1234. 576 3540(The)N
  1235. 725(y)X
  1236. 789(argument)X
  1237. 1116(should)X
  1238. 1353(be)X
  1239. 1453(greater)X
  1240. 1701(than)X
  1241. 1863(or)X
  1242. 1954(equal)X
  1243. 2152(to)X
  1244. 2238(zero)X
  1245. 2401(and)X
  1246. 2541(less)X
  1247. 2685(than)X
  1248. 2847(the)X
  1249. 2969(ysize)X
  1250. 3158(of)X
  1251. 3250(the)X
  1252. 3373(image.)X
  1253. 3634(The)X
  1254. 3784(rows)X
  1255. 3965(of)X
  1256. 576 3636(the)N
  1257. 694(image)X
  1258. 910(\256le)X
  1259. 1032(may)X
  1260. 1190(be)X
  1261. 1286(read)X
  1262. 1445(in)X
  1263. 1527(any)X
  1264. 1663(order.)X
  1265. 3 f
  1266. 576 3828(Miscellaneous)N
  1267. 1076(Functions)X
  1268. 8 f
  1269. 864 3972(isetname\(image,name\))N
  1270. 864 4068(IMAGE)N
  1271. 1152(*image;)X
  1272. 864 4164(char)N
  1273. 1104(*name;)X
  1274. 1 f
  1275. 776 4336(Copies)N
  1276. 1019(the)X
  1277. 1138(character)X
  1278. 1455(string)X
  1279. 1658(name)X
  1280. 1854(into)X
  1281. 2000(the)X
  1282. 2120(name)X
  1283. 2316(\256eld)X
  1284. 2480(of)X
  1285. 2569(the)X
  1286. 2689(image)X
  1287. 2907(\256le.)X
  1288. 3051(NOTE:)X
  1289. 3329(handling)X
  1290. 3631(names)X
  1291. 3858(when)X
  1292. 576 4432(processing)N
  1293. 939(two)X
  1294. 1079(\256les)X
  1295. 1232(together)X
  1296. 1515(is)X
  1297. 1588(not)X
  1298. 1710(well)X
  1299. 1868(supported)X
  1300. 2204(and)X
  1301. 2340(is)X
  1302. 2413(not)X
  1303. 2535(encouraged.)X
  1304. 8 f
  1305. 864 4576(isetcolormap\(image,colormap\))N
  1306. 864 4672(IMAGE)N
  1307. 1152(*image;)X
  1308. 864 4768(int)N
  1309. 1056(colormap;)X
  1310. 1 f
  1311. 776 4940(Tells)N
  1312. 960(ipaste)X
  1313. 1171(and)X
  1314. 1311(some)X
  1315. 1504(printing)X
  1316. 1781(utilities)X
  1317. 2044(whether)X
  1318. 2327(the)X
  1319. 2449(pixel)X
  1320. 2633(values)X
  1321. 2862(should)X
  1322. 3099(be)X
  1323. 3199(interpreted)X
  1324. 3571(as)X
  1325. 3662(color-index)X
  1326. 576 5036(pixels)N
  1327. 788(or)X
  1328. 876(intensities.)X
  1329. 1241(A)X
  1330. 1320(gray)X
  1331. 1484(scale)X
  1332. 1666(image)X
  1333. 1883(consists)X
  1334. 2157(of)X
  1335. 2245(one)X
  1336. 2382(channel)X
  1337. 2653(of)X
  1338. 2741(intensities,)X
  1339. 3106(while)X
  1340. 3305(an)X
  1341. 3401(rgb)X
  1342. 3528(image)X
  1343. 3744(has)X
  1344. 3871(three)X
  1345. 576 5132(independent)N
  1346. 993(channels)X
  1347. 1300(of)X
  1348. 1393(pixel)X
  1349. 1579(intensities,)X
  1350. 1949(one)X
  1351. 2091(channel)X
  1352. 2367(for)X
  1353. 2487(each)X
  1354. 2661(red,)X
  1355. 2810(green)X
  1356. 3015(and)X
  1357. 3157(blue)X
  1358. 3321(intensities.)X
  1359. 3711(The)X
  1360. 3862(argu-)X
  1361. 576 5228(ment)N
  1362. 757(colormap)X
  1363. 1081(may)X
  1364. 1240(be)X
  1365. 1337(one)X
  1366. 1474(of)X
  1367. 1561(following)X
  1368. 1892(three)X
  1369. 2073(values:)X
  1370. 2340(CM_NORMAL)X
  1371. 2871(is)X
  1372. 2944(the)X
  1373. 3062(default)X
  1374. 3305(indicating)X
  1375. 3645(that)X
  1376. 3785(the)X
  1377. 3903(pix-)X
  1378. 576 5324(els)N
  1379. 690(are)X
  1380. 814(intensity)X
  1381. 1114(values.)X
  1382. 1384(0)X
  1383. 1449(is)X
  1384. 1527(black)X
  1385. 1726(and)X
  1386. 1867(a)X
  1387. 1928(value)X
  1388. 2128(of)X
  1389. 2221(255)X
  1390. 2367(in)X
  1391. 2455(the)X
  1392. 2579(image)X
  1393. 2801(is)X
  1394. 2880(white.)X
  1395. 3104(Black)X
  1396. 3317(and)X
  1397. 3459(white)X
  1398. 3663(images)X
  1399. 3916(and)X
  1400. 576 5420(rgb)N
  1401. 708(images)X
  1402. 960(are)X
  1403. 1084(stored)X
  1404. 1305(with)X
  1405. 1472(CM_NORMAL.)X
  1406. 2048(CM_SCREEN)X
  1407. 2543(indicates)X
  1408. 2853(that)X
  1409. 2998(the)X
  1410. 3120(pixels)X
  1411. 3335(were)X
  1412. 3516(copied)X
  1413. 3754(from)X
  1414. 3934(the)X
  1415. 576 5516(screen)N
  1416. 807(and)X
  1417. 948(must)X
  1418. 1128(be)X
  1419. 1229(transformed)X
  1420. 1642(by)X
  1421. 1747(a)X
  1422. 1808(color)X
  1423. 1998(map)X
  1424. 2161(to)X
  1425. 2248(be)X
  1426. 2349(meaningful.)X
  1427. 2759(Colormaps)X
  1428. 3135(can)X
  1429. 3272(also)X
  1430. 3426(be)X
  1431. 3527(stored)X
  1432. 3748(in)X
  1433. 3836(image)X
  1434. 576 5612(\256les.)N
  1435. 769(CM_COLORMAP)X
  1436. 1397(means)X
  1437. 1622(that)X
  1438. 1762(the)X
  1439. 1880(pixels)X
  1440. 2091(in)X
  1441. 2173(the)X
  1442. 2291(image)X
  1443. 2507(\256le)X
  1444. 2629(represent)X
  1445. 2944(a)X
  1446. 3000(color)X
  1447. 3185(map)X
  1448.  
  1449. 3 p
  1450. %%Page: 3 3
  1451. 10 s 0 xH 0 xS 1 f
  1452. 2237 384(-)N
  1453. 2284(3)X
  1454. 2344(-)X
  1455. 3 f
  1456. 576 672(An)N
  1457. 698(Example)X
  1458. 1 f
  1459. 776 796(The)N
  1460. 923(following)X
  1461. 1256(example)X
  1462. 1551(shows)X
  1463. 1774(how)X
  1464. 1935(to)X
  1465. 2020(open)X
  1466. 2199(an)X
  1467. 2298(image)X
  1468. 2517(\256le)X
  1469. 2642(and)X
  1470. 2781(read)X
  1471. 2943(its)X
  1472. 3041(contents.)X
  1473. 3371(More)X
  1474. 3568(examples)X
  1475. 3894(may)X
  1476. 576 892(be)N
  1477. 672(found)X
  1478. 879(in)X
  1479. 961(/usr/people/4Dgifts/iristools/imgtools.)X
  1480. 8 f
  1481. 8 s
  1482. 576 1164(/*)N
  1483. 614 1244(*)N
  1484. 776 -0.4219(readimage)AX
  1485. 1156(-)X
  1486. 1232(Read)X
  1487. 1422(an)X
  1488. 1536(image)X
  1489. 1764(file)X
  1490. 1954(and)X
  1491. 2106(print)X
  1492. 2334(its)X
  1493. 2486(pixel)X
  1494. 2714(values.)X
  1495. 614 1324(*)N
  1496. 614 1404(*)N
  1497. 776(To)X
  1498. 890(compile:)X
  1499. 1232(cc)X
  1500. 1346 -0.4125(readimage.c)AX
  1501. 1802(-o)X
  1502. 1916 -0.4219(readimage)AX
  1503. 2296(-limage)X
  1504. 614 1484(*)N
  1505. 614 1564(*)N
  1506. 1376(Paul)X
  1507. 1566(Haeberli)X
  1508. 1908(-)X
  1509. 1984(1991)X
  1510. 614 1644(*/)N
  1511. 728(#include)X
  1512. 1070 -0.4091("gl/image.h")AX
  1513. 576 1804 -0.4018(main\(argc,argv\))AN
  1514. 1184(int)X
  1515. 1336(argc;)X
  1516. 1564(char)X
  1517. 1754(**argv;)X
  1518. 2058({)X
  1519. 728 1884(IMAGE)N
  1520. 956(*image;)X
  1521. 728 1964(int)N
  1522. 880(x,)X
  1523. 994(y,)X
  1524. 1108(z;)X
  1525. 728 2044(short)N
  1526. 956(*rbuf,)X
  1527. 1222(*gbuf,)X
  1528. 1488(*bbuf;)X
  1529. 576 2204(/*)N
  1530. 690(print)X
  1531. 918(usage)X
  1532. 1146(message)X
  1533. 1450(*/)X
  1534. 728 2284(if\()N
  1535. 880(argc<2)X
  1536. 1146(\))X
  1537. 1222({)X
  1538. 880 2364 -0.3929(fprintf\(stderr,"usage:)AN
  1539. 1754 -0.4219(readimage)AX
  1540. 2134 -0.4219(infile0\);)AX
  1541. 880 2444(exit\(1\);)N
  1542. 728 2524(})N
  1543. 576 2684(/*)N
  1544. 690(open)X
  1545. 880(the)X
  1546. 1032(image)X
  1547. 1260(file)X
  1548. 1450(*/)X
  1549. 728 2764(if\()N
  1550. 880 -0.3900(\(image=iopen\(argv[1],"r"\)\))AX
  1551. 1906(==)X
  1552. 2020(NULL)X
  1553. 2210(\))X
  1554. 2286({)X
  1555. 880 2844 -0.3900(fprintf\(stderr,"readimage:)AN
  1556. 1906(can't)X
  1557. 2134(open)X
  1558. 2324(input)X
  1559. 2552(file)X
  1560. 2742 -0.4062(%s0,argv[1]\);)AX
  1561. 880 2924(exit\(1\);)N
  1562. 728 3004(})N
  1563. 576 3164(/*)N
  1564. 690(print)X
  1565. 918(a)X
  1566. 994(little)X
  1567. 1260(info)X
  1568. 1450(about)X
  1569. 1678(the)X
  1570. 1830(image)X
  1571. 2058(*/)X
  1572. 728 3244 -0.4062(printf\("Image)AN
  1573. 1260(x)X
  1574. 1336(and)X
  1575. 1488(y)X
  1576. 1564(size)X
  1577. 1754(in)X
  1578. 1868(pixels:)X
  1579. 2172(%d)X
  1580. 2286 -0.3875(%d0,image->xsize,image->ysize\);)AX
  1581. 728 3324 -0.4062(printf\("Image)AN
  1582. 1260(zsize)X
  1583. 1488(in)X
  1584. 1602 -0.4219(channels:)AX
  1585. 1982 -0.3971(%d0,image->zsize\);)AX
  1586. 728 3404 -0.4062(printf\("Image)AN
  1587. 1260(pixel)X
  1588. 1488(min)X
  1589. 1640(and)X
  1590. 1792(max:)X
  1591. 1982(%d)X
  1592. 2096 -0.3900(%d0,image->min,image-max\);)AX
  1593. 576 3564(/*)N
  1594. 690(allocate)X
  1595. 1032(buffers)X
  1596. 1336(for)X
  1597. 1488(image)X
  1598. 1716(data)X
  1599. 1906(*/)X
  1600. 728 3644(rbuf)N
  1601. 918(=)X
  1602. 994(\(short)X
  1603. 1260 -0.3854(*\)malloc\(image->xsize*sizeof\(short\)\);)AX
  1604. 728 3724(gbuf)N
  1605. 918(=)X
  1606. 994(\(short)X
  1607. 1260 -0.3854(*\)malloc\(image->xsize*sizeof\(short\)\);)AX
  1608. 728 3804(bbuf)N
  1609. 918(=)X
  1610. 994(\(short)X
  1611. 1260 -0.3854(*\)malloc\(image->xsize*sizeof\(short\)\);)AX
  1612. 576 3964(/*)N
  1613. 690(check)X
  1614. 918(to)X
  1615. 1032(see)X
  1616. 1184(if)X
  1617. 1298(the)X
  1618. 1450(image)X
  1619. 1678(is)X
  1620. 1792(B/W)X
  1621. 1944(or)X
  1622. 2058(RGB)X
  1623. 2210(*/)X
  1624. 728 4044 -0.4018(if\(image->zsize)AN
  1625. 1336(==)X
  1626. 1450(1\))X
  1627. 1564({)X
  1628. 880 4124 -0.4091(printf\("This)AN
  1629. 1374(is)X
  1630. 1488(a)X
  1631. 1564(black)X
  1632. 1792(and)X
  1633. 1944(write)X
  1634. 2172(image0\);)X
  1635. 880 4204(for\(y=0;)N
  1636. 1222 -0.4018(y<image->ysize;)AX
  1637. 1830(y++\))X
  1638. 2020({)X
  1639. 1032 4284 -0.3920(getrow\(image,rbuf,y,0\);)AN
  1640. 1032 4364 -0.4125(printf\("row)AN
  1641. 1488(%d:)X
  1642. 1640(",y\);)X
  1643. 1032 4444(for\(x=0;)N
  1644. 1374 -0.4018(x<image->xsize;)AX
  1645. 1982(x++\))X
  1646. 1184 4524 -0.4167(printf\("%d)AN
  1647. 9 f
  1648. 1602(|)X
  1649. 8 f
  1650. 1615 -0.4125(",rbuf[x]\);)AX
  1651. 1032 4604 -0.4125(printf\("0\);)AN
  1652. 880 4684(})N
  1653. 728 4764(})N
  1654. 804(else)X
  1655. 994 -0.4018(if\(image->zsize)AX
  1656. 1602(>=)X
  1657. 1716(3\))X
  1658. 1830({)X
  1659. 1944(/*)X
  1660. 2058(if)X
  1661. 2172(the)X
  1662. 2324(image)X
  1663. 2552(has)X
  1664. 2704(alpha)X
  1665. 2932(zsize)X
  1666. 3160(is)X
  1667. 3274(4)X
  1668. 3350(*/)X
  1669. 880 4844 -0.4091(printf\("This)AN
  1670. 1374(is)X
  1671. 1488(a)X
  1672. 1564(rgb)X
  1673. 1716(image0\);)X
  1674. 880 4924(for\(y=0;)N
  1675. 1222 -0.4018(y<image->ysize;)AX
  1676. 1830(y++\))X
  1677. 2020({)X
  1678. 1032 5004 -0.3920(getrow\(image,rbuf,y,0\);)AN
  1679. 1032 5084 -0.3920(getrow\(image,gbuf,y,1\);)AN
  1680. 1032 5164 -0.3920(getrow\(image,bbuf,y,2\);)AN
  1681. 1032 5244 -0.4125(printf\("row)AN
  1682. 1488(%d:)X
  1683. 1640(",y\);)X
  1684. 1032 5324(for\(x=0;)N
  1685. 1374 -0.4018(x<image->xsize;)AX
  1686. 1982(x++\))X
  1687. 1184 5404 -0.4167(printf\("%d)AN
  1688. 1602(%d)X
  1689. 1716(%d)X
  1690. 9 f
  1691. 1830(|)X
  1692. 8 f
  1693. 1843 -0.3894(",rbuf[x],gbuf[x],bbuf[x]\);)AX
  1694. 1032 5484 -0.4125(printf\("0\);)AN
  1695. 880 5564(})N
  1696. 728 5644(})N
  1697. 804(})X
  1698.  
  1699. 3 p
  1700. %%Trailer
  1701. xt
  1702.  
  1703. xs
  1704.