Lines Matching defs:bounds

134 	float bounds[4];			// Tight bounding box of the shape [minx,miny,maxx,maxy].
153 float bounds[4]; // Tight bounding box of the shape [minx,miny,maxx,maxy].
556 static int nsvg__ptInBounds(float* pt, float* bounds)
558 return pt[0] >= bounds[0] && pt[0] <= bounds[2] && pt[1] >= bounds[1] && pt[1] <= bounds[3];
568 static void nsvg__curveBounds(float* bounds, float* curve)
578 bounds[0] = nsvg__minf(v0[0], v3[0]);
579 bounds[1] = nsvg__minf(v0[1], v3[1]);
580 bounds[2] = nsvg__maxf(v0[0], v3[0]);
581 bounds[3] = nsvg__maxf(v0[1], v3[1]);
584 // If control points are inside the bounds, we're done.
585 if (nsvg__ptInBounds(v1, bounds) && nsvg__ptInBounds(v2, bounds))
613 bounds[0+i] = nsvg__minf(bounds[0+i], (float)v);
614 bounds[2+i] = nsvg__maxf(bounds[2+i], (float)v);
907 static void nsvg__getLocalBounds(float* bounds, NSVGshape *shape, float* xform)
920 bounds[0] = curveBounds[0];
921 bounds[1] = curveBounds[1];
922 bounds[2] = curveBounds[2];
923 bounds[3] = curveBounds[3];
926 bounds[0] = nsvg__minf(bounds[0], curveBounds[0]);
927 bounds[1] = nsvg__minf(bounds[1], curveBounds[1]);
928 bounds[2] = nsvg__maxf(bounds[2], curveBounds[2]);
929 bounds[3] = nsvg__maxf(bounds[3], curveBounds[3]);
968 // Calculate shape bounds
969 shape->bounds[0] = shape->paths->bounds[0];
970 shape->bounds[1] = shape->paths->bounds[1];
971 shape->bounds[2] = shape->paths->bounds[2];
972 shape->bounds[3] = shape->paths->bounds[3];
974 shape->bounds[0] = nsvg__minf(shape->bounds[0], path->bounds[0]);
975 shape->bounds[1] = nsvg__minf(shape->bounds[1], path->bounds[1]);
976 shape->bounds[2] = nsvg__maxf(shape->bounds[2], path->bounds[2]);
977 shape->bounds[3] = nsvg__maxf(shape->bounds[3], path->bounds[3]);
1033 float bounds[4];
1056 // Find bounds
1059 nsvg__curveBounds(bounds, curve);
1061 path->bounds[0] = bounds[0];
1062 path->bounds[1] = bounds[1];
1063 path->bounds[2] = bounds[2];
1064 path->bounds[3] = bounds[3];
1066 path->bounds[0] = nsvg__minf(path->bounds[0], bounds[0]);
1067 path->bounds[1] = nsvg__minf(path->bounds[1], bounds[1]);
1068 path->bounds[2] = nsvg__maxf(path->bounds[2], bounds[2]);
1069 path->bounds[3] = nsvg__maxf(path->bounds[3], bounds[3]);
2745 static void nsvg__imageBounds(NSVGparser* p, float* bounds)
2750 bounds[0] = bounds[1] = bounds[2] = bounds[3] = 0.0;
2753 bounds[0] = shape->bounds[0];
2754 bounds[1] = shape->bounds[1];
2755 bounds[2] = shape->bounds[2];
2756 bounds[3] = shape->bounds[3];
2758 bounds[0] = nsvg__minf(bounds[0], shape->bounds[0]);
2759 bounds[1] = nsvg__minf(bounds[1], shape->bounds[1]);
2760 bounds[2] = nsvg__maxf(bounds[2], shape->bounds[2]);
2761 bounds[3] = nsvg__maxf(bounds[3], shape->bounds[3]);
2789 float tx, ty, sx, sy, us, bounds[4], t[6], avgs;
2794 nsvg__imageBounds(p, bounds);
2800 p->viewMinx = bounds[0];
2801 p->viewWidth = bounds[2] - bounds[0];
2808 p->viewMiny = bounds[1];
2809 p->viewHeight = bounds[3] - bounds[1];
2842 shape->bounds[0] = (shape->bounds[0] + tx) * sx;
2843 shape->bounds[1] = (shape->bounds[1] + ty) * sy;
2844 shape->bounds[2] = (shape->bounds[2] + tx) * sx;
2845 shape->bounds[3] = (shape->bounds[3] + ty) * sy;
2847 path->bounds[0] = (path->bounds[0] + tx) * sx;
2848 path->bounds[1] = (path->bounds[1] + ty) * sy;
2849 path->bounds[2] = (path->bounds[2] + tx) * sx;
2850 path->bounds[3] = (path->bounds[3] + ty) * sy;
2945 memcpy(res->bounds, p->bounds, sizeof(p->bounds));