Class ImageInfoUtils

java.lang.Object
is.galia.resource.iiif.ImageInfoUtils

public final class ImageInfoUtils extends Object
  • Method Details

    • maxReductionFactor

      public static int maxReductionFactor(Size fullSize, int minDimension)
      Parameters:
      fullSize - Full size of the source image.
      minDimension - Minimum allowed dimension.
      Returns:
      Maximum reduction factor to be able to fit above the minimum allowed dimension.
    • minReductionFactor

      public static int minReductionFactor(Size fullSize, long maxPixels)
      Parameters:
      fullSize - Full size of the source image.
      maxPixels - Maximum allowed number of pixels.
      Returns:
      Minimum reduction factor to be able to fit below the maximum allowed number of pixels.
    • getTileSize

      public static Size getTileSize(Size fullSize, Size physicalTileSize, int minSize)
      Calculates an optimal information tile size based on a given physical image tile size.
      Parameters:
      fullSize - Size of the full source image.
      physicalTileSize - Size of the source image's tiles. If the source image is not natively tiled, this should be equal to fullSize.
      minSize - Minimum allowed dimension.
      Returns:
      Information tile size.