home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume38 / lic / part09 < prev    next >
Text File  |  1993-08-11  |  66KB  |  1,901 lines

  1. Newsgroups: comp.sources.misc
  2. From: casey@gauss.llnl.gov (Casey Leedom)
  3. Subject: v38i112:  lic - LLNL Line Integral Convolution, v1.2, Part09/10
  4. Message-ID: <1993Aug12.013959.14455@sparky.sterling.com>
  5. X-Md4-Signature: 4f965f8abf4ef2d862327e6a3b1d6046
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: Sterling Software
  8. Date: Thu, 12 Aug 1993 01:39:59 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: casey@gauss.llnl.gov (Casey Leedom)
  12. Posting-number: Volume 38, Issue 112
  13. Archive-name: lic/part09
  14. Environment: UNIX
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then feed it
  18. # into a shell via "sh file" or similar.  To overwrite existing files,
  19. # type "sh file -c".
  20. # Contents:  lic.1.2/ABSTRACT lic.1.2/BREAKNAMES.sh lic.1.2/TODO
  21. #   lic.1.2/liblic/LIC_ComputeImage.3 lic.1.2/liblic/LIC_Convolve.3
  22. #   lic.1.2/liblic/LIC_Destroy.3 lic.1.2/liblic/LIC_Modify.3
  23. #   lic.1.2/liblic/LIC_Query.3 lic.1.2/liblic/Modify.c
  24. #   lic.1.2/test/BasketWeave.c lic.1.2/test/CircleField.c
  25. #   lic.1.2/test/Makefile.tmpl lic.1.2/test/SpiralField.c
  26. #   lic.1.2/test/WhiteNoise.c
  27. # Wrapped by kent@sparky on Wed Aug 11 19:38:08 1993
  28. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  29. echo If this archive is complete, you will see the following message:
  30. echo '          "shar: End of archive 9 (of 10)."'
  31. if test -f 'lic.1.2/ABSTRACT' -a "${1}" != "-c" ; then 
  32.   echo shar: Will not clobber existing file \"'lic.1.2/ABSTRACT'\"
  33. else
  34.   echo shar: Extracting \"'lic.1.2/ABSTRACT'\" \(5127 characters\)
  35.   sed "s/^X//" >'lic.1.2/ABSTRACT' <<'END_OF_FILE'
  36. XIdentification:
  37. X
  38. X    Software Acronym: LIC
  39. X    Software Title: Line Integral Convolution Experimental Software
  40. X
  41. X
  42. XAuthor Name(s) and Affiliations:
  43. X
  44. X    Brian Cabral        Casey Leedom
  45. X    LLNL/Engineering        LLNL/Computation
  46. X
  47. X
  48. XSoftware Completion Date:
  49. X
  50. X    February 15, 1993
  51. X
  52. X
  53. XBrief Description:
  54. X
  55. X    This software is an experimental implementation of a new vector
  56. X    visualization algorithm.  It allows researchers to experiment with
  57. X    this algorithm and duplicate results presented in a paper written
  58. X    by the authors in the 1993 SIGGRAPH conference: ``Imaging Vector
  59. X    Fields Using Line Integral Convolution.''
  60. X
  61. X    The software consists of an object-oriented library that
  62. X    implements the algorithm, a command line interface and an AVS
  63. X    interface and documentation for all of the above.
  64. X
  65. X
  66. XMethod of Solution:
  67. X
  68. X    Vectors are visualized by convolving an input image along vector
  69. X    stream lines in an input vector field.  The result is an image that
  70. X    looks like the input image, but blurred in the directions of the
  71. X    vectors in the vector field.
  72. X
  73. X    The convolution is performed for each vector field element as
  74. X    follows: a parametric curve in the vector field is created by
  75. X    locally following the vector field forward and backward for some
  76. X    distance, L.  The parametric curve is laid over the corresponding
  77. X    input image pixels.  This yields a pixel value function, F(s), on
  78. X    the parametric curve.  This function is convolved with a filter
  79. X    kernel, k(s), to produce the LIC output.
  80. X
  81. X
  82. XComputer(s) for which software is written:
  83. X
  84. X    DEC OSF1
  85. X    HP HP-UX 8.07
  86. X    IBM AIX 3.2
  87. X    SGI IRIX 4.0.5
  88. X    Sun SunOS 4.1.1
  89. X
  90. X
  91. XOperating System:
  92. X
  93. X    POSIX 1003.1-1990.
  94. X
  95. X
  96. XProgramming Language(s) Used:
  97. X
  98. X    ANSI C X3.159-1989.
  99. X
  100. X
  101. XSoftware limitations:
  102. X
  103. X    All data is dynamically allocated with the C malloc() library
  104. X    routine.  The software does not handle varying image or vector
  105. X    field types dynamically at run time.  There is support for
  106. X    compile-time specification of a limited number of image pixel
  107. X    formats.  There is only support for single precision vector fields.
  108. X    The AVS interface only supports two-dimensional vector fields.
  109. X
  110. X
  111. XUnique Features of the Software:
  112. X
  113. X    The software allows one to visualize very large and dense vector
  114. X    fields.  Most current vector visualization algorithms bog down
  115. X    for large vector fields.
  116. X
  117. X
  118. XRelated and Auxiliary Software:
  119. X
  120. X    This is the first release of this software.  It does not supersede
  121. X    any other version.  It does not depend on any other software
  122. X    systems.  There are many other vector visualization algorithms
  123. X    described in the literature.
  124. X
  125. X
  126. XOther Programming or Operating Information or Restrictions:
  127. X
  128. X    Files in the top level directory whose names consist of all capital
  129. X    letters are general information files and should be read before all
  130. X    others.
  131. X
  132. X    Files ending in ".c" and ".h" are ANSI C source files.  Files
  133. X    ending in ".frame" are Frame Maker source files to be processed.
  134. X    Files ending in ".N," where N is a single digit, are troff on-line
  135. X    manual pages to be processed with the "man" troff macro package.
  136. X    Files whose names start with "Makefile" are part of the automatic
  137. X    software compilation and installation system for the software.
  138. X
  139. X
  140. XHardware Requirements:
  141. X
  142. X    No special hardware is required.
  143. X
  144. X
  145. XTime requirements:
  146. X
  147. X    For typical two-dimensional vector fields, about 2000 vector can be
  148. X    rendered per second on an IBM RS/6000 based machine.
  149. X
  150. X
  151. XReferences:
  152. X
  153. X    Reference documents that are provided with this package:
  154. X
  155. X    . (general info)    description
  156. X    -----------------    -----------
  157. X    ABSTRACT ..............    this file
  158. X    CHANGES ...............    catalogue of changes between releases
  159. X    MEMO ..................    memo of understanding from software authors
  160. X                to LLNL software release office
  161. X    README ................    overview of software and installation
  162. X                instructions
  163. X    TODO ..................    notes about remaining work to do on
  164. X                software
  165. X
  166. X    ./liblic (manual pages)    description
  167. X    -----------------------    -----------
  168. X    LIC.3 .................    general introduction to LIC library
  169. X    LIC_ComputeImage.3 ....    perform LIC computation on LIC object
  170. X    LIC_Convolve.3 ........    perform LIC computation for one vector cell
  171. X    LIC_Create.3 ..........    create and initialize a LIC object
  172. X    LIC_Destroy.3 .........    destroy a LIC object
  173. X    LIC_Filters.3 .........    description of LIC filters
  174. X    LIC_Modify.3 ..........    modify a LIC object in various ways
  175. X    LIC_Query.3 ...........    query a LIC object and the library
  176. X
  177. X    ./lic (manual pages)    description
  178. X    --------------------    -----------
  179. X    lic.1 .................    command line interface to the LIC library
  180. X
  181. X    ./avs (documentation)    description
  182. X    ---------------------    -----------
  183. X    LIC.txt ...............    on-line documentation to AVS LIC module
  184. X
  185. X    ./doc (documentation)    description
  186. X    ---------------------    -----------
  187. X    cover.me ..............    cover page, contents, etc. for printed
  188. X                documentation
  189. X    siggraph ..............    SIGGRAPH 1993 LIC paper
  190. X
  191. X
  192. XCategorization and Keywords:
  193. X
  194. X    Subject Classification Code: P
  195. X    Keywords: computer graphics, image processing
  196. END_OF_FILE
  197.   if test 5127 -ne `wc -c <'lic.1.2/ABSTRACT'`; then
  198.     echo shar: \"'lic.1.2/ABSTRACT'\" unpacked with wrong size!
  199.   fi
  200.   # end of 'lic.1.2/ABSTRACT'
  201. fi
  202. if test -f 'lic.1.2/BREAKNAMES.sh' -a "${1}" != "-c" ; then 
  203.   echo shar: Will not clobber existing file \"'lic.1.2/BREAKNAMES.sh'\"
  204. else
  205.   echo shar: Extracting \"'lic.1.2/BREAKNAMES.sh'\" \(2539 characters\)
  206.   sed "s/^X//" >'lic.1.2/BREAKNAMES.sh' <<'END_OF_FILE'
  207. X#!/bin/sh
  208. X#
  209. X# $Header: /d/sisal/a/casey/tmp/lic/RCS/BREAKNAMES.sh,v 1.3 1993/05/28 04:17:43 casey Exp $
  210. X#
  211. X# This script will mangle all the names in the source distribution in order
  212. X# to make them fit on the brain dead SIGGRAPH '93 CD-ROM file system.  Use
  213. X# the script FIXNAMES.sh to undo the damage caused by this script.
  214. X
  215. Xcat << EOF
  216. XOnly execute $0 in your worst nightmares!
  217. X
  218. XAnd ***ONLY*** if you ***REALLY*** need to fit a distribution onto a stupid
  219. Xfile system that can't hack names longer than 8 characters with 3 character
  220. Xextensions and no upper/lower case distinction.
  221. X
  222. XAnd if you do have to do this, do it with a separate copy of the source!!!
  223. XEOF
  224. X
  225. Xecho "-------------------------------------"
  226. Xecho "*** REALLY SCREW UP THIS SOURCE TREE?"
  227. Xread ans
  228. Xcase $ans in
  229. X    yes|YES)
  230. X    ;;
  231. X    *)
  232. X    echo "Aborting ..."
  233. X    exit 1
  234. X    ;;
  235. Xesac
  236. X
  237. Xecho ""
  238. Xset -x
  239. X
  240. Xmv FIXNAMES.sh            FIXNAMES.SH
  241. Xmv Makefile            MAKEFILE
  242. Xmv Makefile.tmpl        MAKEFILE.TPL
  243. Xmv PATCHLEVEL            PATCHLVL
  244. X
  245. Xmv avs/LIC.c            avs/LIC.C
  246. Xmv avs/LIC.txt            avs/LIC.TXT
  247. Xmv avs/Makefile            avs/MAKEFILE
  248. Xmv avs/Makefile.tmpl        avs/MAKEFILE.TPL
  249. Xmv avs                AVS
  250. X
  251. Xmv config/Makefile.config    config/MAKEFILE.CNF
  252. Xmv config/Makefile.std        config/MAKEFILE.STD
  253. Xmv config            CONFIG
  254. X
  255. Xmv doc/Makefile            doc/MAKEFILE
  256. Xmv doc/Makefile.tmpl        doc/MAKEFILE.TPL
  257. Xmv doc/cover.me            doc/COVER.ME
  258. Xmv doc                DOC
  259. X
  260. Xmv include/Makefile        include/MAKEFILE
  261. Xmv include/Makefile.tmpl    include/MAKEFILE.TPL
  262. Xmv include/lic.h        include/LIC.H
  263. Xmv include            INCLUDE
  264. X
  265. Xmv liblic/ComputeImage.c    liblic/COMPUTE.C
  266. Xmv liblic/Convolve2D.c        liblic/CONVOLV2.C
  267. Xmv liblic/Convolve3D.c        liblic/CONVOLV3.C
  268. Xmv liblic/Create.c        liblic/CREATE.C
  269. Xmv liblic/DebugPrologue.ps    liblic/DEBUG.PS
  270. Xmv liblic/Destroy.c        liblic/DESTROY.C
  271. Xmv liblic/Filters.c        liblic/FILTERS.C
  272. Xmv liblic/LIC_ComputeImage.3    liblic/COMPUTE.3
  273. Xmv liblic/LIC_Convolve.3    liblic/CONVOLVE.3
  274. Xmv liblic/LIC_Create.3        liblic/CREATE.3
  275. Xmv liblic/LIC_Destroy.3        liblic/DESTROY.3
  276. Xmv liblic/LIC_Filters.3        liblic/FILTERS.3
  277. Xmv liblic/LIC_Modify.3        liblic/MODIFY.3
  278. Xmv liblic/LIC_Query.3        liblic/QUERY.3
  279. Xmv liblic/Makefile        liblic/MAKEFILE
  280. Xmv liblic/Makefile.tmpl        liblic/MAKEFILE.TPL
  281. Xmv liblic/Modify.c        liblic/MODIFY.C
  282. Xmv liblic/Query.c        liblic/QUERY.C
  283. Xmv liblic/liblic.h        liblic/LIBLIC.H
  284. Xmv liblic            LIBLIC
  285. X
  286. Xmv lic/Makefile            lic/MAKEFILE
  287. Xmv lic/Makefile.tmpl        lic/MAKEFILE.TPL
  288. Xmv lic/lic.1            lic/LIC.1
  289. Xmv lic/lic.c            lic/LIC.C
  290. Xmv lic                LIC
  291. X
  292. Xmv test/BasketWeave.c        test/BASKETWEAVE.C
  293. Xmv test/Makefile        test/MAKEFILE
  294. Xmv test/Makefile.tmpl        test/MAKEFILE.TPL
  295. Xmv test/Noise.c            test/NOISE.C
  296. Xmv test                TEST
  297. END_OF_FILE
  298.   if test 2539 -ne `wc -c <'lic.1.2/BREAKNAMES.sh'`; then
  299.     echo shar: \"'lic.1.2/BREAKNAMES.sh'\" unpacked with wrong size!
  300.   fi
  301.   chmod +x 'lic.1.2/BREAKNAMES.sh'
  302.   # end of 'lic.1.2/BREAKNAMES.sh'
  303. fi
  304. if test -f 'lic.1.2/TODO' -a "${1}" != "-c" ; then 
  305.   echo shar: Will not clobber existing file \"'lic.1.2/TODO'\"
  306. else
  307.   echo shar: Extracting \"'lic.1.2/TODO'\" \(2938 characters\)
  308.   sed "s/^X//" >'lic.1.2/TODO' <<'END_OF_FILE'
  309. X$Header: /d/sisal/a/casey/tmp/lic/RCS/TODO,v 1.17 1993/08/10 23:16:41 casey Exp $
  310. X
  311. X
  312. X              Unfinished work on the LLNL LIC distribution
  313. X
  314. X
  315. X    o    Implement a three-dimensional AVS module.  Preferably two- and
  316. X    three-dimensional support should be handled automatically by
  317. X    the same module.
  318. X
  319. X    o    Should probably implement a means to change the number of
  320. X    animation frames that the AVS module generates.
  321. X
  322. X    o    Implement Explorer module.
  323. X
  324. X    o    Should really report parameter errors to user instead of
  325. X    silently correcting them.  See checks for negative lengths,
  326. X    frequencies, etc.
  327. X
  328. X    o    The convolve routines do almost no parameter checking.  In
  329. X    particular, no check is made to make sure i, j and k are in
  330. X    the correct ranges.  Should probably do this by moving some
  331. X    range checking code from the bottom of the main loop to the
  332. X    top rather than introducing yet more code the wade through,
  333. X    but don't have time to think about how best to do this and
  334. X    test the results.
  335. X
  336. X    o    Probably need to make the number of ``speeds'' be variable.
  337. X    Also want the number of integral tables allocated and built to
  338. X    be limited to 1 when variable speed is turned off.  Finally,
  339. X    it might be nice to expose the VariableSpeed frequency scaling
  340. X    factor used in LIC_Ripple.  LIC_Ripple scales the ripple filter
  341. X    frequency inversely with vector magnitude.  It's currently
  342. X    hardwired to map maximum to 0 vectors to scale factors of 1.0
  343. X    and 6.0, respectively.
  344. X
  345. X    o    Should probably expose SIN_PARALLEL as a user specifiable
  346. X    parameter.  (SIN_PARALLEL is the sin(w) of some small angle w.
  347. X    It is used in the convolution LIC path advection code to
  348. X    determine whether a vector is ``parallel'' to a vector cell
  349. X    edge or face.)  Might also want to expose the maximum loop
  350. X    count factor of the inner convolution loop -- it's currently
  351. X    3 * Length.
  352. X
  353. X    o    Implement image and vector field formatting handling
  354. X    dynamically at run time.  Currently only compile time support
  355. X    for image pixel types is supported.  There is only support for
  356. X    single precision vector fields.
  357. X
  358. X    o    There are too many parameters to LIC_Create.  There are also
  359. X    simultaneously too few and too many LIC_ChangeFoo routines.
  360. X    There are too few because we really want to expose all the LIC
  361. X    knobs to the user, but there are too many because they're
  362. X    proliferating like rabbits.  Probably something more along the
  363. X    lines of XtVaSetArgs is what we really want.
  364. X
  365. X    o    LIC_Image and LIC_VectorField should have a set of methods put
  366. X    together to create, modify, query and destroy them.  That
  367. X    would help clean up the horrible parameter mess that
  368. X    LIC_Create has become.
  369. X
  370. X    o    The LIC_Filter type should be yet another object type that not
  371. X    only keeps a pointer to the filter kernel integral function,
  372. X    but also keeps track of any special filter specific
  373. X    parameters.
  374. X
  375. X    o    Should we implement a routine that makes it easy to reissue a
  376. X    convolution on the output of a previous convolution?
  377. X
  378. END_OF_FILE
  379.   if test 2938 -ne `wc -c <'lic.1.2/TODO'`; then
  380.     echo shar: \"'lic.1.2/TODO'\" unpacked with wrong size!
  381.   fi
  382.   # end of 'lic.1.2/TODO'
  383. fi
  384. if test -f 'lic.1.2/liblic/LIC_ComputeImage.3' -a "${1}" != "-c" ; then 
  385.   echo shar: Will not clobber existing file \"'lic.1.2/liblic/LIC_ComputeImage.3'\"
  386. else
  387.   echo shar: Extracting \"'lic.1.2/liblic/LIC_ComputeImage.3'\" \(3052 characters\)
  388.   sed "s/^X//" >'lic.1.2/liblic/LIC_ComputeImage.3' <<'END_OF_FILE'
  389. X.\" Copyright (c) 1993 The Regents of the University of California.
  390. X.\" All rights reserved.
  391. X.\"
  392. X.\" Redistribution and use in source and binary forms, with or without
  393. X.\" modification, are permitted provided that the following conditions
  394. X.\" are met:
  395. X.\" 1. Redistributions of source code must retain the above copyright
  396. X.\"    notice, this list of conditions and the following disclaimer.
  397. X.\" 2. Redistributions in binary form must reproduce the above copyright
  398. X.\"    notice, this list of conditions and the following disclaimer in the
  399. X.\"    documentation and/or other materials provided with the distribution.
  400. X.\" 3. All advertising materials mentioning features or use of this software
  401. X.\"    must display the following acknowledgement:
  402. X.\"    This product includes software developed by the University of
  403. X.\"    California, Lawrence Livermore National Laboratory and its
  404. X.\"    contributors.
  405. X.\" 4. Neither the name of the University nor the names of its contributors
  406. X.\"    may be used to endorse or promote products derived from this software
  407. X.\"    without specific prior written permission.
  408. X.\"
  409. X.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  410. X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  411. X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  412. X.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  413. X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  414. X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  415. X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  416. X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  417. X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  418. X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  419. X.\" SUCH DAMAGE.
  420. X.\"
  421. X.de Hd
  422. X.ds Dt \\$4
  423. X..
  424. X.Hd $Header: /d/sisal/a/casey/tmp/lic/liblic/RCS/LIC_ComputeImage.3,v 1.4 1993/07/28 19:04:02 casey Exp $
  425. X.TH LIC_COMPUTEIMAGE 3 \*(Dt
  426. X.SH NAME
  427. XLIC_ComputeImage \- compute image using Line Integral Convolution
  428. X.SH SYNOPSIS
  429. X.nf
  430. X#include <lic.h>
  431. X
  432. Xvoid \fBLIC_ComputeImage\fP(LIC *\fIThis\fP)
  433. X.fi
  434. X.SH DESCRIPTION
  435. X.B LIC_ComputeImage
  436. Xcalls the appropriate Line Integral Convolution method for each input
  437. Xvector field cell and deposits the normalized results into the output image.
  438. X.PP
  439. XFor each cell,
  440. X.B LIC_ComputeImage
  441. Xcalls the appropriate convolution method twice: once to compute the partial LIC
  442. Xfor the positive vector field direction and once for the negative direction.
  443. XThe two partial results are summed and normalized by the summed normalization
  444. Xfactors.
  445. X.PP
  446. XCurrently two- and three-dimensional versions of Line Integral Convolution
  447. Xare implemented.
  448. X.B LIC_ComputeImage
  449. Xcalls one of
  450. X.BR LIC_Convolve2D (3)
  451. Xor
  452. X.BR LIC_Convolve3D (3)
  453. Xdepending on the Z depth of the input vector field.
  454. X.SH "SEE ALSO"
  455. X.BR LIC (3),
  456. X.BR LIC_Convolve (3)
  457. X.SH STANDARDS
  458. XThis is unsupported, non-standard software.  It is not the subject of any
  459. Xstandards effort.
  460. END_OF_FILE
  461.   if test 3052 -ne `wc -c <'lic.1.2/liblic/LIC_ComputeImage.3'`; then
  462.     echo shar: \"'lic.1.2/liblic/LIC_ComputeImage.3'\" unpacked with wrong size!
  463.   fi
  464.   # end of 'lic.1.2/liblic/LIC_ComputeImage.3'
  465. fi
  466. if test -f 'lic.1.2/liblic/LIC_Convolve.3' -a "${1}" != "-c" ; then 
  467.   echo shar: Will not clobber existing file \"'lic.1.2/liblic/LIC_Convolve.3'\"
  468. else
  469.   echo shar: Extracting \"'lic.1.2/liblic/LIC_Convolve.3'\" \(4666 characters\)
  470.   sed "s/^X//" >'lic.1.2/liblic/LIC_Convolve.3' <<'END_OF_FILE'
  471. X.\" Copyright (c) 1993 The Regents of the University of California.
  472. X.\" All rights reserved.
  473. X.\"
  474. X.\" Redistribution and use in source and binary forms, with or without
  475. X.\" modification, are permitted provided that the following conditions
  476. X.\" are met:
  477. X.\" 1. Redistributions of source code must retain the above copyright
  478. X.\"    notice, this list of conditions and the following disclaimer.
  479. X.\" 2. Redistributions in binary form must reproduce the above copyright
  480. X.\"    notice, this list of conditions and the following disclaimer in the
  481. X.\"    documentation and/or other materials provided with the distribution.
  482. X.\" 3. All advertising materials mentioning features or use of this software
  483. X.\"    must display the following acknowledgement:
  484. X.\"    This product includes software developed by the University of
  485. X.\"    California, Lawrence Livermore National Laboratory and its
  486. X.\"    contributors.
  487. X.\" 4. Neither the name of the University nor the names of its contributors
  488. X.\"    may be used to endorse or promote products derived from this software
  489. X.\"    without specific prior written permission.
  490. X.\"
  491. X.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  492. X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  493. X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  494. X.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  495. X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  496. X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  497. X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  498. X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  499. X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  500. X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  501. X.\" SUCH DAMAGE.
  502. X.\"
  503. X.de Hd
  504. X.ds Dt \\$4
  505. X..
  506. X.Hd $Header: /d/sisal/a/casey/tmp/lic/liblic/RCS/LIC_Convolve.3,v 1.2 1993/05/28 04:33:53 casey Exp $
  507. X.TH LIC_CONVOLVE 3 \*(Dt
  508. X.SH NAME
  509. XLIC_Convolve2D, LIC_Convolve3D \- Line Integral Convolution engines
  510. X.SH SYNOPSIS
  511. X.nf
  512. X#include <lic.h>
  513. X
  514. X.ta \w'LIC *\fBLIC_Convolve2D\fP('u +\w'doubleXXX'u
  515. Xvoid \fBLIC_Convolve2D\fP(LIC    *\fIThis\fP,
  516. X.ta \w'LIC *\fBLIC_Convolve2D\fP('u +\w'doubleXXX*'u
  517. X    int    \fIi\fP,
  518. X    int    \fIj\fP,
  519. X    int    \fIdirection\fP,
  520. X.ta \w'LIC *\fBLIC_Convolve2D\fP('u +\w'doubleXXX'u
  521. X    double    *\fIrIntegral\fP,
  522. X    double    *\fIgIntegral\fP,
  523. X    double    *\fIbIntegral\fP,
  524. X    double    *\fIaIntegral\fP,
  525. X    double    *\fIKernelArea\fP)
  526. X.DT
  527. X
  528. X.ta \w'LIC *\fBLIC_Convolve3D\fP('u +\w'doubleXXX'u
  529. Xvoid \fBLIC_Convolve3D\fP(LIC    *\fIThis\fP,
  530. X.ta \w'LIC *\fBLIC_Convolve3D\fP('u +\w'doubleXXX*'u
  531. X    int    \fIi\fP,
  532. X    int    \fIj\fP,
  533. X    int    \fIk\fP,
  534. X    int    \fIdirection\fP,
  535. X.ta \w'LIC *\fBLIC_Convolve3D\fP('u +\w'doubleXXX'u
  536. X    double    *\fIrIntegral\fP,
  537. X    double    *\fIgIntegral\fP,
  538. X    double    *\fIbIntegral\fP,
  539. X    double    *\fIaIntegral\fP,
  540. X    double    *\fIKernelArea\fP)
  541. X.DT
  542. X.fi
  543. X.SH DESCRIPTION
  544. X.B LIC_Convolve2D
  545. Xand
  546. X.B LIC_Convolve3D
  547. Xperform the Line Integral Convolution algorithm for two and three dimensions,
  548. Xrespectively.
  549. X.IR i ,
  550. X.I j
  551. Xand
  552. X.I k
  553. Xrepresent the position within the vector field to image.  These are all
  554. Xzero based indexes.
  555. X.PP
  556. X.I direction
  557. Xcontrols whether the LIC follows the vector field foreward along vector
  558. Xfield lines,
  559. X.BR LIC_FOREWARD ,
  560. Xor backward along the negative of vector field lines,
  561. X.BR LIC_BACKWARD .
  562. X.PP
  563. X.IR rIntegral ,
  564. X.IR gIntegral ,
  565. X.I bIntegral
  566. Xand
  567. X.I aIntegral
  568. Xare value return parameters.  On return from the convolution routine, they
  569. Xwill hold the red, green, blue and alpha LIC sums, respectively.  These
  570. Xsums represent the convolution of the LIC filter,
  571. X.IR k(s) ,
  572. Xwith the pixel values,
  573. X.IR F(s) ,
  574. Xalong the LIC path.
  575. X.PP
  576. X.I KernelArea
  577. Xis a value return parameter.  On return from the convolution routine,
  578. Xit will hold the area (integral) of the filter kernel for the
  579. Xconvolution.  For variable normalization (see
  580. X.BR LIC_Create )
  581. Xonly the area under the portion of the filter kernel actually used in
  582. Xthe convolution will be returned.  For fixed normalization the area
  583. Xreturned will be for the entire filter kernel corresponding to
  584. X.IR direction .
  585. XThese will differ when the LIC path is prematurely terminated due to a vector
  586. Xfield singularity or running off the edge of the vector field.
  587. X.SH "SEE ALSO"
  588. X.BR LIC (3),
  589. X.BR LIC_ComputeImage (3)
  590. X.SH BUGS
  591. XIf
  592. X.IR i ,
  593. X.I j
  594. Xor
  595. X.I k
  596. Xare out of range (less than 0 or greater than or equal to their corresponding
  597. Xdimension size), the most likely outcome will be a segmentation fault.  This
  598. Xshould probably be fixed ...
  599. X.SH STANDARDS
  600. XThis is unsupported, non-standard software.  It is not the subject of any
  601. Xstandards effort.
  602. END_OF_FILE
  603.   if test 4666 -ne `wc -c <'lic.1.2/liblic/LIC_Convolve.3'`; then
  604.     echo shar: \"'lic.1.2/liblic/LIC_Convolve.3'\" unpacked with wrong size!
  605.   fi
  606.   # end of 'lic.1.2/liblic/LIC_Convolve.3'
  607. fi
  608. if test -f 'lic.1.2/liblic/LIC_Destroy.3' -a "${1}" != "-c" ; then 
  609.   echo shar: Will not clobber existing file \"'lic.1.2/liblic/LIC_Destroy.3'\"
  610. else
  611.   echo shar: Extracting \"'lic.1.2/liblic/LIC_Destroy.3'\" \(2577 characters\)
  612.   sed "s/^X//" >'lic.1.2/liblic/LIC_Destroy.3' <<'END_OF_FILE'
  613. X.\" Copyright (c) 1993 The Regents of the University of California.
  614. X.\" All rights reserved.
  615. X.\"
  616. X.\" Redistribution and use in source and binary forms, with or without
  617. X.\" modification, are permitted provided that the following conditions
  618. X.\" are met:
  619. X.\" 1. Redistributions of source code must retain the above copyright
  620. X.\"    notice, this list of conditions and the following disclaimer.
  621. X.\" 2. Redistributions in binary form must reproduce the above copyright
  622. X.\"    notice, this list of conditions and the following disclaimer in the
  623. X.\"    documentation and/or other materials provided with the distribution.
  624. X.\" 3. All advertising materials mentioning features or use of this software
  625. X.\"    must display the following acknowledgement:
  626. X.\"    This product includes software developed by the University of
  627. X.\"    California, Lawrence Livermore National Laboratory and its
  628. X.\"    contributors.
  629. X.\" 4. Neither the name of the University nor the names of its contributors
  630. X.\"    may be used to endorse or promote products derived from this software
  631. X.\"    without specific prior written permission.
  632. X.\"
  633. X.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  634. X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  635. X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  636. X.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  637. X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  638. X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  639. X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  640. X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  641. X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  642. X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  643. X.\" SUCH DAMAGE.
  644. X.\"
  645. X.de Hd
  646. X.ds Dt \\$4
  647. X..
  648. X.Hd $Header: /d/sisal/a/casey/tmp/lic/liblic/RCS/LIC_Destroy.3,v 1.1 1993/05/27 20:18:46 casey Exp $
  649. X.TH LIC_DESTROY 3 \*(Dt
  650. X.SH NAME
  651. XLIC_Destroy \- destroy Line Integral Convolution object instance
  652. X.SH SYNOPSIS
  653. X.nf
  654. X#include <lic.h>
  655. X
  656. Xvoid \fBLIC_Destroy\fP(LIC *\fIThis\fP)
  657. X.fi
  658. X.SH DESCRIPTION
  659. X.B LIC_Destroy
  660. Xdestroys a LIC instance pointed to by
  661. X.IR This .
  662. XThe LIC instance must previously have been instantiated via
  663. X.BR LIC_Create .
  664. XAny resources allocated to the LIC instance will be freed up by
  665. X.BR LIC_Destroy .
  666. X.SH "SEE ALSO"
  667. X.BR LIC (3),
  668. X.BR LIC_Create (3)
  669. X.SH STANDARDS
  670. XThis is unsupported, non-standard software.  It is not the subject of any
  671. Xstandards effort.
  672. END_OF_FILE
  673.   if test 2577 -ne `wc -c <'lic.1.2/liblic/LIC_Destroy.3'`; then
  674.     echo shar: \"'lic.1.2/liblic/LIC_Destroy.3'\" unpacked with wrong size!
  675.   fi
  676.   # end of 'lic.1.2/liblic/LIC_Destroy.3'
  677. fi
  678. if test -f 'lic.1.2/liblic/LIC_Modify.3' -a "${1}" != "-c" ; then 
  679.   echo shar: Will not clobber existing file \"'lic.1.2/liblic/LIC_Modify.3'\"
  680. else
  681.   echo shar: Extracting \"'lic.1.2/liblic/LIC_Modify.3'\" \(5028 characters\)
  682.   sed "s/^X//" >'lic.1.2/liblic/LIC_Modify.3' <<'END_OF_FILE'
  683. X.\" Copyright (c) 1993 The Regents of the University of California.
  684. X.\" All rights reserved.
  685. X.\"
  686. X.\" Redistribution and use in source and binary forms, with or without
  687. X.\" modification, are permitted provided that the following conditions
  688. X.\" are met:
  689. X.\" 1. Redistributions of source code must retain the above copyright
  690. X.\"    notice, this list of conditions and the following disclaimer.
  691. X.\" 2. Redistributions in binary form must reproduce the above copyright
  692. X.\"    notice, this list of conditions and the following disclaimer in the
  693. X.\"    documentation and/or other materials provided with the distribution.
  694. X.\" 3. All advertising materials mentioning features or use of this software
  695. X.\"    must display the following acknowledgement:
  696. X.\"    This product includes software developed by the University of
  697. X.\"    California, Lawrence Livermore National Laboratory and its
  698. X.\"    contributors.
  699. X.\" 4. Neither the name of the University nor the names of its contributors
  700. X.\"    may be used to endorse or promote products derived from this software
  701. X.\"    without specific prior written permission.
  702. X.\"
  703. X.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  704. X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  705. X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  706. X.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  707. X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  708. X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  709. X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  710. X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  711. X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  712. X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  713. X.\" SUCH DAMAGE.
  714. X.\"
  715. X.de Hd
  716. X.ds Dt \\$4
  717. X..
  718. X.Hd $Header: /d/sisal/a/casey/tmp/lic/liblic/RCS/LIC_Modify.3,v 1.3 1993/07/28 21:28:50 casey Exp $
  719. X.TH LIC_MODIFY 3 \*(Dt
  720. X.SH NAME
  721. XLIC_Modify \- change features of LIC object instances
  722. X.SH SYNOPSIS
  723. X.nf
  724. X#include <lic.h>
  725. X
  726. Xvoid \fBLIC_ChangeLength\fP(LIC *\fIThis\fP, double \fIlength\fP)
  727. Xvoid \fBLIC_ChangeFrequency\fP(LIC *\fIThis\fP, double \fIfrequency\fP);
  728. Xvoid \fBLIC_ChangePhase\fP(LIC *\fIThis\fP, double \fIphase\fP)
  729. Xvoid \fBLIC_ChangeFilter\fP(LIC *\fIThis\fP, LIC_Filter \fIfilter\fP)
  730. X.fi
  731. X.SH DESCRIPTION
  732. X.if t .ds pi \(*p
  733. X.if n .ds pi Pi
  734. X.B LIC_ChangeLength
  735. Xwill change the length of the filter kernel support for
  736. X.I This
  737. Xto
  738. X.IR length .
  739. XThe length of the filter kernel will actually be
  740. X.RI 2* length ,
  741. Xextending from
  742. X.RI - length
  743. Xto
  744. X.RI + length .
  745. XIt is an error to specify a
  746. X.I length
  747. Xless than
  748. X.BR 0 .
  749. X.PP
  750. X.B LIC_ChangeFrequency
  751. Xwill change the filter frequency for
  752. X.I This
  753. Xto
  754. X.IR frequency .
  755. X.B LIC_ChangePhase
  756. Xwill change the filter phase to
  757. X.IR phase .
  758. X.I frequency
  759. Xis interpreted as the number of cycles of the filter kernel over the domain
  760. X.RB - \*(pi
  761. Xto
  762. X.BR \*(pi .
  763. X.I phase
  764. Xis interpreted as the phase offset of the filter kernel in the same domain.
  765. XBoth
  766. X.I frequency
  767. Xand
  768. X.I phase
  769. Xare scaled to the length of the filter kernel.  Thus, a
  770. X.I frequency
  771. Xof 2 will cause two repetitions of the filter kernel across the domain
  772. X.RI - length
  773. Xto
  774. X.RI + length .
  775. X.I frequency
  776. Xmust be non-zero and positive.
  777. XCurrently, the only filter supplied with the LIC library that uses these
  778. Xoptions is
  779. X.BR LIC_Ripple .
  780. X.PP
  781. X.B LIC_ChangeFilter
  782. Xwill change the filter kernel integral function for
  783. X.I This
  784. Xto
  785. X.IR filter .
  786. X.I filter
  787. Xmust be a pointer to a LIC_Filter type function:
  788. X.PP
  789. X.RS
  790. X.nf
  791. Xdouble \fIfilter\fP(LIC *\fIThis\fP, double \fIa\fP, double \fIb\fP, double \fIfrequency\fP)
  792. X.fi
  793. X.RE
  794. X.PP
  795. X.I filter
  796. Xshould return the integral of the filter kernel between
  797. X.I a
  798. Xand
  799. X.IR b .
  800. X.I frequency
  801. Xspecifies the frequency that
  802. X.I filter
  803. Xshould use for its filter kernel.
  804. X.I frequency
  805. Xis used to implement the variable speed option specified to
  806. X.B LIC_Create
  807. X(though many filters ignore this parameter).
  808. X.PP
  809. XThe following filters are supplied with the LIC library:
  810. X.PP
  811. X.RS
  812. X.nf
  813. Xdouble \fBLIC_Box\fP(LIC *\fIThis\fP, double \fIa\fP, double \fIb\fP, int \fIspeed\fP)
  814. Xdouble \fBLIC_Ripple\fP(LIC *\fIThis\fP, double \fIa\fP, double \fIb\fP, int \fIspeed\fP)
  815. Xdouble \fBLIC_Ramp\fP(LIC *\fIThis\fP, double \fIa\fP, double \fIb\fP, int \fIspeed\fP)
  816. Xdouble \fBLIC_Select\fP(LIC *\fIThis\fP, double \fIa\fP, double \fIb\fP, int \fIspeed\fP)
  817. X.fi
  818. X.RE
  819. X.PP
  820. XSee
  821. X.BR LIC_Filters (3)
  822. Xfor more information on LIC filters and the integration process.
  823. X.SH "SEE ALSO"
  824. X.BR LIC (3),
  825. X.BR LIC_Create (3),
  826. X.BR LIC_Destroy (3),
  827. X.BR LIC_Filters (3),
  828. X.BR LIC_Query (3)
  829. X.SH BUGS
  830. XIf a negative
  831. X.I length
  832. Xis specified to
  833. X.BR LIC_ChangeLength ,
  834. Xa length of 0 will be used instead.
  835. XIf a negative or zero
  836. X.I frequency
  837. Xis specified to
  838. X.BR LIC_ChangeFrequency ,
  839. Xa frequency of 1e-6 will be used instead.  In both cases error messages
  840. Xshould probably be output.
  841. X.SH STANDARDS
  842. XThis is unsupported, non-standard software.  It is not the subject of any
  843. Xstandards effort.
  844. END_OF_FILE
  845.   if test 5028 -ne `wc -c <'lic.1.2/liblic/LIC_Modify.3'`; then
  846.     echo shar: \"'lic.1.2/liblic/LIC_Modify.3'\" unpacked with wrong size!
  847.   fi
  848.   # end of 'lic.1.2/liblic/LIC_Modify.3'
  849. fi
  850. if test -f 'lic.1.2/liblic/LIC_Query.3' -a "${1}" != "-c" ; then 
  851.   echo shar: Will not clobber existing file \"'lic.1.2/liblic/LIC_Query.3'\"
  852. else
  853.   echo shar: Extracting \"'lic.1.2/liblic/LIC_Query.3'\" \(3652 characters\)
  854.   sed "s/^X//" >'lic.1.2/liblic/LIC_Query.3' <<'END_OF_FILE'
  855. X.\" Copyright (c) 1993 The Regents of the University of California.
  856. X.\" All rights reserved.
  857. X.\"
  858. X.\" Redistribution and use in source and binary forms, with or without
  859. X.\" modification, are permitted provided that the following conditions
  860. X.\" are met:
  861. X.\" 1. Redistributions of source code must retain the above copyright
  862. X.\"    notice, this list of conditions and the following disclaimer.
  863. X.\" 2. Redistributions in binary form must reproduce the above copyright
  864. X.\"    notice, this list of conditions and the following disclaimer in the
  865. X.\"    documentation and/or other materials provided with the distribution.
  866. X.\" 3. All advertising materials mentioning features or use of this software
  867. X.\"    must display the following acknowledgement:
  868. X.\"    This product includes software developed by the University of
  869. X.\"    California, Lawrence Livermore National Laboratory and its
  870. X.\"    contributors.
  871. X.\" 4. Neither the name of the University nor the names of its contributors
  872. X.\"    may be used to endorse or promote products derived from this software
  873. X.\"    without specific prior written permission.
  874. X.\"
  875. X.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  876. X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  877. X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  878. X.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  879. X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  880. X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  881. X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  882. X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  883. X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  884. X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  885. X.\" SUCH DAMAGE.
  886. X.\"
  887. X.de Hd
  888. X.ds Dt \\$4
  889. X..
  890. X.Hd $Header: /d/sisal/a/casey/tmp/lic/liblic/RCS/LIC_Query.3,v 1.1 1993/05/27 20:18:46 casey Exp $
  891. X.TH LIC_QUERY 3 \*(Dt
  892. X.SH NAME
  893. XLIC_Query \- request information on LIC object instances and the library
  894. X.SH SYNOPSIS
  895. X.nf
  896. X#include <lic.h>
  897. X
  898. Xunsigned char *\fBLIC_InputImage\fP(LIC *\fIThis\fP)
  899. Xfloat *\fBLIC_InputField\fP(LIC *\fIThis\fP)
  900. Xunsigned char *\fBLIC_OutputImage\fP(LIC *\fIThis\fP)
  901. X
  902. Xdouble \fBLIC_Length\fP(LIC *\fIThis\fP)
  903. Xdouble \fBLIC_Phase\fP(LIC *\fIThis\fP)
  904. Xdouble \fBLIC_Frequency\fP(LIC *\fIThis\fP)
  905. X
  906. Xchar *\fBLIC_ConfiguredPixelType\fP(void)
  907. Xint \fBLIC_ConfiguredPixelSize\fP(void)
  908. X.fi
  909. X.SH DESCRIPTION
  910. X.BR LIC_InputImage ,
  911. X.B LIC_InputField
  912. Xand
  913. X.B LIC_OutputImage
  914. Xreturn pointers to the input image, input vector field and output image,
  915. Xrespectively.
  916. X.BR LIC_Length ,
  917. X.B LIC_Phase
  918. Xand
  919. X.B LIC_Frequency
  920. Xreturn the current filter kernel length, phase and frequency, respectively.
  921. X.PP
  922. X.B LIC_ConfiguredPixelType
  923. Xreturns a pointer to a character string representation of the pixel type
  924. Xconfigured into the LIC library.
  925. X.B LIC_ConfiguredPixelSize
  926. Xreturns the size in bytes of pixel values configured into the LIC library.
  927. X.PP
  928. XReturn values from
  929. X.B LIC_ConfiguredPixelType and LIC_ConfiguredPixelSize are:
  930. X.PP
  931. X.RS
  932. X.nf
  933. X.ta \w'MONOCHROMEXXX'u
  934. X.I Type    Size
  935. X\fBMONOCHROME\fP    1
  936. X\fBRGB\fP    3
  937. X\fBBGR\fP    3
  938. X\fBRGBA\fP    4
  939. X\fBBGRA\fP    4
  940. X\fBARGB\fP    4
  941. X\fBABGR\fP    4
  942. X.DT
  943. X.fi
  944. X.RE
  945. X.SH "SEE ALSO"
  946. X.BR LIC (3),
  947. X.BR LIC_Create (3),
  948. X.BR LIC_Destroy (3),
  949. X.BR LIC_Modify (3)
  950. X.SH BUGS
  951. XNeither
  952. X.B LIC_ConfiguredPixelType
  953. Xnor
  954. X.BR LIC_ConfiguredPixelSize .
  955. Xshould be necessary.  Such issues should be handled dynamically at run-time
  956. Xinstead of compile-time.
  957. X.SH STANDARDS
  958. XThis is unsupported, non-standard software.  It is not the subject of any
  959. Xstandards effort.
  960. END_OF_FILE
  961.   if test 3652 -ne `wc -c <'lic.1.2/liblic/LIC_Query.3'`; then
  962.     echo shar: \"'lic.1.2/liblic/LIC_Query.3'\" unpacked with wrong size!
  963.   fi
  964.   # end of 'lic.1.2/liblic/LIC_Query.3'
  965. fi
  966. if test -f 'lic.1.2/liblic/Modify.c' -a "${1}" != "-c" ; then 
  967.   echo shar: Will not clobber existing file \"'lic.1.2/liblic/Modify.c'\"
  968. else
  969.   echo shar: Extracting \"'lic.1.2/liblic/Modify.c'\" \(3108 characters\)
  970.   sed "s/^X//" >'lic.1.2/liblic/Modify.c' <<'END_OF_FILE'
  971. X/*
  972. X * $Header: /d/sisal/a/casey/tmp/lic/liblic/RCS/Modify.c,v 1.6 1993/07/28 18:54:58 casey Exp $
  973. X */
  974. X
  975. X/*
  976. X * Copyright (c) 1993 The Regents of the University of California.
  977. X * All rights reserved.
  978. X *
  979. X * Redistribution and use in source and binary forms, with or without
  980. X * modification, are permitted provided that the following conditions
  981. X * are met:
  982. X * 1. Redistributions of source code must retain the above copyright
  983. X *    notice, this list of conditions and the following disclaimer.
  984. X * 2. Redistributions in binary form must reproduce the above copyright
  985. X *    notice, this list of conditions and the following disclaimer in the
  986. X *    documentation and/or other materials provided with the distribution.
  987. X * 3. All advertising materials mentioning features or use of this software
  988. X *    must display the following acknowledgement:
  989. X *    This product includes software developed by the University of
  990. X *    California, Lawrence Livermore National Laboratory and its
  991. X *    contributors.
  992. X * 4. Neither the name of the University nor the names of its contributors
  993. X *    may be used to endorse or promote products derived from this software
  994. X *    without specific prior written permission.
  995. X *
  996. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  997. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  998. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  999. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1000. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1001. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1002. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1003. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1004. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1005. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1006. X * SUCH DAMAGE.
  1007. X */
  1008. X
  1009. X#ifndef lint
  1010. X    static char rcsid[] = "$Header: /d/sisal/a/casey/tmp/lic/liblic/RCS/Modify.c,v 1.6 1993/07/28 18:54:58 casey Exp $";
  1011. X    static char copyright[] =
  1012. X    "Copyright (c) 1993 The Regents of the University of California.\n"
  1013. X    "All rights reserved.\n";
  1014. X#endif
  1015. X
  1016. X
  1017. X#include "liblic.h"
  1018. X
  1019. X
  1020. X/*
  1021. X *    Change various features of LIC instances.
  1022. X *    =========================================
  1023. X */
  1024. X
  1025. X
  1026. Xvoid
  1027. XLIC_ChangeLength(LIC *This, double length)
  1028. X    /*
  1029. X     * Change the length of the filter kernel.
  1030. X     */
  1031. X{
  1032. X    This->Length = (length < 0.0) ? 0.0 : length;
  1033. X    This->NeedIntegration = TRUE;
  1034. X}
  1035. X
  1036. X
  1037. Xvoid
  1038. XLIC_ChangePhase(LIC *This, double phase)
  1039. X    /*
  1040. X     * Change the phase of the filter kernel.
  1041. X     */
  1042. X{
  1043. X    This->Phase = phase;
  1044. X    This->NeedIntegration = TRUE;
  1045. X}
  1046. X
  1047. X
  1048. Xvoid
  1049. XLIC_ChangeFrequency(LIC *This, double frequency)
  1050. X    /*
  1051. X     * Change the frequency of the filter kernel.
  1052. X     */
  1053. X{
  1054. X    This->Frequency = (frequency <= 0.0) ? 1e-6 : frequency;
  1055. X    This->NeedIntegration = TRUE;
  1056. X}
  1057. X
  1058. X
  1059. Xvoid
  1060. XLIC_ChangeFilter(LIC *This, LIC_Filter filter)
  1061. X    /*
  1062. X     * Change the filter kernel.
  1063. X     */
  1064. X{
  1065. X    This->Filter = filter;
  1066. X    This->NeedIntegration = TRUE;
  1067. X}
  1068. END_OF_FILE
  1069.   if test 3108 -ne `wc -c <'lic.1.2/liblic/Modify.c'`; then
  1070.     echo shar: \"'lic.1.2/liblic/Modify.c'\" unpacked with wrong size!
  1071.   fi
  1072.   # end of 'lic.1.2/liblic/Modify.c'
  1073. fi
  1074. if test -f 'lic.1.2/test/BasketWeave.c' -a "${1}" != "-c" ; then 
  1075.   echo shar: Will not clobber existing file \"'lic.1.2/test/BasketWeave.c'\"
  1076. else
  1077.   echo shar: Extracting \"'lic.1.2/test/BasketWeave.c'\" \(5711 characters\)
  1078.   sed "s/^X//" >'lic.1.2/test/BasketWeave.c' <<'END_OF_FILE'
  1079. X/*
  1080. X * $Header: /d/sisal/a/casey/tmp/lic/test/RCS/BasketWeave.c,v 1.4 1993/08/10 17:18:22 casey Exp $
  1081. X */
  1082. X
  1083. X/*
  1084. X * Copyright (c) 1993 The Regents of the University of California.
  1085. X * All rights reserved.
  1086. X *
  1087. X * Redistribution and use in source and binary forms, with or without
  1088. X * modification, are permitted provided that the following conditions
  1089. X * are met:
  1090. X * 1. Redistributions of source code must retain the above copyright
  1091. X *    notice, this list of conditions and the following disclaimer.
  1092. X * 2. Redistributions in binary form must reproduce the above copyright
  1093. X *    notice, this list of conditions and the following disclaimer in the
  1094. X *    documentation and/or other materials provided with the distribution.
  1095. X * 3. All advertising materials mentioning features or use of this software
  1096. X *    must display the following acknowledgement:
  1097. X *    This product includes software developed by the University of
  1098. X *    California, Lawrence Livermore National Laboratory and its
  1099. X *    contributors.
  1100. X * 4. Neither the name of the University nor the names of its contributors
  1101. X *    may be used to endorse or promote products derived from this software
  1102. X *    without specific prior written permission.
  1103. X *
  1104. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1105. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1106. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1107. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1108. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1109. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1110. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1111. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1112. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1113. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1114. X * SUCH DAMAGE.
  1115. X */
  1116. X
  1117. X#ifndef lint
  1118. X    static char rcsid[] = "$Header: /d/sisal/a/casey/tmp/lic/test/RCS/BasketWeave.c,v 1.4 1993/08/10 17:18:22 casey Exp $";
  1119. X    static char copyright[] =
  1120. X    "Copyright (c) 1993 The Regents of the University of California.\n"
  1121. X    "All rights reserved.\n";
  1122. X#endif
  1123. X
  1124. X
  1125. X#include <stdlib.h>
  1126. X#include <unistd.h>
  1127. X#include <errno.h>
  1128. X#include <fcntl.h>
  1129. X#include <string.h>
  1130. X#include <stdio.h>
  1131. X
  1132. X
  1133. X/*
  1134. X * Create a two-dimensional floating point vector field with horizontal and
  1135. X * vertical vectors alternating in a checkerboard fashion.  Each checker
  1136. X * will be surrounded by a border of zero vectors.  When rendered with
  1137. X * Line Integral Convolution and white noise as input, this will generate
  1138. X * a basket weave texture.
  1139. X */
  1140. X
  1141. X
  1142. X#ifdef NEED_EXIT_CODES
  1143. X    /*
  1144. X     * EXIT_SUCCESS and EXIT_FAILURE are supposed to be defined in <stdlib.h>
  1145. X     * according to the ANSI C X3.159-1989 specification, but Sun OS 4.1.1
  1146. X     * fails to define them ...
  1147. X     */
  1148. X#   define EXIT_SUCCESS    0
  1149. X#   define EXIT_FAILURE    1
  1150. X#endif
  1151. X
  1152. X
  1153. X#ifdef NEED_STRERROR
  1154. X    /*
  1155. X     * strerror is supposed to be defined in <string.h> and supplied in the
  1156. X     * standard C library according to the ANSI C X3.159-1989 specification,
  1157. X     * but Sun OS 4.1.1 fails to define or supply it ...  Unfortunately the
  1158. X     * only way we can control this is with an externally supplied define.
  1159. X     */
  1160. X    extern int      errno;        /* system error number */
  1161. X    extern char     *sys_errlist[];    /* system error messages */
  1162. X    extern int      sys_nerr;        /* number of entries in sys_errlist */
  1163. X
  1164. X    char *
  1165. X    strerror(int err)
  1166. X    {
  1167. X    if (err < 0 || err >= sys_nerr) {
  1168. X        static char msg[100];
  1169. X
  1170. X        sprintf(msg, "system error number %d", err);
  1171. X        return(msg);
  1172. X    }
  1173. X    return(sys_errlist[err]);
  1174. X    }
  1175. X#endif
  1176. X
  1177. X
  1178. X#define HORIZONTAL   0            /* must == !VERTICAL */
  1179. X#define VERTICAL     1            /* must == !HORIZONTAL */
  1180. X
  1181. X
  1182. Xmain(int argc, char *argv[])
  1183. X{
  1184. X    char          *myname;
  1185. X    char          *file;
  1186. X    int            Xres, Yres, Xchecks, Ychecks;
  1187. X    int            Xchecker, Ychecker;
  1188. X    register int   Orientation;
  1189. X    float         *VectorField;
  1190. X    register float fx, fy;
  1191. X    register int   i, j;
  1192. X    int            fd, cc;
  1193. X
  1194. X    myname = argv[0];
  1195. X    if (argc != 6)
  1196. X    {
  1197. X    (void)fprintf(stderr, "usage: %s file-name x-res y-res x-checks"
  1198. X              " y-checks\n", myname);
  1199. X    exit(EXIT_FAILURE);
  1200. X    }
  1201. X
  1202. X    /* grab arguments */
  1203. X    file    = argv[1];
  1204. X    Xres    = atoi(argv[2]);
  1205. X    Yres    = atoi(argv[3]);
  1206. X    Xchecks = atoi(argv[4]);
  1207. X    Ychecks = atoi(argv[5]);
  1208. X
  1209. X    Xchecker = Xres / Xchecks;
  1210. X    Ychecker = Yres / Ychecks;
  1211. X
  1212. X    VectorField = (float *)malloc(sizeof(float)*Yres*Xres*2);
  1213. X    if (VectorField == NULL)
  1214. X    {
  1215. X    (void)fprintf(stderr, "%s: insufficient memory for creating the basket"
  1216. X              " weave\n", myname);
  1217. X    exit(EXIT_FAILURE);
  1218. X    }
  1219. X
  1220. X    Orientation = HORIZONTAL;
  1221. X    for (j = 0; j < Yres; j++)
  1222. X    {
  1223. X    if ((j % Ychecker) == 0)
  1224. X        Orientation = !Orientation;
  1225. X
  1226. X    for (i = 0; i < Xres; i++)
  1227. X    {
  1228. X        if ((i % Xchecker) == 0)
  1229. X        Orientation = !Orientation;
  1230. X
  1231. X        if ((i % Xchecker) == 0  || (j % Ychecker) == 0)
  1232. X        {
  1233. X        fx = 0;
  1234. X        fy = 0;
  1235. X        }
  1236. X        else
  1237. X        {
  1238. X        fx = Orientation;
  1239. X        fy = !Orientation;
  1240. X        }
  1241. X        VectorField[2*(j*Xres + i) + 0] = fx;
  1242. X        VectorField[2*(j*Xres + i) + 1] = fy;
  1243. X    }
  1244. X    }
  1245. X
  1246. X    fd = open(file, O_CREAT|O_WRONLY, 0666);
  1247. X    if (fd < 0)
  1248. X    {
  1249. X    (void)fprintf(stderr, "%s: unable to open %s: %s\n", myname, file,
  1250. X              strerror(errno));
  1251. X    exit(EXIT_FAILURE);
  1252. X    }
  1253. X
  1254. X    cc = write(fd, VectorField, 2*sizeof(float)*Xres*Yres);
  1255. X    if (cc != 2*sizeof(float)*Xres*Yres)
  1256. X    {
  1257. X    (void)fprintf(stderr, "%s: write returned short: %s\n", myname,
  1258. X              strerror(errno));
  1259. X    (void)close(fd);
  1260. X    exit(EXIT_FAILURE);
  1261. X    }
  1262. X    (void)close(fd);
  1263. X    exit(EXIT_SUCCESS);
  1264. X}
  1265. END_OF_FILE
  1266.   if test 5711 -ne `wc -c <'lic.1.2/test/BasketWeave.c'`; then
  1267.     echo shar: \"'lic.1.2/test/BasketWeave.c'\" unpacked with wrong size!
  1268.   fi
  1269.   # end of 'lic.1.2/test/BasketWeave.c'
  1270. fi
  1271. if test -f 'lic.1.2/test/CircleField.c' -a "${1}" != "-c" ; then 
  1272.   echo shar: Will not clobber existing file \"'lic.1.2/test/CircleField.c'\"
  1273. else
  1274.   echo shar: Extracting \"'lic.1.2/test/CircleField.c'\" \(5101 characters\)
  1275.   sed "s/^X//" >'lic.1.2/test/CircleField.c' <<'END_OF_FILE'
  1276. X/*
  1277. X * $Header: /d/sisal/a/casey/tmp/lic/test/RCS/CircleField.c,v 1.2 1993/08/10 17:18:22 casey Exp $
  1278. X */
  1279. X
  1280. X/*
  1281. X * Copyright (c) 1993 The Regents of the University of California.
  1282. X * All rights reserved.
  1283. X *
  1284. X * Redistribution and use in source and binary forms, with or without
  1285. X * modification, are permitted provided that the following conditions
  1286. X * are met:
  1287. X * 1. Redistributions of source code must retain the above copyright
  1288. X *    notice, this list of conditions and the following disclaimer.
  1289. X * 2. Redistributions in binary form must reproduce the above copyright
  1290. X *    notice, this list of conditions and the following disclaimer in the
  1291. X *    documentation and/or other materials provided with the distribution.
  1292. X * 3. All advertising materials mentioning features or use of this software
  1293. X *    must display the following acknowledgement:
  1294. X *    This product includes software developed by the University of
  1295. X *    California, Lawrence Livermore National Laboratory and its
  1296. X *    contributors.
  1297. X * 4. Neither the name of the University nor the names of its contributors
  1298. X *    may be used to endorse or promote products derived from this software
  1299. X *    without specific prior written permission.
  1300. X *
  1301. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1302. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1303. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1304. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1305. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1306. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1307. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1308. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1309. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1310. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1311. X * SUCH DAMAGE.
  1312. X */
  1313. X
  1314. X#ifndef lint
  1315. X    static char rcsid[] = "$Header: /d/sisal/a/casey/tmp/lic/test/RCS/CircleField.c,v 1.2 1993/08/10 17:18:22 casey Exp $";
  1316. X    static char copyright[] =
  1317. X    "Copyright (c) 1993 The Regents of the University of California.\n"
  1318. X    "All rights reserved.\n";
  1319. X#endif
  1320. X
  1321. X
  1322. X#include <stdlib.h>
  1323. X#include <unistd.h>
  1324. X#include <errno.h>
  1325. X#include <fcntl.h>
  1326. X#include <string.h>
  1327. X#include <stdio.h>
  1328. X
  1329. X
  1330. X/*
  1331. X * Create a two-dimensional floating point circular vector field.  Each
  1332. X * vector will point 90 degrees, clockwise, away from the center of the
  1333. X * field.  v(x, y) = (x, -y).  Note that the vector magnitudes are *not*
  1334. X * equal to 1.0.
  1335. X */
  1336. X
  1337. X
  1338. X#ifdef NEED_EXIT_CODES
  1339. X    /*
  1340. X     * EXIT_SUCCESS and EXIT_FAILURE are supposed to be defined in <stdlib.h>
  1341. X     * according to the ANSI C X3.159-1989 specification, but Sun OS 4.1.1
  1342. X     * fails to define them ...
  1343. X     */
  1344. X#   define EXIT_SUCCESS    0
  1345. X#   define EXIT_FAILURE    1
  1346. X#endif
  1347. X
  1348. X
  1349. X#ifdef NEED_STRERROR
  1350. X    /*
  1351. X     * strerror is supposed to be defined in <string.h> and supplied in the
  1352. X     * standard C library according to the ANSI C X3.159-1989 specification,
  1353. X     * but Sun OS 4.1.1 fails to define or supply it ...  Unfortunately the
  1354. X     * only way we can control this is with an externally supplied define.
  1355. X     */
  1356. X    extern int      errno;        /* system error number */
  1357. X    extern char     *sys_errlist[];    /* system error messages */
  1358. X    extern int      sys_nerr;        /* number of entries in sys_errlist */
  1359. X
  1360. X    char *
  1361. X    strerror(int err)
  1362. X    {
  1363. X    if (err < 0 || err >= sys_nerr) {
  1364. X        static char msg[100];
  1365. X
  1366. X        sprintf(msg, "system error number %d", err);
  1367. X        return(msg);
  1368. X    }
  1369. X    return(sys_errlist[err]);
  1370. X    }
  1371. X#endif
  1372. X
  1373. X
  1374. Xmain(int argc, char *argv[])
  1375. X{
  1376. X    char          *myname;
  1377. X    char          *file;
  1378. X    int            Xres, Yres;
  1379. X    float         *VectorField;
  1380. X    register float fx, fy;
  1381. X    register int   i, j;
  1382. X    int            fd, cc;
  1383. X
  1384. X    myname = argv[0];
  1385. X    if (argc != 4)
  1386. X    {
  1387. X    (void)fprintf(stderr, "usage: %s file-name x-res y-res\n", myname);
  1388. X    exit(EXIT_FAILURE);
  1389. X    }
  1390. X
  1391. X    /* grab arguments */
  1392. X    file    = argv[1];
  1393. X    Xres    = atoi(argv[2]);
  1394. X    Yres    = atoi(argv[3]);
  1395. X
  1396. X    VectorField = (float *)malloc(sizeof(float)*Yres*Xres*2);
  1397. X    if (VectorField == NULL)
  1398. X    {
  1399. X    (void)fprintf(stderr, "%s: insufficient memory for creating the circle"
  1400. X              " field\n", myname);
  1401. X    exit(EXIT_FAILURE);
  1402. X    }
  1403. X
  1404. X    for ( j = 0; j < Yres; j++ )
  1405. X    {
  1406. X       fy = (float)j/(float)(Yres-1) - 0.5;
  1407. X       for ( i = 0; i < Xres; i++ )
  1408. X       {
  1409. X      fx = (float)i/(float)(Xres-1) - 0.5;
  1410. X      VectorField[2*((Yres - j)*Xres + i) + 0] =  fy;
  1411. X      VectorField[2*((Yres - j)*Xres + i) + 1] = -fx;
  1412. X       }
  1413. X    }
  1414. X
  1415. X    fd = open(file, O_CREAT|O_WRONLY, 0666);
  1416. X    if (fd < 0)
  1417. X    {
  1418. X    (void)fprintf(stderr, "%s: unable to open %s: %s\n", myname, file,
  1419. X              strerror(errno));
  1420. X    exit(EXIT_FAILURE);
  1421. X    }
  1422. X
  1423. X    cc = write(fd, VectorField, 2*sizeof(float)*Xres*Yres);
  1424. X    if (cc != 2*sizeof(float)*Xres*Yres)
  1425. X    {
  1426. X    (void)fprintf(stderr, "%s: write returned short: %s\n", myname,
  1427. X              strerror(errno));
  1428. X    (void)close(fd);
  1429. X    exit(EXIT_FAILURE);
  1430. X    }
  1431. X    (void)close(fd);
  1432. X    exit(EXIT_SUCCESS);
  1433. X}
  1434. END_OF_FILE
  1435.   if test 5101 -ne `wc -c <'lic.1.2/test/CircleField.c'`; then
  1436.     echo shar: \"'lic.1.2/test/CircleField.c'\" unpacked with wrong size!
  1437.   fi
  1438.   # end of 'lic.1.2/test/CircleField.c'
  1439. fi
  1440. if test -f 'lic.1.2/test/Makefile.tmpl' -a "${1}" != "-c" ; then 
  1441.   echo shar: Will not clobber existing file \"'lic.1.2/test/Makefile.tmpl'\"
  1442. else
  1443.   echo shar: Extracting \"'lic.1.2/test/Makefile.tmpl'\" \(1993 characters\)
  1444.   sed "s/^X//" >'lic.1.2/test/Makefile.tmpl' <<'END_OF_FILE'
  1445. X#
  1446. X# $Header: /d/sisal/a/casey/tmp/lic/test/RCS/Makefile.tmpl,v 1.5 1993/08/10 17:46:40 casey Exp $
  1447. X#
  1448. X      DEFINES = $(IMAGE_DEFINES) $(MMAP_DEFINES)
  1449. X
  1450. X        SRCS1 = WhiteNoise.c
  1451. X        OBJS1 = WhiteNoise.o
  1452. X     DEPLIBS1 = $(LIBLIC)
  1453. X     SYSLIBS1 = 
  1454. X     PROGRAM1 = WhiteNoise
  1455. X
  1456. X        SRCS2 = BasketWeave.c
  1457. X        OBJS2 = BasketWeave.o
  1458. X     DEPLIBS2 = 
  1459. X     SYSLIBS2 = 
  1460. X     PROGRAM2 = BasketWeave
  1461. X
  1462. X        SRCS3 = CircleField.c
  1463. X        OBJS3 = CircleField.o
  1464. X     DEPLIBS3 = 
  1465. X     SYSLIBS3 = 
  1466. X     PROGRAM3 = CircleField
  1467. X
  1468. X        SRCS4 = SpiralField.c
  1469. X        OBJS4 = SpiralField.o
  1470. X     DEPLIBS4 = 
  1471. X     SYSLIBS4 = 
  1472. X     PROGRAM4 = SpiralField
  1473. X
  1474. X        SRCS5 = ElectroStatic.c
  1475. X        OBJS5 = ElectroStatic.o
  1476. X     DEPLIBS5 = 
  1477. X     SYSLIBS5 = -lm
  1478. X     PROGRAM5 = ElectroStatic
  1479. X
  1480. X          ALL = $(PROGRAM1) $(PROGRAM2) $(PROGRAM3) $(PROGRAM4) $(PROGRAM5)
  1481. X
  1482. Xall: $(ALL)
  1483. X
  1484. Xincludes:
  1485. X
  1486. X$(PROGRAM1): $(OBJS1) $(DEPLIBS1)
  1487. X    $(CC) $(CFLAGS) -o $(PROGRAM1) $(OBJS1) $(DEPLIBS1) $(SYSLIBS1)
  1488. X
  1489. X$(PROGRAM2): $(OBJS2) $(DEPLIBS2)
  1490. X    $(CC) $(CFLAGS) -o $(PROGRAM2) $(OBJS2) $(DEPLIBS2) $(SYSLIBS2)
  1491. X
  1492. X$(PROGRAM3): $(OBJS3) $(DEPLIBS3)
  1493. X    $(CC) $(CFLAGS) -o $(PROGRAM3) $(OBJS3) $(DEPLIBS3) $(SYSLIBS3)
  1494. X
  1495. X$(PROGRAM4): $(OBJS4) $(DEPLIBS4)
  1496. X    $(CC) $(CFLAGS) -o $(PROGRAM4) $(OBJS4) $(DEPLIBS4) $(SYSLIBS4)
  1497. X
  1498. X$(PROGRAM5): $(OBJS5) $(DEPLIBS5)
  1499. X    $(CC) $(CFLAGS) -o $(PROGRAM5) $(OBJS5) $(DEPLIBS5) $(SYSLIBS5)
  1500. X
  1501. Xtest: $(ALL)
  1502. X    rm -f noise.out weave.out lic.out
  1503. X    ./WhiteNoise  noise.out 256 256
  1504. X    ./BasketWeave weave.out 256 256 8 8
  1505. X    $(TOP)/lic/lic -v -x 256 -y 256 -N -n fixed noise.out weave.out lic.out
  1506. X
  1507. Xinstall:
  1508. X
  1509. Xclean:
  1510. X    rm -f $(PROGRAM1) $(OBJS1)
  1511. X    rm -f $(PROGRAM2) $(OBJS2)
  1512. X    rm -f $(PROGRAM3) $(OBJS3)
  1513. X    rm -f $(PROGRAM4) $(OBJS4)
  1514. X    rm -f $(PROGRAM5) $(OBJS5)
  1515. X    rm -f noise.out weave.out lic.out
  1516. X    rm -f *~ *.o core a.out MAKELOG
  1517. X
  1518. Xlint:
  1519. X
  1520. Xdepend:
  1521. X
  1522. XWhiteNoise.o:    WhiteNoise.c $(BUILDINCTOP)/lic.h
  1523. XBasketWeave.o:   BasketWeave.c
  1524. XCircleField.o:   CircleField.c
  1525. XSpiralField.o:   SpiralField.c
  1526. XElectroStatic.o: ElectroStatic.c
  1527. END_OF_FILE
  1528.   if test 1993 -ne `wc -c <'lic.1.2/test/Makefile.tmpl'`; then
  1529.     echo shar: \"'lic.1.2/test/Makefile.tmpl'\" unpacked with wrong size!
  1530.   fi
  1531.   # end of 'lic.1.2/test/Makefile.tmpl'
  1532. fi
  1533. if test -f 'lic.1.2/test/SpiralField.c' -a "${1}" != "-c" ; then 
  1534.   echo shar: Will not clobber existing file \"'lic.1.2/test/SpiralField.c'\"
  1535. else
  1536.   echo shar: Extracting \"'lic.1.2/test/SpiralField.c'\" \(5342 characters\)
  1537.   sed "s/^X//" >'lic.1.2/test/SpiralField.c' <<'END_OF_FILE'
  1538. X/*
  1539. X * $Header: /d/sisal/a/casey/tmp/lic/test/RCS/SpiralField.c,v 1.3 1993/08/10 17:20:01 casey Exp $
  1540. X */
  1541. X
  1542. X/*
  1543. X * Copyright (c) 1993 The Regents of the University of California.
  1544. X * All rights reserved.
  1545. X *
  1546. X * Redistribution and use in source and binary forms, with or without
  1547. X * modification, are permitted provided that the following conditions
  1548. X * are met:
  1549. X * 1. Redistributions of source code must retain the above copyright
  1550. X *    notice, this list of conditions and the following disclaimer.
  1551. X * 2. Redistributions in binary form must reproduce the above copyright
  1552. X *    notice, this list of conditions and the following disclaimer in the
  1553. X *    documentation and/or other materials provided with the distribution.
  1554. X * 3. All advertising materials mentioning features or use of this software
  1555. X *    must display the following acknowledgement:
  1556. X *    This product includes software developed by the University of
  1557. X *    California, Lawrence Livermore National Laboratory and its
  1558. X *    contributors.
  1559. X * 4. Neither the name of the University nor the names of its contributors
  1560. X *    may be used to endorse or promote products derived from this software
  1561. X *    without specific prior written permission.
  1562. X *
  1563. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1564. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1565. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1566. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1567. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1568. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1569. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1570. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1571. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1572. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1573. X * SUCH DAMAGE.
  1574. X */
  1575. X
  1576. X#ifndef lint
  1577. X    static char rcsid[] = "$Header: /d/sisal/a/casey/tmp/lic/test/RCS/SpiralField.c,v 1.3 1993/08/10 17:20:01 casey Exp $";
  1578. X    static char copyright[] =
  1579. X    "Copyright (c) 1993 The Regents of the University of California.\n"
  1580. X    "All rights reserved.\n";
  1581. X#endif
  1582. X
  1583. X
  1584. X#include <stdlib.h>
  1585. X#include <unistd.h>
  1586. X#include <errno.h>
  1587. X#include <fcntl.h>
  1588. X#include <string.h>
  1589. X#include <stdio.h>
  1590. X
  1591. X
  1592. X/*
  1593. X * Create a three-dimensional floating point spiral vector field.  Each
  1594. X * vector will point 90 degrees, clockwise, away from the vertical (Z)
  1595. X * center of the field and slightly up: v(x, y, z) = (x, -y, 0.1).  Note
  1596. X * that the vector magnitudes are *not* equal to 1.0.
  1597. X */
  1598. X
  1599. X
  1600. X#ifdef NEED_EXIT_CODES
  1601. X    /*
  1602. X     * EXIT_SUCCESS and EXIT_FAILURE are supposed to be defined in <stdlib.h>
  1603. X     * according to the ANSI C X3.159-1989 specification, but Sun OS 4.1.1
  1604. X     * fails to define them ...
  1605. X     */
  1606. X#   define EXIT_SUCCESS    0
  1607. X#   define EXIT_FAILURE    1
  1608. X#endif
  1609. X
  1610. X
  1611. X#ifdef NEED_STRERROR
  1612. X    /*
  1613. X     * strerror is supposed to be defined in <string.h> and supplied in the
  1614. X     * standard C library according to the ANSI C X3.159-1989 specification,
  1615. X     * but Sun OS 4.1.1 fails to define or supply it ...  Unfortunately the
  1616. X     * only way we can control this is with an externally supplied define.
  1617. X     */
  1618. X    extern int      errno;        /* system error number */
  1619. X    extern char     *sys_errlist[];    /* system error messages */
  1620. X    extern int      sys_nerr;        /* number of entries in sys_errlist */
  1621. X
  1622. X    char *
  1623. X    strerror(int err)
  1624. X    {
  1625. X    if (err < 0 || err >= sys_nerr) {
  1626. X        static char msg[100];
  1627. X
  1628. X        sprintf(msg, "system error number %d", err);
  1629. X        return(msg);
  1630. X    }
  1631. X    return(sys_errlist[err]);
  1632. X    }
  1633. X#endif
  1634. X
  1635. X
  1636. Xmain(int argc, char *argv[])
  1637. X{
  1638. X    char          *myname;
  1639. X    char          *file;
  1640. X    int            Xres, Yres, Zres;
  1641. X    float         *VectorField;
  1642. X    register float fx, fy;
  1643. X    register int   i, j, k;
  1644. X    int            fd, cc;
  1645. X
  1646. X    myname = argv[0];
  1647. X    if (argc != 5)
  1648. X    {
  1649. X    (void)fprintf(stderr, "usage: %s file-name x-res y-res z-res\n",
  1650. X              myname);
  1651. X    exit(EXIT_FAILURE);
  1652. X    }
  1653. X
  1654. X    /* grab arguments */
  1655. X    file    = argv[1];
  1656. X    Xres    = atoi(argv[2]);
  1657. X    Yres    = atoi(argv[3]);
  1658. X    Zres    = atoi(argv[4]);
  1659. X
  1660. X    VectorField = (float *)malloc(sizeof(float)*Yres*Xres*Zres*3);
  1661. X    if (VectorField == NULL)
  1662. X    {
  1663. X    (void)fprintf(stderr, "%s: insufficient memory for creating the spiral"
  1664. X              " field\n", myname);
  1665. X    exit(EXIT_FAILURE);
  1666. X    }
  1667. X
  1668. X    for ( k = 0; k < Yres; k++ )
  1669. X    {
  1670. X       for ( j = 0; j < Yres; j++ )
  1671. X       {
  1672. X      fy = (float)j/(float)(Yres-1) - 0.5;
  1673. X      for ( i = 0; i < Xres; i++ )
  1674. X      {
  1675. X         fx = (float)i/(float)(Xres-1) - 0.5;
  1676. X         VectorField[3*(k*Xres*Yres + (Yres - j)*Xres + i) + 0] =  fy;
  1677. X         VectorField[3*(k*Xres*Yres + (Yres - j)*Xres + i) + 1] = -fx;
  1678. X         VectorField[3*(k*Xres*Yres + (Yres - j)*Xres + i) + 2] = 0.1;
  1679. X      }
  1680. X       }
  1681. X    }
  1682. X
  1683. X    fd = open(file, O_CREAT|O_WRONLY, 0666);
  1684. X    if (fd < 0)
  1685. X    {
  1686. X    (void)fprintf(stderr, "%s: unable to open %s: %s\n", myname, file,
  1687. X              strerror(errno));
  1688. X    exit(EXIT_FAILURE);
  1689. X    }
  1690. X
  1691. X    cc = write(fd, VectorField, 3*sizeof(float)*Xres*Yres*Zres);
  1692. X    if (cc != 2*sizeof(float)*Xres*Yres)
  1693. X    {
  1694. X    (void)fprintf(stderr, "%s: write returned short: %s\n", myname,
  1695. X              strerror(errno));
  1696. X    (void)close(fd);
  1697. X    exit(EXIT_FAILURE);
  1698. X    }
  1699. X    (void)close(fd);
  1700. X    exit(EXIT_SUCCESS);
  1701. X}
  1702. END_OF_FILE
  1703.   if test 5342 -ne `wc -c <'lic.1.2/test/SpiralField.c'`; then
  1704.     echo shar: \"'lic.1.2/test/SpiralField.c'\" unpacked with wrong size!
  1705.   fi
  1706.   # end of 'lic.1.2/test/SpiralField.c'
  1707. fi
  1708. if test -f 'lic.1.2/test/WhiteNoise.c' -a "${1}" != "-c" ; then 
  1709.   echo shar: Will not clobber existing file \"'lic.1.2/test/WhiteNoise.c'\"
  1710. else
  1711.   echo shar: Extracting \"'lic.1.2/test/WhiteNoise.c'\" \(4914 characters\)
  1712.   sed "s/^X//" >'lic.1.2/test/WhiteNoise.c' <<'END_OF_FILE'
  1713. X/*
  1714. X * $Header: /d/sisal/a/casey/tmp/lic/test/RCS/WhiteNoise.c,v 1.5 1993/08/11 01:51:12 casey Exp $
  1715. X */
  1716. X
  1717. X/*
  1718. X * Copyright (c) 1993 The Regents of the University of California.
  1719. X * All rights reserved.
  1720. X *
  1721. X * Redistribution and use in source and binary forms, with or without
  1722. X * modification, are permitted provided that the following conditions
  1723. X * are met:
  1724. X * 1. Redistributions of source code must retain the above copyright
  1725. X *    notice, this list of conditions and the following disclaimer.
  1726. X * 2. Redistributions in binary form must reproduce the above copyright
  1727. X *    notice, this list of conditions and the following disclaimer in the
  1728. X *    documentation and/or other materials provided with the distribution.
  1729. X * 3. All advertising materials mentioning features or use of this software
  1730. X *    must display the following acknowledgement:
  1731. X *    This product includes software developed by the University of
  1732. X *    California, Lawrence Livermore National Laboratory and its
  1733. X *    contributors.
  1734. X * 4. Neither the name of the University nor the names of its contributors
  1735. X *    may be used to endorse or promote products derived from this software
  1736. X *    without specific prior written permission.
  1737. X *
  1738. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1739. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1740. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1741. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1742. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1743. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1744. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1745. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1746. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1747. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1748. X * SUCH DAMAGE.
  1749. X */
  1750. X
  1751. X#ifndef lint
  1752. X    static char rcsid[] = "$Header: /d/sisal/a/casey/tmp/lic/test/RCS/WhiteNoise.c,v 1.5 1993/08/11 01:51:12 casey Exp $";
  1753. X    static char copyright[] =
  1754. X    "Copyright (c) 1993 The Regents of the University of California.\n"
  1755. X    "All rights reserved.\n";
  1756. X#endif
  1757. X
  1758. X
  1759. X#include <stdlib.h>
  1760. X#include <unistd.h>
  1761. X#include <errno.h>
  1762. X#include <fcntl.h>
  1763. X#include <string.h>
  1764. X#include <stdio.h>
  1765. X#include <sys/types.h>
  1766. X
  1767. X#include <lic.h>
  1768. X
  1769. X
  1770. X/*
  1771. X * Create a simple white noise image.
  1772. X */
  1773. X
  1774. X
  1775. X#ifdef NEED_EXIT_CODES
  1776. X    /*
  1777. X     * EXIT_SUCCESS and EXIT_FAILURE are supposed to be defined in <stdlib.h>
  1778. X     * according to the ANSI C X3.159-1989 specification, but Sun OS 4.1.1
  1779. X     * fails to define them ...
  1780. X     */
  1781. X#   define EXIT_SUCCESS    0
  1782. X#   define EXIT_FAILURE    1
  1783. X#endif
  1784. X
  1785. X
  1786. X#ifdef NEED_STRERROR
  1787. X    /*
  1788. X     * strerror is supposed to be defined in <string.h> and supplied in the
  1789. X     * standard C library according to the ANSI C X3.159-1989 specification,
  1790. X     * but Sun OS 4.1.1 fails to define or supply it ...  Unfortunately the
  1791. X     * only way we can control this is with an externally supplied define.
  1792. X     */
  1793. X    extern int      errno;        /* system error number */
  1794. X    extern char     *sys_errlist[];    /* system error messages */
  1795. X    extern int      sys_nerr;        /* number of entries in sys_errlist */
  1796. X
  1797. X    char *
  1798. X    strerror(int err)
  1799. X    {
  1800. X    if (err < 0 || err >= sys_nerr) {
  1801. X        static char msg[100];
  1802. X
  1803. X        sprintf(msg, "system error number %d", err);
  1804. X        return(msg);
  1805. X    }
  1806. X    return(sys_errlist[err]);
  1807. X    }
  1808. X#endif
  1809. X
  1810. X
  1811. Xmain(int argc, char *argv[])
  1812. X{
  1813. X    char          *myname;
  1814. X    char          *file;
  1815. X    int            Xres, Yres;
  1816. X    unsigned char *Noise;
  1817. X    size_t         pixel, scanline;
  1818. X    register int   i, j;
  1819. X    int            fd, cc;
  1820. X
  1821. X    myname = argv[0];
  1822. X    if (argc != 4)
  1823. X    {
  1824. X    (void)fprintf(stderr, "usage: %s file_name x_res y_res\n", myname);
  1825. X    exit(EXIT_FAILURE);
  1826. X    }
  1827. X
  1828. X    /* grab arguments */
  1829. X    file = argv[1];
  1830. X    Xres = atoi(argv[2]);
  1831. X    Yres = atoi(argv[3]);
  1832. X    
  1833. X    pixel    = LIC_ConfiguredPixelSize();
  1834. X    scanline = sizeof(unsigned char) * pixel * Xres;
  1835. X
  1836. X    Noise = (unsigned char *)malloc(scanline);
  1837. X    if (Noise == NULL)
  1838. X    {
  1839. X    (void)fprintf(stderr, "%s: insufficient memory for creating the noise"
  1840. X              " field\n", myname);
  1841. X    exit(EXIT_FAILURE);
  1842. X    }
  1843. X
  1844. X    srand(98639);    /* Seed with a prime number */
  1845. X
  1846. X    fd = open(file, O_CREAT|O_WRONLY, 0666);
  1847. X    if (fd < 0)
  1848. X    {
  1849. X    (void)fprintf(stderr, "%s: unable to open %s: %s\n", myname, file,
  1850. X              strerror(errno));
  1851. X    exit(EXIT_FAILURE);
  1852. X    }
  1853. X
  1854. X    for (j = 0; j < Yres; j++)
  1855. X    {
  1856. X    for (i = 0; i < Xres; i++)
  1857. X    {
  1858. X        int p, r;
  1859. X
  1860. X        r = rand() & 255;
  1861. X        for (p = 0; p < pixel; p++)
  1862. X        Noise[i*pixel + p] = r;
  1863. X    }
  1864. X
  1865. X    cc = write(fd, Noise, scanline);
  1866. X    if (cc != scanline)
  1867. X    {
  1868. X        (void)fprintf(stderr, "%s: write returned short: %s\n", myname,
  1869. X              strerror(errno));
  1870. X        (void)close(fd);
  1871. X        exit(EXIT_FAILURE);
  1872. X    }
  1873. X    }
  1874. X
  1875. X    (void)close(fd);
  1876. X    exit(EXIT_SUCCESS);
  1877. X}
  1878. END_OF_FILE
  1879.   if test 4914 -ne `wc -c <'lic.1.2/test/WhiteNoise.c'`; then
  1880.     echo shar: \"'lic.1.2/test/WhiteNoise.c'\" unpacked with wrong size!
  1881.   fi
  1882.   # end of 'lic.1.2/test/WhiteNoise.c'
  1883. fi
  1884. echo shar: End of archive 9 \(of 10\).
  1885. cp /dev/null ark9isdone
  1886. MISSING=""
  1887. for I in 1 2 3 4 5 6 7 8 9 10 ; do
  1888.     if test ! -f ark${I}isdone ; then
  1889.     MISSING="${MISSING} ${I}"
  1890.     fi
  1891. done
  1892. if test "${MISSING}" = "" ; then
  1893.     echo You have unpacked all 10 archives.
  1894.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1895. else
  1896.     echo You still must unpack the following archives:
  1897.     echo "        " ${MISSING}
  1898. fi
  1899. exit 0
  1900. exit 0 # Just in case...
  1901.