Tabnine Logo
PApplet.min
Code IndexAdd Tabnine to your IDE (free)

How to use
min
method
in
processing.core.PApplet

Best Java code snippets using processing.core.PApplet.min (Showing top 20 results out of 315)

origin: org.processing/core

void getLineVertexMin(PVector v, int first, int last) {
 for (int i = first; i <= last; i++) {
  int index = 4 * i;
  v.x = PApplet.min(v.x, lineVertices[index++]);
  v.y = PApplet.min(v.y, lineVertices[index++]);
  v.z = PApplet.min(v.z, lineVertices[index  ]);
 }
}
origin: org.processing/core

void getPolyVertexMin(PVector v, int first, int last) {
 for (int i = first; i <= last; i++) {
  int index = 4 * i;
  v.x = PApplet.min(v.x, polyVertices[index++]);
  v.y = PApplet.min(v.y, polyVertices[index++]);
  v.z = PApplet.min(v.z, polyVertices[index  ]);
 }
}
origin: ajavamind/Processing-Cardboard

void getVertexMin(PVector v) {
 int index;
 for (int i = 0; i < vertexCount; i++) {
  index = 4 * i;
  v.x = PApplet.min(v.x, vertices[index++]);
  v.y = PApplet.min(v.y, vertices[index++]);
  v.z = PApplet.min(v.z, vertices[index  ]);
 }
}
origin: org.processing/core

void getVertexMin(PVector v) {
 int index;
 for (int i = 0; i < vertexCount; i++) {
  index = 4 * i;
  v.x = PApplet.min(v.x, vertices[index++]);
  v.y = PApplet.min(v.y, vertices[index++]);
  v.z = PApplet.min(v.z, vertices[index  ]);
 }
}
origin: org.processing/core

void getPointVertexMin(PVector v, int first, int last) {
 for (int i = first; i <= last; i++) {
  int index = 4 * i;
  v.x = PApplet.min(v.x, pointVertices[index++]);
  v.y = PApplet.min(v.y, pointVertices[index++]);
  v.z = PApplet.min(v.z, pointVertices[index  ]);
 }
}
origin: ajavamind/Processing-Cardboard

void getPolyVertexMin(PVector v, int first, int last) {
 for (int i = first; i <= last; i++) {
  int index = 4 * i;
  v.x = PApplet.min(v.x, polyVertices[index++]);
  v.y = PApplet.min(v.y, polyVertices[index++]);
  v.z = PApplet.min(v.z, polyVertices[index  ]);
 }
}
origin: ajavamind/Processing-Cardboard

void getLineVertexMin(PVector v, int first, int last) {
 for (int i = first; i <= last; i++) {
  int index = 4 * i;
  v.x = PApplet.min(v.x, lineVertices[index++]);
  v.y = PApplet.min(v.y, lineVertices[index++]);
  v.z = PApplet.min(v.z, lineVertices[index  ]);
 }
}
origin: ajavamind/Processing-Cardboard

void getPointVertexMin(PVector v, int first, int last) {
 for (int i = first; i <= last; i++) {
  int index = 4 * i;
  v.x = PApplet.min(v.x, pointVertices[index++]);
  v.y = PApplet.min(v.y, pointVertices[index++]);
  v.z = PApplet.min(v.z, pointVertices[index  ]);
 }
}
origin: org.processing/core

protected void updateTexelsImpl(int x, int y, int w, int h) {
 int x2 = x + w;
 int y2 = y + h;
 if (!modified) {
  mx1 = PApplet.max(0, x);
  mx2 = PApplet.min(width - 1, x2);
  my1 = PApplet.max(0, y);
  my2 = PApplet.min(height - 1, y2);
  modified = true;
 } else {
  if (x < mx1) mx1 = PApplet.max(0, x);
  if (x > mx2) mx2 = PApplet.min(width - 1, x);
  if (y < my1) my1 = PApplet.max(0, y);
  if (y > my2) my2 = y;
  if (x2 < mx1) mx1 = PApplet.max(0, x2);
  if (x2 > mx2) mx2 = PApplet.min(width - 1, x2);
  if (y2 < my1) my1 = PApplet.max(0, y2);
  if (y2 > my2) my2 = PApplet.min(height - 1, y2);
 }
}
origin: org.processing/core

protected void initTexture(int target, int format, int width, int height,
             int initColor) {
 int[] glcolor = new int[16 * 16];
 Arrays.fill(glcolor, javaToNativeARGB(initColor));
 IntBuffer texels = allocateDirectIntBuffer(16 * 16);
 texels.put(glcolor);
 texels.rewind();
 for (int y = 0; y < height; y += 16) {
  int h = PApplet.min(16, height - y);
  for (int x = 0; x < width; x += 16) {
   int w = PApplet.min(16, width - x);
   texSubImage2D(target, 0, x, y, w, h, format, UNSIGNED_BYTE, texels);
  }
 }
}
origin: ajavamind/Processing-Cardboard

protected void initTexture(int target, int format, int width, int height,
             int initColor) {
 int[] glcolor = new int[16 * 16];
 Arrays.fill(glcolor, javaToNativeARGB(initColor));
 IntBuffer texels = allocateDirectIntBuffer(16 * 16);
 texels.put(glcolor);
 texels.rewind();
 for (int y = 0; y < height; y += 16) {
  int h = PApplet.min(16, height - y);
  for (int x = 0; x < width; x += 16) {
   int w = PApplet.min(16, width - x);
   texSubImage2D(target, 0, x, y, w, h, format, UNSIGNED_BYTE, texels);
  }
 }
}
origin: mirador/mirador

public void stroke(int argb, int maxa) {
 int maxAlpha = PApplet.min(argb >> 24 & 0xFF, maxa);
 intf.app.stroke(argb >> 16 & 0xFF, argb >> 8 & 0xFF, argb & 0xFF, getAlpha(maxAlpha));    
}  
origin: mirador/mirador

public void fill(int argb, int maxa) {
 int maxAlpha = PApplet.min(argb >> 24 & 0xFF, maxa);
 intf.app.fill(argb >> 16 & 0xFF, argb >> 8 & 0xFF, argb & 0xFF, getAlpha(maxAlpha));
}

origin: mirador/mirador

public void tint(int argb, int maxa) {
 int maxAlpha = PApplet.min(argb >> 24 & 0xFF, maxa);
 intf.app.tint(argb >> 16 & 0xFF, argb >> 8 & 0xFF, argb & 0xFF, getAlpha(maxAlpha));
}  

origin: mirador/mirador

public int getAlpha(int max) {
 if (parent != null && inner) {
  // Constraining by the opacity of the parent in case this is an "inner"
  // widget.
  max = PApplet.min(max, parent.getAlpha(255));
 }
 return PApplet.round(opacity.get() * max);
}  

origin: mirador/mirador

boolean inside(float rx, float ry) {
 textFont(pFont);      
 float w1 = textWidth(label);
 if (w1 < width/2 - w) {
  w1 = PApplet.min(WIDTH_FACTOR * w1, width/2 - w); 
 }      
 float x1 = x + w + 5 + w1;
 float y1 = y.get() + h + sep;
 return x <= rx && rx <= x1 && y.get() <= ry && ry <= y1;
}

origin: org.processing/core

protected void initTexture(PGraphicsOpenGL pg, PFont font) {
 lastTex = -1;
 int spow = PGL.nextPowerOfTwo(font.getSize());
 minSize = PApplet.min(PGraphicsOpenGL.maxTextureSize,
            PApplet.max(PGL.MIN_FONT_TEX_SIZE, spow));
 maxSize = PApplet.min(PGraphicsOpenGL.maxTextureSize,
            PApplet.max(PGL.MAX_FONT_TEX_SIZE, 2 * spow));
 if (maxSize < spow) {
  PGraphics.showWarning("The font size is too large to be properly " +
             "displayed with OpenGL");
 }
 addTexture(pg);
 offsetX = 0;
 offsetY = 0;
 lineHeight = 0;
 texinfoMap = new HashMap<PFont.Glyph, TextureInfo>();
 glyphTexinfos = new TextureInfo[font.getGlyphCount()];
 addAllGlyphsToTexture(pg, font);
}
origin: ajavamind/Processing-Cardboard

@Override
public boolean save(String filename) { // ignore
 if (hints[DISABLE_ASYNC_SAVEFRAME]) {
  return super.save(filename);
 }
 if (asyncImageSaver == null) {
  asyncImageSaver = new AsyncImageSaver();
 }
 if (!loaded) loadPixels();
 PImage target = asyncImageSaver.getAvailableTarget(pixelWidth, pixelHeight,
                           format);
 if (target == null) return false;
 int count = PApplet.min(pixels.length, target.pixels.length);
 System.arraycopy(pixels, 0, target.pixels, 0, count);
 asyncImageSaver.saveTargetAsync(this, target, filename);
 return true;
}
origin: org.processing/core

@Override
public boolean save(String filename) { // ignore
 if (hints[DISABLE_ASYNC_SAVEFRAME]) {
  return super.save(filename);
 }
 if (asyncImageSaver == null) {
  asyncImageSaver = new AsyncImageSaver();
 }
 if (!loaded) loadPixels();
 PImage target = asyncImageSaver.getAvailableTarget(pixelWidth, pixelHeight,
                           format);
 if (target == null) return false;
 int count = PApplet.min(pixels.length, target.pixels.length);
 System.arraycopy(pixels, 0, target.pixels, 0, count);
 asyncImageSaver.saveTargetAsync(this, target, parent.sketchFile(filename));
 return true;
}
origin: mirador/mirador

void mouseReleased() {
 if (!inside(mouseX, mouseY)) return;
  
 if (insideDismiss(mouseX, mouseY)) {
  data.removeCovariate(var);
  markedForRemoval = true;
 } else {
  open = !open;
  if (open) {
   float h1 = PApplet.min(covarHeightMax, itemHeight + posy + selector.getFullHeight() + marginy);
   y.setTarget(-(h1 - itemHeight));
   h.setTarget(h1);
   selector.targetY(y.getTarget() + itemHeight + posy);
   selector.setHeight(h1 - itemHeight - posy);
  } else {
   y.setTarget(0);
   h.setTarget(itemHeight);
   selector.targetY(itemHeight + posy);
   selector.setHeight(selh);
  }
 }
}

processing.corePAppletmin

Javadoc

( begin auto-generated from min.xml ) Determines the smallest value in a sequence of numbers. ( end auto-generated )

Popular methods of PApplet

  • constrain
  • createGraphics
    Create an offscreen graphics surface for drawing, in this case for a renderer that writes to a file
  • loadStrings
    ( begin auto-generated from loadStrings.xml ) Reads the contents of a file or url and creates a Stri
  • saveStrings
    ( begin auto-generated from saveStrings.xml ) Writes an array of strings to a file, one line per str
  • abs
  • createImage
    ( begin auto-generated from createImage.xml ) Creates a new PImage (the datatype for storing images)
  • createShape
  • createWriter
    ( begin auto-generated from createWriter.xml ) Creates a new file in the sketch folder, and a PrintW
  • loadImage
  • main
    main() method for running this class from the command line. Usage: PApplet [options] [s
  • max
  • parseInt
  • max,
  • parseInt,
  • random,
  • round,
  • split,
  • sqrt,
  • unhex,
  • arrayCopy,
  • ceil,
  • checkExtension

Popular in Java

  • Start an intent from android
  • setRequestProperty (URLConnection)
  • getContentResolver (Context)
  • getSupportFragmentManager (FragmentActivity)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now