Class ImageSplit

java.lang.Object
games.stendhal.tools.map.ImageSplit

public class ImageSplit extends Object
splits an image
Author:
hendrik
  • Constructor Summary

    Constructors
    Constructor
    Description
    ImageSplit​(String imageFilename, String targetFolder, String prefix, int tileSizeSource, int tileSizeTarget, int offsetX, int offsetY, int cutOff)
    creates a new ImageSplit
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    divRoundingUp​(int i, int j)
    an integer division which rounds up
    static void
    main​(String[] args)
    entrance point
    void
    splits the large image into smaller ones

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ImageSplit

      public ImageSplit(String imageFilename, String targetFolder, String prefix, int tileSizeSource, int tileSizeTarget, int offsetX, int offsetY, int cutOff)
      creates a new ImageSplit
      Parameters:
      imageFilename - image to split
      targetFolder - target folder to store the split image ilfes
      prefix - prefix for file names e.g. zoom level
      tileSizeTarget - size in px for the target files
      offsetX - offset for the x-coordinate in the target filenames
      offsetY - offset for the y-coordinate in the target filenames
      cutOff - number of pixels to cut of at each side of the original image
  • Method Details

    • split

      public void split() throws IOException
      splits the large image into smaller ones
      Throws:
      IOException
    • divRoundingUp

      public static int divRoundingUp(int i, int j)
      an integer division which rounds up
      Parameters:
      i - number to divide
      j - number to divide by
      Returns:
      result
    • main

      public static void main(String[] args) throws IOException
      entrance point
      Parameters:
      args - command line arguments.
      Throws:
      IOException