protected String[] loadVertexShader(String filename) { return sketch.loadStrings(filename); }
protected String[] loadFragmentShader(String filename) { return sketch.loadStrings(filename); }
protected String[] loadVertexShader(String filename) { return sketch.loadStrings(filename); }
protected String[] loadFragmentShader(String filename) { return sketch.loadStrings(filename); }
public String read() { if (!enabled) return ""; writer.flush(); String[] lines = PApplet.loadStrings(file); String concat = ""; for (String line: lines) { concat += line + "\n"; } return concat; }
/** * @nowebref */ static public String[] loadStrings(InputStream input) { try { BufferedReader reader = new BufferedReader(new InputStreamReader(input, "UTF-8")); return loadStrings(reader); } catch (IOException e) { e.printStackTrace(); } return null; }
@Override protected String[] loadFragmentShader(String filename, int version) { String[] fragSrc0 = sketch.loadStrings(filename); return preprocessFragmentSource(fragSrc0, version); }
@Override protected String[] loadVertexShader(String filename, int version) { String[] vertSrc0 = sketch.loadStrings(filename); return preprocessVertexSource(vertSrc0, version); }
protected String[] loadVertexShader(URL url) { try { return PApplet.loadStrings(url.openStream()); } catch (IOException e) { PGraphics.showException("Cannot load vertex shader " + url.getFile()); } return null; }
protected String[] loadFragmentShader(URL url) { try { return PApplet.loadStrings(url.openStream()); } catch (IOException e) { PGraphics.showException("Cannot load fragment shader " + url.getFile()); } return null; }
protected String[] loadFragmentShader(URL url) { try { return PApplet.loadStrings(url.openStream()); } catch (IOException e) { PGraphics.showException("Cannot load fragment shader " + url.getFile()); } return null; }
protected String[] loadVertexShader(URL url) { try { return PApplet.loadStrings(url.openStream()); } catch (IOException e) { PGraphics.showException("Cannot load vertex shader " + url.getFile()); } return null; }
static public String[] loadStrings(File file) { InputStream is = createInput(file); if (is != null) return loadStrings(is); return null; }
/** * Read a set of entries from a Reader that has each key/value pair on * a single line, separated by a tab. * * @nowebref */ public StringDict(BufferedReader reader) { String[] lines = PApplet.loadStrings(reader); keys = new String[lines.length]; values = new String[lines.length]; for (int i = 0; i < lines.length; i++) { String[] pieces = PApplet.split(lines[i], '\t'); if (pieces.length == 2) { keys[count] = pieces[0]; values[count] = pieces[1]; indices.put(keys[count], count); count++; } } }
@Override protected String[] loadFragmentShader(URL url, int version) { try { String[] fragSrc0 = PApplet.loadStrings(url.openStream()); return preprocessFragmentSource(fragSrc0, version); } catch (IOException e) { PGraphics.showException("Cannot load fragment shader " + url.getFile()); } return null; }
@Override protected String[] loadVertexShader(URL url, int version) { try { String[] vertSrc0 = PApplet.loadStrings(url.openStream()); return preprocessVertexSource(vertSrc0, version); } catch (IOException e) { PGraphics.showException("Cannot load vertex shader " + url.getFile()); } return null; }
/** * Read a set of entries from a Reader that has each key/value pair on * a single line, separated by a tab. * * @nowebref */ public IntDict(BufferedReader reader) { String[] lines = PApplet.loadStrings(reader); keys = new String[lines.length]; values = new int[lines.length]; for (int i = 0; i < lines.length; i++) { String[] pieces = PApplet.split(lines[i], '\t'); if (pieces.length == 2) { keys[count] = pieces[0]; values[count] = PApplet.parseInt(pieces[1]); indices.put(pieces[0], count); count++; } } }
public CalibratedColorTracker(PaperScreen paperScreen, float scale) { super(paperScreen, scale); references = new ColorReferenceThresholds[numberOfRefs]; // Load all the colors. for (int fileId = 0; fileId < numberOfRefs; fileId++) { String fileName = Papart.colorThresholds + fileId + ".txt"; String[] list = Papart.getPapart().getApplet().loadStrings(fileName); references[fileId] = new ColorReferenceThresholds(); for (String data : list) { references[fileId].loadParameter(data); } System.out.println("Ref: " + fileId + " " + " A " + references[fileId].averageA + " B " + references[fileId].averageB); } }
private ColorTracker initColorTracking(String name, String calibFile, PaperScreen screen, float quality) { ColorTracker colorTracker = new ColorTracker(screen, getDefaultColorTouchCalibration(), quality); String[] list = applet.loadStrings(calibFile); for (int i = 0; i < list.length; i++) { String data = list[i]; colorTracker.loadParameter(data); } colorTracker.setName(name); return colorTracker; }
public static ColorReferenceThresholds[] loadDefaultThresholds(int numberOfRefs) { ColorReferenceThresholds[] references = new ColorReferenceThresholds[numberOfRefs]; // Load all the colors. for (int fileId = 0; fileId < numberOfRefs; fileId++) { String fileName = Papart.colorThresholds + fileId + ".txt"; String[] list = Papart.getPapart().getApplet().loadStrings(fileName); references[fileId] = new ColorReferenceThresholds(); for (String data : list) { references[fileId].loadParameter(data); } } return references; }