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

SCM Repository

[diderot] Diff of /trunk/src/include/Diderot/types.h
ViewVC logotype

Diff of /trunk/src/include/Diderot/types.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1232, Mon May 16 23:37:52 2011 UTC revision 2356, Sun Apr 7 14:45:25 2013 UTC
# Line 45  Line 45 
45  typedef int32_t vec4i_t __attribute__ ((vector_size (16)));  typedef int32_t vec4i_t __attribute__ ((vector_size (16)));
46  typedef int32_t vec8i_t __attribute__ ((vector_size (32)));  typedef int32_t vec8i_t __attribute__ ((vector_size (32)));
47    
48  typedef float vec2d_t __attribute__ ((vector_size (16)));  typedef double vec2d_t __attribute__ ((vector_size (16)));
49  typedef float vec4d_t __attribute__ ((vector_size (32)));  typedef double vec4d_t __attribute__ ((vector_size (32)));
50  typedef float vec8d_t __attribute__ ((vector_size (64)));  typedef double vec8d_t __attribute__ ((vector_size (64)));
51    
52  typedef int64_t vec2l_t __attribute__ ((vector_size (16)));  typedef int64_t vec2l_t __attribute__ ((vector_size (16)));
53  typedef int64_t vec4l_t __attribute__ ((vector_size (32)));  typedef int64_t vec4l_t __attribute__ ((vector_size (32)));
# Line 69  Line 69 
69  typedef union { int64_t r[4]; vec4l_t v; } union4l_t;  typedef union { int64_t r[4]; vec4l_t v; } union4l_t;
70  typedef union { int64_t r[8]; vec8l_t v; } union8l_t;  typedef union { int64_t r[8]; vec8l_t v; } union8l_t;
71    
72  /* vector lengths must be power of 2, but vec3 is useful, so we pad to 4 */  /* vector lengths must be power of 2, but vec3 and vec6 are useful, so we pad to 4 and 8 (resp.) */
73  typedef vec4f_t vec3f_t;  typedef vec4f_t vec3f_t;
74  typedef union4f_t union3f_t;  typedef union4f_t union3f_t;
75  typedef vec4d_t vec3d_t;  typedef vec4d_t vec3d_t;
# Line 78  Line 78 
78  typedef union4i_t union3i_t;  typedef union4i_t union3i_t;
79  typedef vec4l_t vec3l_t;  typedef vec4l_t vec3l_t;
80  typedef union4l_t union3l_t;  typedef union4l_t union3l_t;
81    typedef vec8f_t vec6f_t;
82    typedef union8f_t union6f_t;
83    typedef vec8d_t vec6d_t;
84    typedef union8d_t union6d_t;
85    
86  /* typedefs for Diderot types */  /* typedefs for Diderot types */
87  #if defined(DIDEROT_SINGLE_PRECISION)  #if defined(DIDEROT_SINGLE_PRECISION)
 typedef int32_t Diderot_int_t;  
88  typedef float Diderot_real_t;  typedef float Diderot_real_t;
89  typedef vec2f_t Diderot_vec2_t;  typedef vec2f_t Diderot_vec2_t;
90  typedef vec3f_t Diderot_vec3_t;  typedef vec3f_t Diderot_vec3_t;
91  typedef vec4f_t Diderot_vec4_t;  typedef vec4f_t Diderot_vec4_t;
92    typedef vec6f_t Diderot_vec6_t;
93  typedef union2f_t Diderot_union2_t;  typedef union2f_t Diderot_union2_t;
94  typedef union3f_t Diderot_union3_t;  typedef union3f_t Diderot_union3_t;
95  typedef union4f_t Diderot_union4_t;  typedef union4f_t Diderot_union4_t;
96    typedef union6f_t Diderot_union6_t;
97  typedef union2f_t Diderot_Mat2x2_t[2];  // represented as row vectors  typedef union2f_t Diderot_Mat2x2_t[2];  // represented as row vectors
98  typedef union3f_t Diderot_Mat3x3_t[3];  // represented as row vectors  typedef union3f_t Diderot_Mat3x3_t[3];  // represented as row vectors
99  typedef union4f_t Diderot_Mat4x4_t[4];  // represented as row vectors  typedef union4f_t Diderot_Mat4x4_t[4];  // represented as row vectors
100  #else  typedef union2f_t Diderot_Ten2x2x2_t[2][2];
101  typedef int64_t Diderot_int_t;  typedef union3f_t Diderot_Ten3x3x3_t[3][3];
102    typedef union4f_t Diderot_Ten4x4x4_t[4][4];
103    #elif defined(DIDEROT_DOUBLE_PRECISION)
104  typedef double Diderot_real_t;  typedef double Diderot_real_t;
105  typedef vec2d_t Diderot_vec2_t;  typedef vec2d_t Diderot_vec2_t;
106  typedef vec3d_t Diderot_vec3_t;  typedef vec3d_t Diderot_vec3_t;
107  typedef vec4d_t Diderot_vec4_t;  typedef vec4d_t Diderot_vec4_t;
108    typedef vec6d_t Diderot_vec6_t;
109  typedef union2d_t Diderot_union2_t;  typedef union2d_t Diderot_union2_t;
110  typedef union3d_t Diderot_union3_t;  typedef union3d_t Diderot_union3_t;
111  typedef union4d_t Diderot_union4_t;  typedef union4d_t Diderot_union4_t;
112    typedef union6d_t Diderot_union6_t;
113  typedef union2d_t Diderot_Mat2x2_t[2];  // represented as row vectors  typedef union2d_t Diderot_Mat2x2_t[2];  // represented as row vectors
114  typedef union3d_t Diderot_Mat3x3_t[3];  // represented as row vectors  typedef union3d_t Diderot_Mat3x3_t[3];  // represented as row vectors
115  typedef union4d_t Diderot_Mat4x4_t[4];  // represented as row vectors  typedef union4d_t Diderot_Mat4x4_t[4];  // represented as row vectors
116    typedef union2d_t Diderot_Ten2x2x2_t[2][2];
117    typedef union3d_t Diderot_Ten3x3x3_t[3][3];
118    typedef union4d_t Diderot_Ten4x4x4_t[4][4];
119    #else
120    #  error floating-point precision unknown
121    #endif
122    #if defined(DIDEROT_INT)
123    typedef int32_t Diderot_int_t;
124    typedef uint32_t Diderot_uint_t;
125    typedef vec2i_t Diderot_ivec2_t;
126    typedef vec3i_t Diderot_ivec3_t;
127    typedef vec4i_t Diderot_ivec4_t;
128    typedef union2i_t Diderot_iunion2_t;
129    typedef union3i_t Diderot_iunion3_t;
130    typedef union4i_t Diderot_iunion4_t;
131    #elif defined(DIDEROT_LONGINT)
132    typedef int64_t Diderot_int_t;
133    typedef uint64_t Diderot_uint_t;
134    typedef vec2l_t Diderot_ivec2_t;
135    typedef vec3l_t Diderot_ivec3_t;
136    typedef vec4l_t Diderot_ivec4_t;
137    typedef union2l_t Diderot_iunion2_t;
138    typedef union3l_t Diderot_iunion3_t;
139    typedef union4l_t Diderot_iunion4_t;
140    #else
141    #  error integer precision unknown
142  #endif  #endif
143  typedef const char *Diderot_string_t;  typedef const char *Diderot_string_t;
144    
145  typedef struct {                        // wrapper for 1D image data  typedef struct {                        // wrapper for 1D image data
146      uint32_t            dim;            // dimension (== 1)      uint32_t            dim;            //!< dimension (== 1)
147      uint32_t            size[1];      uint32_t            size[1];
148        size_t              dataSzb;        //!< size of data in bytes
149      void                *data;      void                *data;
150      Diderot_real_t      s;              // scaling from world-space to image-space      Diderot_real_t      s;              //!< scaling from world-space to image-space
151      Diderot_real_t      t;              // translation from world-space to image-space      Diderot_real_t      t;              //!< translation from world-space to image-space
152  } Diderot_image1D_t;  } Diderot_image1D_t;
153    
154  typedef struct {                        // wrapper for 2D image data  typedef struct {                        // wrapper for 2D image data
155      uint32_t            dim;            // dimension (== 2)      uint32_t            dim;            //!< dimension (== 2)
156      uint32_t            size[2];        // sizes (fast to slow)      uint32_t            size[2];        //!< sizes (fast to slow)
157        size_t              dataSzb;        //!< size of data in bytes
158      void                *data;      void                *data;
159      Diderot_Mat2x2_t    w2i;            // affine tranform from world space to index space.  This is the      Diderot_Mat2x2_t    w2i;            //!< affine tranform from world space to index space.  This is the
160                                          // inverse of the index to world-space transform that is loaded from                                          //!  inverse of the index to world-space transform that is loaded from
161                                          // the Nrrd file.                                          //!  the Nrrd file.
162      Diderot_vec2_t      tVec;           // translation part of world to index transform      Diderot_vec2_t      tVec;           //!< translation part of world to index transform
163      Diderot_Mat2x2_t    w2iT;           // transpose w3i      Diderot_Mat2x2_t    w2iT;           //!< transpose w3i
164  } Diderot_image2D_t;  } Diderot_image2D_t;
165    
166  typedef struct {                        // wrapper for 3D image data  typedef struct {                        // wrapper for 3D image data
167      uint32_t            dim;            // dimension (== 3)      uint32_t            dim;            //!< dimension (== 3)
168      uint32_t            size[3];        // sizes (fast to slow)      uint32_t            size[3];        //!< sizes (fast to slow)
169        size_t              dataSzb;        //!< size of data in bytes
170      void                *data;      void                *data;
171      Diderot_Mat3x3_t    w2i;            // affine tranform from world space to index space.  This is the      Diderot_Mat3x3_t    w2i;            //!< affine tranform from world space to index space.  This is the
172                                          // inverse of the index to world-space transform that is loaded from                                          //!  inverse of the index to world-space transform that is loaded from
173                                          // the Nrrd file.                                          //!  the Nrrd file.
174      Diderot_vec3_t      tVec;           // translation part of world to index transform      Diderot_vec3_t      tVec;           //!< translation part of world to index transform
175      Diderot_Mat3x3_t    w2iT;           // transpose w3i      Diderot_Mat3x3_t    w2iT;           //!< transpose w3i
176  } Diderot_image3D_t;  } Diderot_image3D_t;
177    
178  #endif /* !_DIDEROT_TYPES_H_ */  #endif /* !_DIDEROT_TYPES_H_ */

Legend:
Removed from v.1232  
changed lines
  Added in v.2356

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