| 48 | { |
| 49 | |
| 50 | void GetPointBounds(float* points, int numPoints, HPDF_REAL bbox[4], const float radius = 0.f) |
| 51 | { |
| 52 | bbox[0] = static_cast<HPDF_REAL>(points[0]); |
| 53 | bbox[1] = static_cast<HPDF_REAL>(points[0]); |
| 54 | bbox[2] = static_cast<HPDF_REAL>(points[1]); |
| 55 | bbox[3] = static_cast<HPDF_REAL>(points[1]); |
| 56 | |
| 57 | for (int i = 1; i < numPoints; ++i) |
| 58 | { |
| 59 | bbox[0] = std::min(bbox[0], static_cast<HPDF_REAL>(points[i * 2])); |
| 60 | bbox[1] = std::max(bbox[1], static_cast<HPDF_REAL>(points[i * 2])); |
| 61 | bbox[2] = std::min(bbox[2], static_cast<HPDF_REAL>(points[i * 2 + 1])); |
| 62 | bbox[3] = std::max(bbox[3], static_cast<HPDF_REAL>(points[i * 2 + 1])); |
| 63 | } |
| 64 | |
| 65 | bbox[0] -= radius; |
| 66 | bbox[1] += radius; |
| 67 | bbox[2] -= radius; |
| 68 | bbox[3] += radius; |
| 69 | } |
| 70 | |
| 71 | void PolygonToShading( |
| 72 | float* points, int numPoints, unsigned char* colors, int nc_comps, HPDF_Shading shading) |
no test coverage detected