------------------------------------------------------------------------------
| 759 | |
| 760 | //------------------------------------------------------------------------------ |
| 761 | void vtkPDFContextDevice2D::DrawPoints(float* points, int n, unsigned char* colors, int nc_comps) |
| 762 | { |
| 763 | assert(nc_comps == 0 || colors != nullptr); |
| 764 | assert(n > 0); |
| 765 | assert(points != nullptr); |
| 766 | |
| 767 | if (!colors && this->Pen->GetColorObject().GetAlpha() == 0) |
| 768 | { |
| 769 | return; |
| 770 | } |
| 771 | |
| 772 | this->PushGraphicsState(); |
| 773 | this->ApplyPenStateAsFill(); |
| 774 | |
| 775 | const vtkVector2f width = this->GetUnscaledPenWidth(); |
| 776 | const vtkVector2f halfWidth = width * 0.5f; |
| 777 | |
| 778 | for (int i = 0; i < n; ++i) |
| 779 | { |
| 780 | if (nc_comps > 0) |
| 781 | { |
| 782 | this->ApplyFillColor(colors + i * nc_comps, nc_comps); |
| 783 | } |
| 784 | float originX = points[i * 2] - halfWidth[0]; |
| 785 | float originY = points[i * 2 + 1] - halfWidth[1]; |
| 786 | HPDF_Page_Rectangle(this->Impl->Page, originX, originY, width[0], width[1]); |
| 787 | this->Fill(); |
| 788 | } |
| 789 | |
| 790 | this->PopGraphicsState(); |
| 791 | } |
| 792 | |
| 793 | //------------------------------------------------------------------------------ |
| 794 | void vtkPDFContextDevice2D::DrawPointSprites( |