-
-
Notifications
You must be signed in to change notification settings - Fork 17
Home
- Download a marlin release: marlin-X.Y.jar (RenderingEngine only)
- To use marlin, just edit your java command line to
- add the jar to your bootclasspath (append)
- set the system property 'sun.java2d.renderer'
java -Xbootclasspath/a:[path]/marlin-X.Y.jar -Dsun.java2d.renderer=org.marlin.pisces.PiscesRenderingEngine ...
- Launch your java application and you should see following logs (System.out or in log files): INFO: sun.java2d.renderer = org.marlin.pisces.PiscesRenderingEngine INFO: PiscesRenderingEngine: sun.java2d.renderer.useThreadLocal = ... INFO: PiscesRenderingEngine: sun.java2d.renderer.pixelsize = ...
Enjoy! Feedback and bug reports are welcome !
Here are the Marlin tuning options using following system properties:
- -Dsun.java2d.renderer.useThreadLocal=true|false (true by default): allow marlin to use ThreadLocal (TL) variables (true) or ConcurrentLinkedQueue (CLQ) (false) to store its rendering context (one per concurrent rendering thread). TL are 10% faster but may waste memory in web server environnement (high number of threads so many contexts)
- -Dsun.java2d.renderer.pixelsize=2048 (2048 by default): adjust initial capacity of rendering arrays depending on the typical image size/width (in fact largest shape's area). If you are drawing very large images (high resolution maps), please set this setting to your 'average' map size (4096x4096 or more ...); but do not set it too high to avoid wasting unused memory ...
FYI, the typical size per RenderingContext is 512K (pixelsize=2048) and 1Mb for pixelsize=4096 ...
For example to use CLQ mode (web server) optimized for large image rendering: java -Xbootclasspath/a:[path]/marlin-0.3.jar -Dsun.java2d.renderer.useThreadLocal=false -Dsun.java2d.renderer.pixelsize=8192 -Dsun.java2d.renderer=org.marlin.pisces.PiscesRenderingEngine ...
Marlin uses maven 2 and has no dependencies.
To build from sources, please type following commands: git clone https://github.com/bourgesl/marlin-renderer.git cd marlin-renderer mvn clean package
Jar files are then available in marlin-renderer/target !