Interface SVGRasterizer


public interface SVGRasterizer
Defines the interface for an SVG rasterizer, responsible for converting SVG data into rasterized images.
  • Method Summary

    Modifier and Type
    Method
    Description
    rasterizeSVG(InputStream stream, int zoom)
    Rasterizes an SVG image from the provided InputStream using the specified zoom.
    rasterizeSVG(InputStream stream, int width, int height)
    Rasterizes an SVG image from the provided InputStream into a raster image of the specified width and height.
  • Method Details

    • rasterizeSVG

      ImageData rasterizeSVG(InputStream stream, int zoom)
      Rasterizes an SVG image from the provided InputStream using the specified zoom.
      Parameters:
      stream - the SVG image as an InputStream.
      zoom - the scaling percentage (e.g., 100 = original size, 200 = double size). This value must be greater zero.
      Returns:
      the ImageData for the rasterized image.
      Throws:
      SWTException -
      • ERROR_INVALID_IMAGE - if the SVG cannot be loaded
      IllegalArgumentException -
      • ERROR_INVALID_ARGUMENT - if the zoom is less than zero
    • rasterizeSVG

      ImageData rasterizeSVG(InputStream stream, int width, int height)
      Rasterizes an SVG image from the provided InputStream into a raster image of the specified width and height.
      Parameters:
      stream - the SVG image as an InputStream.
      width - the width of the rasterized image in pixels (must be positive).
      height - the height of the rasterized image in pixels (must be positive).
      Returns:
      the ImageData for the rasterized image.
      Throws:
      SWTException -
      • ERROR_INVALID_IMAGE - if the SVG cannot be loaded
      IllegalArgumentException -
      • ERROR_INVALID_ARGUMENT - if the width or height is less than zero