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

SCM Repository

[diderot] Annotation of /trunk/src/lib/diderot.h
ViewVC logotype

Annotation of /trunk/src/lib/diderot.h

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : jhr 438 /*! \file diderot.h
2 :     *
3 :     * \author John Reppy
4 :     */
5 :    
6 :     /*
7 :     * COPYRIGHT (c) 2010 The Diderot Project (http://diderot-language.cs.uchicago.edu)
8 :     * All rights reserved.
9 :     */
10 :    
11 :     #ifndef _DIDEROT_H_
12 :     #define _DIDEROT_H_
13 :    
14 :     #include <stdint.h>
15 :     #include <stdbool.h>
16 :    
17 :     /* library-call status */
18 :     typedef enum { DIDEROT_OK = 0, DIDEROT_FAIL = -1 } Status_t;
19 :    
20 :     /* SSE vector types */
21 :     typedef float float4 __attribute__ ((__vector_size__ (16)));
22 :     typedef double double2 __attribute__ ((__vector_size__ (16)));
23 :    
24 :     /* union types for converting extracting vector data */
25 :     typedef union {
26 :     float f[4];
27 :     float4 v;
28 :     } f4union;
29 :    
30 :     typedef union {
31 :     double d[2];
32 :     double2 v;
33 :     } d2union;
34 :    
35 :     /* typedefs for Diderot types */
36 :     typedef int32_t Diderot_int_t;
37 :     typedef float Diderot_real_t;
38 :     typedef f4union Diderot_vec3_t; // padded to fit in SSE register
39 :     typedef f4union Diderot_vec4_t;
40 :     typedef const char *Diderot_string_t;
41 :    
42 :     typedef struct { // wrapper for 1D image data
43 :     uint32_t dim; // dimension (== 1)
44 :     uint32_t size[1];
45 :     void *data;
46 :     } Diderot_image1D_t;
47 :    
48 :     typedef struct { // wrapper for 2D image data
49 :     uint32_t dim; // dimension (== 2)
50 :     uint32_t size[2]; // sizes (fast to slow)
51 :     void *data;
52 :     } Diderot_image2D_t;
53 :    
54 :     typedef struct { // wrapper for 3D image data
55 :     uint32_t dim; // dimension (== 3)
56 :     uint32_t size[3]; // sizes (fast to slow)
57 :     void *data;
58 :     } Diderot_image3D_t;
59 :    
60 :     /* Diderot library functions */
61 :    
62 :     /* load image data from Nrrd files */
63 :     extern Status_t Diderot_LoadImage1D (Diderot_string_t name, Diderot_image1D_t *img);
64 :     extern Status_t Diderot_LoadImage2D (Diderot_string_t name, Diderot_image2D_t *img);
65 :     extern Status_t Diderot_LoadImage3D (Diderot_string_t name, Diderot_image3D_t *img);
66 :    
67 :     /* functions to load input parameters */
68 :     extern Status_t Diderot_InputString (const char *, const char **, bool);
69 :     extern Status_t Diderot_InputReal (const char *, Diderot_real_t *, bool);
70 :     extern Status_t Diderot_InputVec3 (const char *, Diderot_vec3_t *v);
71 :    
72 :     #endif /* !_DIDEROT_H_ */

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