Package limn.graphics

Interface SvgRenderer.Document

All Superinterfaces:
AutoCloseable
Enclosing interface:
SvgRenderer

public static interface SvgRenderer.Document extends AutoCloseable
One SVG, opened: measured, drawn and changed until it is closed.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Lets the document go.
    float
     
    render(int width, int height)
    Draws the whole document scaled to width by height pixels.
    boolean
    setAttribute(String id, String name, String value)
    Changes one attribute of the element with that id, for the drawings after this.
    float
     
  • Method Details

    • width

      float width()
      Returns:
      its width in its own units, above 0
    • height

      float height()
      Returns:
      its height in its own units, above 0
    • setAttribute

      boolean setAttribute(String id, String name, String value)
      Changes one attribute of the element with that id, for the drawings after this.
      Parameters:
      id - the element's id
      name - the attribute's name
      value - its new value, as it would be written in the file
      Returns:
      whether the document has such an element
    • render

      Image render(int width, int height)
      Draws the whole document scaled to width by height pixels.
      Parameters:
      width - at least 1
      height - at least 1
      Returns:
      the picture, straight-alpha RGBA8 with row 0 at the top
    • close

      void close()
      Lets the document go. Idempotent.
      Specified by:
      close in interface AutoCloseable