83 |
#if defined(DIDEROT_SINGLE_PRECISION) |
#if defined(DIDEROT_SINGLE_PRECISION) |
84 |
typedef int32_t Diderot_int_t; |
typedef int32_t Diderot_int_t; |
85 |
typedef float Diderot_real_t; |
typedef float Diderot_real_t; |
86 |
typedef union4f_t Diderot_vec3_t; // padded to fit in SSE register |
typedef vec2f_t Diderot_vec2_t; |
87 |
typedef union4f_t Diderot_vec4_t; |
typedef vec3f_t Diderot_vec3_t; |
88 |
|
typedef vec4f_t Diderot_vec4_t; |
89 |
|
typedef union2f_t Diderot_union2_t; |
90 |
|
typedef union3f_t Diderot_union3_t; |
91 |
|
typedef union4f_t Diderot_union4_t; |
92 |
|
typedef union2f_t Diderot_Mat2x2_t[2]; // represented as row vectors |
93 |
|
typedef union3f_t Diderot_Mat3x3_t[3]; // represented as row vectors |
94 |
|
typedef union4f_t Diderot_Mat4x4_t[4]; // represented as row vectors |
95 |
#else |
#else |
96 |
typedef int64_t Diderot_int_t; |
typedef int64_t Diderot_int_t; |
97 |
typedef double Diderot_real_t; |
typedef double Diderot_real_t; |
98 |
typedef union4d_t Diderot_vec3_t; // padded to fit in SSE register |
typedef vec2d_t Diderot_vec2_t; |
99 |
typedef union4d_t Diderot_vec4_t; |
typedef vec3d_t Diderot_vec3_t; |
100 |
|
typedef vec4d_t Diderot_vec4_t; |
101 |
|
typedef union2d_t Diderot_union2_t; |
102 |
|
typedef union3d_t Diderot_union3_t; |
103 |
|
typedef union4d_t Diderot_union4_t; |
104 |
|
typedef union2d_t Diderot_Mat2x2_t[2]; // represented as row vectors |
105 |
|
typedef union3d_t Diderot_Mat3x3_t[3]; // represented as row vectors |
106 |
|
typedef union4d_t Diderot_Mat4x4_t[4]; // represented as row vectors |
107 |
#endif |
#endif |
108 |
typedef const char *Diderot_string_t; |
typedef const char *Diderot_string_t; |
109 |
|
|
|
typedef union2f_t Diderot_Mat2x2_t[2]; // represented as row vectors |
|
|
typedef union3f_t Diderot_Mat3x3_t[3]; // represented as row vectors |
|
|
typedef union4f_t Diderot_Mat4x4_t[4]; // represented as row vectors |
|
|
|
|
110 |
typedef struct { // wrapper for 1D image data |
typedef struct { // wrapper for 1D image data |
111 |
uint32_t dim; // dimension (== 1) |
uint32_t dim; // dimension (== 1) |
112 |
uint32_t size[1]; |
uint32_t size[1]; |
113 |
void *data; |
void *data; |
114 |
float s; // scaling from world-space to image-space |
Diderot_real_t s; // scaling from world-space to image-space |
115 |
float t; // translation from world-space to image-space |
Diderot_real_t t; // translation from world-space to image-space |
116 |
} Diderot_image1D_t; |
} Diderot_image1D_t; |
117 |
|
|
118 |
typedef struct { // wrapper for 2D image data |
typedef struct { // wrapper for 2D image data |
122 |
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 |
123 |
// inverse of the index to world-space transform that is loaded from |
// inverse of the index to world-space transform that is loaded from |
124 |
// the Nrrd file. |
// the Nrrd file. |
125 |
vec2f_t tVec; // translation part of world to index transform |
Diderot_vec2_t tVec; // translation part of world to index transform |
126 |
Diderot_Mat2x2_t w2iT; // transpose w3i |
Diderot_Mat2x2_t w2iT; // transpose w3i |
127 |
} Diderot_image2D_t; |
} Diderot_image2D_t; |
128 |
|
|
133 |
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 |
134 |
// inverse of the index to world-space transform that is loaded from |
// inverse of the index to world-space transform that is loaded from |
135 |
// the Nrrd file. |
// the Nrrd file. |
136 |
vec3f_t tVec; // translation part of world to index transform |
Diderot_vec3_t tVec; // translation part of world to index transform |
137 |
Diderot_Mat3x3_t w2iT; // transpose w3i |
Diderot_Mat3x3_t w2iT; // transpose w3i |
138 |
} Diderot_image3D_t; |
} Diderot_image3D_t; |
139 |
|
|