home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume40 / lic / part08 < prev    next >
Encoding:
Text File  |  1993-11-09  |  59.8 KB  |  1,715 lines

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