MCPcopy Create free account
hub / github.com/ArtifexSoftware/mupdf / render

Method render

platform/java/example/Viewer.java:567–596  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

565 }
566
567 protected void render() {
568 if (bbox == null)
569 return;
570
571 float width = bbox.x1 - bbox.x0;
572 float height = bbox.y1 - bbox.y0;
573 float scaleX = (float) Math.floor(width * (currentDPI/72.0f) * pixelScale + 0.5f) / width;
574 float scaleY = (float) Math.floor(height * (currentDPI/72.0f) * pixelScale + 0.5f) / height;
575 Matrix ctm = new Matrix().scale(scaleX, scaleY).rotate(rotate);
576
577 Rect atOrigin = new Rect(bbox).transform(ctm);
578 ctm.e -= atOrigin.x0;
579 ctm.f -= atOrigin.y0;
580 Rect bounds = new Rect(bbox).transform(ctm);
581
582 Cookie cookie = new Cookie();
583
584 renderMeter = new RenderProgressmeter(this, "Rendering...", cookie, 250);
585 renderMeter.setLocationRelativeTo(this);
586 pageCanvas.requestFocusInWindow();
587
588 doc.renderPage(ctm, bounds, icc, antialias, invert, tint, tintBlack, tintWhite, cookie,
589 new ViewerCore.OnException() {
590 public void run(Throwable t) {
591 if (!renderMeter.cancelled)
592 exception(t);
593 }
594 }
595 );
596 }
597
598 protected int findExactZoomLevel(int dpi) {
599 for (int level = 0; level < zoomList.length - 1; level++)

Callers 7

zoomToDPIMethod · 0.95
rotateMethod · 0.95
toggleAntiAliasMethod · 0.95
toggleICCMethod · 0.95
toggleInvertMethod · 0.95
toggleTintMethod · 0.95
onPageChangeMethod · 0.95

Calls 4

scaleMethod · 0.80
renderPageMethod · 0.80
rotateMethod · 0.45
transformMethod · 0.45

Tested by

no test coverage detected