Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Annotation of /branches/pure-cfg/src/include/Diderot/diderot.h
ViewVC logotype

Annotation of /branches/pure-cfg/src/include/Diderot/diderot.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 756 - (view) (download) (as text)

1 : jhr 438 /*! \file diderot.h
2 :     *
3 :     * \author John Reppy
4 : jhr 441 *
5 :     * This is the interface to the Diderot runtime for the C target. For now,
6 :     * we are targetting single-precision computations.
7 : jhr 438 */
8 :    
9 :     /*
10 :     * COPYRIGHT (c) 2010 The Diderot Project (http://diderot-language.cs.uchicago.edu)
11 :     * All rights reserved.
12 :     */
13 :    
14 :     #ifndef _DIDEROT_H_
15 :     #define _DIDEROT_H_
16 :    
17 : jhr 601 /* gcc has a bug that breaks code that uses 8-byte vectors (e.g., vec2f_t), but clang
18 :     * handles the code correctly.
19 :     */
20 :     #if defined(__clang__)
21 :     # define VEC2_OK
22 :     #endif
23 :    
24 : jhr 579 #ifdef NDEBUG
25 : jhr 440 #define STATIC_INLINE static inline
26 : jhr 579 #else
27 :     #define STATIC_INLINE static
28 :     #endif
29 : jhr 440
30 : jhr 438 #include <stdint.h>
31 :     #include <stdbool.h>
32 : jhr 558 #include <stdlib.h>
33 :     #include <math.h>
34 : jhr 654 #include <stdio.h> // for printing output
35 : jhr 438
36 : jhr 710 #include "types.h"
37 :     #include "strands.h"
38 : jhr 438
39 :     /* load image data from Nrrd files */
40 : jhr 561 extern Status_t Diderot_LoadImage1D (Diderot_string_t name, Diderot_image1D_t **img);
41 :     extern Status_t Diderot_LoadImage2D (Diderot_string_t name, Diderot_image2D_t **img);
42 :     extern Status_t Diderot_LoadImage3D (Diderot_string_t name, Diderot_image3D_t **img);
43 : jhr 438
44 : jhr 439 /* functions to get input-parameter values */
45 : jhr 438 extern Status_t Diderot_InputString (const char *, const char **, bool);
46 : jhr 561 extern Status_t Diderot_Inputf (const char *, float *, bool);
47 :     extern Status_t Diderot_InputVec3f (const char *, vec3f_t *, bool);
48 : jhr 438
49 : jhr 561 /********** scalar math functions **********/
50 :    
51 :     STATIC_INLINE float maxf (float a, float b)
52 :     {
53 :     return (a < b)? b : a;
54 :     }
55 :    
56 : jhr 756 STATIC_INLINE float lerpf (float a, float b, float t)
57 :     {
58 :     return a + t*(b - a);
59 :     }
60 :    
61 : jhr 710 /********** vector math functions **********/
62 : jhr 588
63 : jhr 710 #include "inline-vec2.h"
64 :     #include "inline-vec3.h"
65 :     #include "inline-vec4.h"
66 : jhr 727 #include "inline-matrix.h"
67 : jhr 588
68 :    
69 : jhr 560 /********** other Diderot support functions **********/
70 :    
71 : jhr 710 #include "inline-image.h"
72 : jhr 449
73 : jhr 438 #endif /* !_DIDEROT_H_ */

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0