MCPcopy Index your code
hub / github.com/processing/processing / rawPoints

Method rawPoints

core/src/processing/opengl/PShapeOpenGL.java:5189–5249  ·  view source on GitHub ↗
(PGraphicsOpenGL g)

Source from the content-addressed store, hash-verified

5187
5188
5189 protected void rawPoints(PGraphicsOpenGL g) {
5190 PGraphics raw = g.getRaw();
5191
5192 raw.colorMode(RGB);
5193 raw.noFill();
5194 raw.strokeCap(strokeCap);
5195 raw.beginShape(POINTS);
5196
5197 float[] vertices = tessGeo.pointVertices;
5198 int[] color = tessGeo.pointColors;
5199 float[] attribs = tessGeo.pointOffsets;
5200 short[] indices = tessGeo.pointIndices;
5201
5202 IndexCache cache = tessGeo.pointIndexCache;
5203 for (int n = 0; n < cache.size; n++) {
5204 int ioffset = cache.indexOffset[n];
5205 int icount = cache.indexCount[n];
5206 int voffset = cache.vertexOffset[n];
5207
5208 int pt = ioffset;
5209 while (pt < (ioffset + icount) / 3) {
5210 float size = attribs[2 * pt + 2];
5211 float weight;
5212 int perim;
5213 if (0 < size) { // round point
5214 weight = +size / 0.5f;
5215 perim = PApplet.min(PGraphicsOpenGL.MAX_POINT_ACCURACY,
5216 PApplet.max(PGraphicsOpenGL.MIN_POINT_ACCURACY,
5217 (int) (TWO_PI * weight /
5218 PGraphicsOpenGL.POINT_ACCURACY_FACTOR))) + 1;
5219 } else { // Square point
5220 weight = -size / 0.5f;
5221 perim = 5;
5222 }
5223
5224 int i0 = voffset + indices[3 * pt];
5225 int argb0 = PGL.nativeToJavaARGB(color[i0]);
5226 float[] pt0 = {0, 0, 0, 0};
5227
5228 float[] src0 = {0, 0, 0, 0};
5229 PApplet.arrayCopy(vertices, 4 * i0, src0, 0, 4);
5230 g.modelview.mult(src0, pt0);
5231
5232 if (raw.is3D()) {
5233 raw.strokeWeight(weight);
5234 raw.stroke(argb0);
5235 raw.vertex(pt0[X], pt0[Y], pt0[Z]);
5236 } else if (raw.is2D()) {
5237 float sx0 = g.screenXImpl(pt0[0], pt0[1], pt0[2], pt0[3]);
5238 float sy0 = g.screenYImpl(pt0[0], pt0[1], pt0[2], pt0[3]);
5239 raw.strokeWeight(weight);
5240 raw.stroke(argb0);
5241 raw.vertex(sx0, sy0);
5242 }
5243
5244 pt += perim;
5245 }
5246 }

Callers 1

renderMethod · 0.95

Calls 15

colorModeMethod · 0.95
noFillMethod · 0.95
strokeCapMethod · 0.95
beginShapeMethod · 0.95
minMethod · 0.95
maxMethod · 0.95
nativeToJavaARGBMethod · 0.95
arrayCopyMethod · 0.95
is3DMethod · 0.95
strokeWeightMethod · 0.95
strokeMethod · 0.95
vertexMethod · 0.95

Tested by

no test coverage detected