| /oneTBB/examples/parallel_for/tachyon/src/ |
| H A D | apitrigeom.cpp | 66 vector x, y, z, tmp; in rt_tri_fcylinder() local 74 tmp.x = z.y - 2.1111111; in rt_tri_fcylinder() 75 tmp.y = -z.z + 3.14159267; in rt_tri_fcylinder() 81 MyVCross(&x, &z, &y); in rt_tri_fcylinder() 82 MyVNorm(&y); in rt_tri_fcylinder() 90 p1.x = p1.y = p1.z = 0.0; in rt_tri_fcylinder() 118 vector x, y, z, tmp; in rt_tri_ring() local 126 tmp.x = z.y - 2.1111111; in rt_tri_ring() 127 tmp.y = -z.z + 3.14159267; in rt_tri_ring() 133 MyVCross(&x, &z, &y); in rt_tri_ring() [all …]
|
| H A D | grid.cpp | 164 gmin->y = MYMIN(gmin->y, min.y); in globalbound() 168 gmax->y = MYMAX(gmax->y, max.y); in globalbound() 191 cellmax.y = cellmin.y + g->voxsize.y; in cellbound() 213 cmin->y = MYMIN(cmin->y, min.y); in cellbound() 217 cmax->y = MYMAX(cmax->y, max.y); in cellbound() 431 for (y = low.y; y <= high.y; y++) { in engrid_object() 448 index->y = (int)((pos->y - g->min.y) / g->voxsize.y); in pos2grid() 518 tdelta.y = g->voxsize.y / -ry->d.y; in grid_intersect() 523 tdelta.y = g->voxsize.y / ry->d.y; in grid_intersect() 663 if ((ry->o.y < g->min.y) || (ry->o.y > g->max.y)) in grid_bounds_intersect() [all …]
|
| H A D | apigeom.cpp | 73 a.y = points[i].y - points[i - 1].y; in rt_polycylinder() 90 zoff = ctr.y; in rt_heightfield() 131 int x, y, addr; in rt_sheightfield() local 138 offset.z = ctr.y; in rt_sheightfield() 144 for (y = 0; y < n; y++) { in rt_sheightfield() 156 for (y = 1; y < n; y++) { in rt_sheightfield() 159 for (y = 1; y < (n - 1); y++) { in rt_sheightfield() 172 for (y = 0; y < (n - 1); y++) { in rt_sheightfield() 226 long x, y; in subdivide() local 233 y = (y1 + y2) / 2; in subdivide() [all …]
|
| H A D | texture.cpp | 96 rh.y = hit->y - tex->ctr.y; in image_sphere_texture() 122 pnt.y = hit->y - tex->ctr.y; in image_plane_texture() 171 yh = hit->y - tex->ctr.y; in checker_texture() 173 y = y % 2; in checker_texture() 199 rh.y = hit->y - tex->ctr.y; in cyl_checker_texture() 207 y = y % 2; in cyl_checker_texture() 230 y = (hit->y - tex->ctr.y) * 1000; in wood_texture() 262 for (y = 0; y < NMAX; y++) { in InitNoise() 298 y = fabs(y); in Noise() 306 oy = (y - ((int)y)); in Noise() [all …]
|
| H A D | vector.cpp | 55 return (a->x * b->x + a->y * b->y + a->z * b->z); in VDot() 59 c->x = (a->y * b->z) - (a->z * b->y); in VCross() 61 c->z = (a->x * b->y) - (a->y * b->x); in VCross() 65 return (flt)sqrt((a->x * a->x) + (a->y * a->y) + (a->z * a->z)); in VLength() 71 len = sqrt((a->x * a->x) + (a->y * a->y) + (a->z * a->z)); in VNorm() 74 a->y /= len; in VNorm() 81 c->y = (a->y + b->y); in VAdd() 87 c->y = (a->y - b->y); in VSub() 93 C->y = (a * A->y) + B->y; in VAddS() 101 temp.y = a->o.y + (a->d.y * t); in Raypnt() [all …]
|
| H A D | quadric.cpp | 74 q->ctr.y = 0.0; in newquadric() 92 ro.y = ry->o.y - q->ctr.y; in quadric_intersect() 96 (2.0 * q->mat.c * rd.x * rd.z) + (q->mat.e * (rd.y * rd.y)) + in quadric_intersect() 99 Bq = 2.0 * ((q->mat.a * ro.x * rd.x) + (q->mat.b * ((ro.x * rd.y) + (rd.x * ro.y))) + in quadric_intersect() 101 (q->mat.e * ro.y * rd.y) + (q->mat.f * ((ro.y * rd.z) + (rd.y * ro.z))) + in quadric_intersect() 105 (2.0 * q->mat.c * ro.x * ro.z) + (2.0 * q->mat.d * ro.x) + (q->mat.e * (ro.y * ro.y)) + in quadric_intersect() 106 (2.0 * q->mat.f * ro.y * ro.z) + (2.0 * q->mat.g * ro.y) + (q->mat.h * (ro.z * ro.z)) + in quadric_intersect() 126 N->x = (q->mat.a * (pnt->x - q->ctr.x) + q->mat.b * (pnt->y - q->ctr.y) + in quadric_normal() 129 N->y = (q->mat.b * (pnt->x - q->ctr.x) + q->mat.e * (pnt->y - q->ctr.y) + in quadric_normal() 132 N->z = (q->mat.c * (pnt->x - q->ctr.x) + q->mat.f * (pnt->y - q->ctr.y) + in quadric_normal() [all …]
|
| H A D | cylinder.cpp | 95 rc.y = ry->o.y - cyl->ctr.y; in cylinder_intersect() 106 D.y = rc.y - d * cyl->axis.y; in cylinder_intersect() 147 b.y = c.y * t + cyl->ctr.y; in cylinder_normal() 155 N->y = -N->y; in cylinder_normal() 180 mintmp.y = c->ctr.y; in fcylinder_bbox() 183 maxtmp.y = c->ctr.y + c->axis.y; in fcylinder_bbox() 187 min->y = MYMIN(mintmp.y, maxtmp.y); in fcylinder_bbox() 194 max->y = MYMAX(mintmp.y, maxtmp.y); in fcylinder_bbox() 208 rc.y = ry->o.y - cyl->ctr.y; in fcylinder_intersect() 240 tmp2.y = hit.y - cyl->ctr.y; in fcylinder_intersect() [all …]
|
| H A D | macros.hpp | 56 #define VDOT(return, a, b) return = (a.x * b.x + a.y * b.y + a.z * b.z); 60 c.y = a.o.y + (a.d.y * b); \ 65 c.y = (a.y - b.y); \ 69 c->x = (a->y * b->z) - (a->z * b->y); \ 70 c->y = (a->z * b->x) - (a->x * b->z); \ 71 c->z = (a->x * b->y) - (a->y * b->x);
|
| H A D | box.cpp | 114 if (ry->d.y == 0.0) { in box_intersect() 115 if ((ry->o.y < bx->min.y) || (ry->o.y > bx->max.y)) in box_intersect() 119 ty1 = (bx->min.y - ry->o.y) / ry->d.y; in box_intersect() 120 ty2 = (bx->max.y - ry->o.y) / ry->d.y; in box_intersect() 167 c.y = (bx->max.y + bx->min.y) / 2.0; in box_normal() 174 a.y = fabs(N->y); in box_normal() 178 N->y = 0.0; in box_normal() 181 t = MYMAX(a.x, MYMAX(a.y, a.z)); in box_normal() 186 if (t == a.y) in box_normal() 187 N->y = b.y; in box_normal()
|
| H A D | extvol.cpp | 106 xvol->tex->ctr.y = 0.0; in newextvol() 196 if (ry->d.y == 0.0) { in ext_volume_texture() 197 if ((ry->o.y < bx->min.y) || (ry->o.y > bx->max.y)) in ext_volume_texture() 201 ty1 = (bx->min.y - ry->o.y) / ry->d.y; in ext_volume_texture() 202 ty2 = (bx->max.y - ry->o.y) / ry->d.y; in ext_volume_texture() 248 bln.y = fabs(bx->min.y - bx->max.y); in ext_volume_texture() 258 pnt.y = ((ry->o.y + (ry->d.y * t)) - bx->min.y) / bln.y; in ext_volume_texture() 262 scalar = xvol->evaluator(pnt.x, pnt.y, pnt.z); in ext_volume_texture() 278 N.x = (xvol->evaluator(pnt.x - ddt, pnt.y, pnt.z) - in ext_volume_texture() 282 N.y = (xvol->evaluator(pnt.x, pnt.y - ddt, pnt.z) - in ext_volume_texture() [all …]
|
| H A D | objbound.cpp | 67 gmin->y = FHUGE; in globalbound() 85 gmin->y = MYMIN(gmin->y, min.y); in globalbound() 89 gmax->y = MYMAX(gmax->y, max.y); in globalbound() 104 (max->y >= omax.y) && (max->z >= omax.z)) { in objinside() 157 gctr.y = ((gmax.y - gmin.y) / 2.0) + gmin.y; in octreespace() 167 cmax2.y = gctr.y; in octreespace() 172 cmin3.y = gctr.y; in octreespace() 180 cmin4.y = gctr.y; in octreespace() 192 cmin6.y = gmin.y; in octreespace() 194 cmax6.y = gctr.y; in octreespace() [all …]
|
| H A D | bndbox.cpp | 111 if ((ry->s.y > bx->max.y) && (ry->e.y > bx->max.y)) in bndbox_intersect() 113 if ((ry->s.y < bx->min.y) && (ry->e.y < bx->min.y)) in bndbox_intersect() 147 if (ry->d.y == 0.0) { in bndbox_intersect() 148 if ((ry->o.y < bx->min.y) || (ry->o.y > bx->max.y)) in bndbox_intersect() 152 ty1 = (bx->min.y - ry->o.y) / ry->d.y; in bndbox_intersect() 153 ty2 = (bx->max.y - ry->o.y) / ry->d.y; in bndbox_intersect()
|
| H A D | triangle.cpp | 128 dest.x = v1.y * v2.z - v1.z * v2.y; \ 129 dest.y = v1.z * v2.x - v1.x * v2.z; \ 130 dest.z = v1.x * v2.y - v1.y * v2.x; 132 #define DOT(v1, v2) (v1.x * v2.x + v1.y * v2.y + v1.z * v2.z) 136 dest.y = v1.y - v2.y; \ 147 min->y = MYMIN(t->v0.y, MYMIN(v1.y, v2.y)); in tri_bbox() 151 max->y = MYMAX(t->v0.y, MYMAX(v1.y, v2.y)); in tri_bbox() 201 N->y = -N->y; in tri_normal() 224 N->y = W * trn->n0.y + U * trn->n1.y + V * trn->n2.y; in stri_normal()
|
| H A D | vol.cpp | 106 tx->ctr.y = 0.0; in newscalarvol() 169 int x, y, z; in scalar_volume_texture() local 204 if (ry->d.y == 0.0) { in scalar_volume_texture() 205 if ((ry->o.y < bx->min.y) || (ry->o.y > bx->max.y)) in scalar_volume_texture() 209 ty1 = (bx->min.y - ry->o.y) / ry->d.y; in scalar_volume_texture() 210 ty2 = (bx->max.y - ry->o.y) / ry->d.y; in scalar_volume_texture() 255 bln.y = fabs(bx->min.y - bx->max.y); in scalar_volume_texture() 258 dt = sqrt(bln.x * bln.x + bln.y * bln.y + bln.z * bln.z) / tdist; in scalar_volume_texture() 269 pnt.y = ((ry->o.y + (ry->d.y * t)) - bx->min.y) / bln.y; in scalar_volume_texture() 273 y = (int)((vol->yres - 1.5) * pnt.y + 0.5); in scalar_volume_texture() [all …]
|
| H A D | coordsys.cpp | 54 void xytopolar(flt x, flt y, flt rad, flt* u, flt* v) { in xytopolar() argument 56 r1 = x * x + y * y; in xytopolar() 58 if (y < 0.0) in xytopolar() 67 r1 = pnt.x * pnt.x + pnt.y * pnt.y; in xyztocyl() 70 if (pnt.y < 0.0) in xyztocyl() 79 r1 = sqrt(pnt.x * pnt.x + pnt.y * pnt.y + pnt.z * pnt.z); in xyztospr() 81 phi = acos(-pnt.y / r1); in xyztospr()
|
| H A D | trace.simple.cpp | 72 int y, in render_one_pixel() argument 86 primary = camray(&scene, x, y); in render_one_pixel() 141 for (int y = starty; y < stopy; y++) in parallel_thread() local 144 for (int y = starty; y < stopy; y++) in parallel_thread() 146 oneapi::tbb::parallel_for(starty, stopy, [mboxsize] (int y) in parallel_thread() 152 drawing_area drawing(startx, totaly - y, stopx - startx, 1); in parallel_thread() 154 color_t c = render_one_pixel(x, y, local_mbox, serial, startx, stopx, starty, stopy); in parallel_thread()
|
| H A D | trace.tbb.cpp | 103 int y, in render_one_pixel() argument 124 primary = camray(&scene, x, y); in render_one_pixel() 147 sample.d.y += ((rand() % 100) - 50) / jitterscale; in render_one_pixel() 213 for (int i = 1, y = r.rows().begin(); y != r.rows().end(); ++y, i++) { in operator ()() local 216 int d = (y % 3 == 0) ? 2 : 1; in operator ()() 228 for (int i = 1, y = r.rows().begin(); y != r.rows().end(); ++y, i++) { in operator ()() local 232 float alpha = y == r.rows().begin() || y == r.rows().end() - 1 || in operator ()() 237 x, y, local_mbox, serial, startx, stopx, starty, stopy, colors[pos], alpha); in operator ()() 240 render_one_pixel(x, y, local_mbox, serial, startx, stopx, starty, stopy); in operator ()()
|
| H A D | grid.hpp | 80 int y; /* Voxel Y address */ member 88 #define voxel2y(g, Y) ((Y) * (g->voxsize.y) + (g->min.y)) 95 #define y2voxel(g, y) (((y)-g->min.y) / g->voxsize.y) argument
|
| /oneTBB/examples/parallel_reduce/convex_hull/ |
| H A D | convex_hull.hpp | 75 T y; member 82 point(T _x, T _y) : x(_x), y(_y) {} in point() 86 return o << "(" << p.x << "," << p.y << ")"; in operator <<() 108 T r = (x * x + y * y); in GenerateRNDPoint() 115 y /= r; in GenerateRNDPoint() 120 y /= r; in GenerateRNDPoint() 125 y = (y + 1) * 0.5 * maxsize; in GenerateRNDPoint() 127 return point<T>(x, y); in GenerateRNDPoint() 144 return _istr >> _p.x >> _p.y; in operator >>() 149 return (p1.x == p2.x && p1.y == p2.y); in operator ==() [all …]
|
| /oneTBB/examples/task_arena/fractal/ |
| H A D | fractal.cpp | 44 y = 0; in calc_one_pixel() 47 while (((x * x + y * y) <= 4) && (iter < max_iterations)) { in calc_one_pixel() 48 xtemp = x * x - y * y + fx0; in calc_one_pixel() 49 y = 2 * x * y + fy0; in calc_one_pixel() 51 mu += exp(-sqrt(x * x + y * y)); in calc_one_pixel() 77 for (int y = 0; y < size_y; ++y) { in clear() local 78 area.set_pos(0, y); in clear() 110 for (int y = y0; y < y1; ++y) { in render_rect() local 111 area.set_pos(0, y - y0); in render_rect() 158 return x >= off_x && x <= off_x + size_x && y >= off_y && y <= off_y + size_y; in check_point() [all …]
|
| /oneTBB/examples/common/gui/ |
| H A D | video.hpp | 103 virtual void on_mouse(int x, int y, int key) {} in on_mouse() argument 134 drawing_area(int x, int y, int sizex, int sizey); 184 unsigned y, u, v; in get_color() local 186 u = (2048 + (blue << 3) - (y >> 5)) >> 4; // (limit->2^12)>>4 in get_color() 187 v = (2048 + (red << 3) - (y >> 5)) >> 4; in get_color() 188 y = y >> 8; in get_color() 189 return u | (y << 8) | (v << 16) | (y << 24); in get_color() 194 : base_index(y * dmem.sizex + x), in drawing_area() 200 start_y(y), in drawing_area() 204 assert(y < dmem.sizey); in drawing_area() [all …]
|
| H A D | macvideo.cpp | 62 bool video::init_window(int x, int y) { in init_window() argument 64 g_sizey = y; in init_window() 65 g_pImg = new unsigned int[x * y]; in init_window() 137 extern "C" void on_mouse_func(int x, int y, int k) { in on_mouse_func() argument 138 g_video->on_mouse(x, y, k); in on_mouse_func() 167 drawing_area::drawing_area(int x, int y, int sizex, int sizey) in drawing_area() argument 168 : base_index(y * g_sizex + x), in drawing_area() 174 start_y(y), in drawing_area() 178 assert(y < g_sizey); in drawing_area() 180 assert(y + sizey <= g_sizey); in drawing_area()
|
| H A D | convideo.cpp | 61 bool video::init_window(int x, int y) { in init_window() argument 63 g_sizey = y; in init_window() 64 g_pImg = new unsigned int[x * y]; in init_window() 130 drawing_area::drawing_area(int x, int y, int sizex, int sizey) in drawing_area() argument 131 : base_index(y * g_sizex + x), in drawing_area() 137 start_y(y), in drawing_area() 141 assert(y < g_sizey); in drawing_area() 143 assert(y + sizey <= g_sizey); in drawing_area()
|
| /oneTBB/examples/common/gui/xcode/tbbExample/ |
| H A D | OpenGLView.m | 25 void on_mouse_func(int x, int y, int k); 48 imageRect.origin.y=(full_height-imageRect.size.height)/2; 70 const int y = point.y; 71 if ( (y-imageRect.origin.y) > 0 && y < (imageRect.origin.y + imageRect.size.height )) 72 …on_mouse_func( x*g_sizex/(imageRect.size.width), (y-imageRect.origin.y)*g_sizey/imageRect.size.hei… 117 const int y = (int)point.y; 119 …on_mouse_func(x*g_sizex/(int)rect.size.width,((int)rect.size.height-y)*g_sizey/(int)rect.size.heig… 137 const int y=(int)rect.size.height; 138 [self.window setTitle:[NSString stringWithFormat:@"X=%d Y=%d", x,y]];
|
| /oneTBB/examples/graph/som/ |
| H A D | som.cpp | 95 double distance_squared(SOM_element x, SOM_element y) { in distance_squared() argument 98 double diff = x[i] - y[i]; in distance_squared() 106 for (int y = 0; y < yMax; ++y) { in initialize() local 109 my_map[x][y][i] = (randval(min_range[i], max_range[i])); in initialize() 112 my_map[x][y][i] = in initialize() 113 ((double)(x + y) / (xMax + yMax) * (max_range[i] - min_range[i]) + in initialize() 127 for (int y = r.cols().begin(); y != r.cols().end(); ++y) { in BMU_range() local 128 double dist = distance_squared(s, my_map[x][y]); in BMU_range() 132 min_y = y; in BMU_range()
|