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

Method save

core/src/processing/core/PGraphics.java:8399–8419  ·  view source on GitHub ↗
(String filename)

Source from the content-addressed store, hash-verified

8397
8398
8399 @Override
8400 public boolean save(String filename) { // ignore
8401
8402 if (hints[DISABLE_ASYNC_SAVEFRAME]) {
8403 return super.save(filename);
8404 }
8405
8406 if (asyncImageSaver == null) {
8407 asyncImageSaver = new AsyncImageSaver();
8408 }
8409
8410 if (!loaded) loadPixels();
8411 PImage target = asyncImageSaver.getAvailableTarget(pixelWidth, pixelHeight,
8412 format);
8413 if (target == null) return false;
8414 int count = PApplet.min(pixels.length, target.pixels.length);
8415 System.arraycopy(pixels, 0, target.pixels, 0, count);
8416 asyncImageSaver.saveTargetAsync(this, target, parent.sketchFile(filename));
8417
8418 return true;
8419 }
8420
8421 protected void processImageBeforeAsyncSave(PImage image) { }
8422

Callers 1

saveTargetAsyncMethod · 0.45

Calls 6

minMethod · 0.95
getAvailableTargetMethod · 0.80
arraycopyMethod · 0.80
saveTargetAsyncMethod · 0.80
sketchFileMethod · 0.80
loadPixelsMethod · 0.45

Tested by

no test coverage detected