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

SCM Repository

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

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

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

revision 564, Wed Feb 23 22:34:31 2011 UTC revision 565, Thu Feb 24 18:34:48 2011 UTC
# Line 87  Line 87 
87    
88  typedef Diderot_real_t Diderot_Mat2x2_t[4];  typedef Diderot_real_t Diderot_Mat2x2_t[4];
89  typedef Diderot_real_t Diderot_Mat3x3_t[9];  typedef Diderot_real_t Diderot_Mat3x3_t[9];
90  typedef Diderot_real_t Diderot_Mat4x4_t[16];  typedef union4f_t Diderot_Mat4x4_t[4];  // represented as row vectors
91    
92  typedef struct {                // wrapper for 1D image data  typedef struct {                // wrapper for 1D image data
93      uint32_t    dim;            // dimension (== 1)      uint32_t    dim;            // dimension (== 1)
# Line 155  Line 155 
155      return vec3f(floorf(u.r[0]), floorf(u.r[1]), floorf(u.r[2]));      return vec3f(floorf(u.r[0]), floorf(u.r[1]), floorf(u.r[2]));
156  }  }
157    
158    STATIC_INLINE float dot3f (vec3f_t u, vec3f_t v)
159    {
160        union3f_t uv = (union3f_t)(u*v);
161        return uv.r[0] + uv.r[1] + uv.r[2];
162    }
163    
164  STATIC_INLINE float length3f (vec3f_t v)  STATIC_INLINE float length3f (vec3f_t v)
165  {  {
166      return 0.0; // FIXME      return sqrtf(dot3f(v, v));
167  }  }
168    
169  STATIC_INLINE vec3i_t truncToInt3f (vec3f_t v)  STATIC_INLINE vec3i_t truncToInt3f (vec3f_t v)
# Line 181  Line 187 
187    
188  STATIC_INLINE float dot4f (vec4f_t u, vec4f_t v)  STATIC_INLINE float dot4f (vec4f_t u, vec4f_t v)
189  {  {
190      return 0.0f; // FIXME      union4f_t uv = (union4f_t)(u*v);
191        return uv.r[0] + uv.r[1] + uv.r[2] + uv.r[3];
192  }  }
193    
194    
# Line 201  Line 208 
208          &&  (s <= pos.r[2]) && (pos.r[2] < (img->size[2] - s)));          &&  (s <= pos.r[2]) && (pos.r[2] < (img->size[2] - s)));
209  }  }
210    
211  vec3f_t Diderot_ToImageSpace3f (Diderot_image3D_t *img, vec3f_t posArg);  STATIC_INLINE vec3f_t Diderot_ToImageSpace3f (Diderot_image3D_t *img, vec3f_t posArg)
212    {
213        vec4f_t p = vec4f(
214            ((union3f_t)posArg).r[0],
215            ((union3f_t)posArg).r[0],
216            ((union3f_t)posArg).r[0],
217            1.0f);
218    
219        return vec3f(
220            dot4f(img->mInv[0].v, p),
221            dot4f(img->mInv[1].v, p),
222            dot4f(img->mInv[2].v, p));
223    }
224    
225  #endif /* !_DIDEROT_H_ */  #endif /* !_DIDEROT_H_ */

Legend:
Removed from v.564  
changed lines
  Added in v.565

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