public void setTint(int fill) { if (openShape) { PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setTint()"); return; } tintColor = fill; if (vertices != null) { for (int i = 0; i < vertices.length; i++) { setFill(i, fill); } } }
public void setTint(int fill) { if (openShape) { PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setTint()"); return; } tintColor = fill; if (vertices != null) { for (int i = 0; i < vertices.length; i++) { setFill(i, fill); } } }
public void setFill(int fill) { if (openShape) { PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setFill()"); return; } this.fillColor = fill; if (vertices != null) { for (int i = 0; i < vertices.length; i++) { setFill(i, fill); } } }
/** * ( begin auto-generated from PShape_setFill.xml ) * * The <b>setFill()</b> method defines the fill color of a <b>PShape</b>. * This method is used after shapes are created or when a shape is defined explicitly * (e.g. <b>createShape(RECT, 20, 20, 80, 80)</b>) as shown in the above example. * When a shape is created with <b>beginShape()</b> and <b>endShape()</b>, its * attributes may be changed with <b>fill()</b> and <b>stroke()</b> within * <b>beginShape()</b> and <b>endShape()</b>. However, after the shape is * created, only the <b>setFill()</b> method can define a new fill value for * the <b>PShape</b>. * * ( end auto-generated ) * * @webref * @param fill * @brief Set the fill value */ public void setFill(int fill) { if (openShape) { PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setFill()"); return; } this.fillColor = fill; if (vertices != null && perVertexStyles) { for (int i = 0; i < vertexCount; i++) { setFill(i, fill); } } }
/** * Detect faces using {@link HaarCascadeDetector}, return an {@link ArrayList} of * {@link PShape} instances. Note the {@link PShape} instances have no fill and * a colour: 255,0,0 * @return detected faces */ public ArrayList<PShape> faces(){ ArrayList<PShape> faces = new ArrayList<PShape>(); List<DetectedFace> detected = faceDetector.detectFaces(oiImage.flatten()); for (DetectedFace detectedFace : detected) { Rectangle bounds = detectedFace.getBounds(); PShape detectedPShape = this.parent.createShape(RECT,bounds.x,bounds.y,bounds.width,bounds.height); detectedPShape.setFill(false); detectedPShape.setStroke(this.parent.color(255f, 0, 0)); faces.add(detectedPShape); } return faces; } }