Class DefaultMultiLevelModel

java.lang.Object
com.bc.ceres.glevel.support.DefaultMultiLevelModel
All Implemented Interfaces:
MultiLevelModel

@Deprecated public class DefaultMultiLevelModel extends Object implements MultiLevelModel
Deprecated.
A default implementation for a the MultiLevelModel interface.
  • Field Details

    • DEFAULT_MAX_LEVEL_PIXEL_COUNT

      public static final int DEFAULT_MAX_LEVEL_PIXEL_COUNT
      Deprecated.
      See Also:
  • Constructor Details

    • DefaultMultiLevelModel

      public DefaultMultiLevelModel(AffineTransform imageToModelTransform, int width, int height)
      Deprecated.
      Constructs a a new model for a multi level source. The number of levels is computed by getLevelCount(int, int). The image bounds are computed by getModelBounds(java.awt.geom.AffineTransform, int, int).
      Parameters:
      imageToModelTransform - The affine transformation from image to model coordinates.
      width - The width of the image in pixels at level zero.
      height - The height of the image in pixels at level zero.
    • DefaultMultiLevelModel

      public DefaultMultiLevelModel(int levelCount, AffineTransform imageToModelTransform, int width, int height)
      Deprecated.
      Constructs a a new model for a multi level source. The image bounds are computed by getModelBounds(java.awt.geom.AffineTransform, int, int).
      Parameters:
      levelCount - The number of levels.
      imageToModelTransform - The affine transformation from image to model coordinates.
      width - The width of the image in pixels at level zero.
      height - The height of the image in pixels at level zero.
    • DefaultMultiLevelModel

      public DefaultMultiLevelModel(int levelCount, AffineTransform imageToModelTransform, Rectangle2D modelBounds)
      Deprecated.
      Constructs a a new model for a multi level source.
      Parameters:
      levelCount - The number of levels.
      imageToModelTransform - The affine transformation from image to model coordinates.
      modelBounds - The image bounds in model coordinates.
  • Method Details

    • getLevelCount

      public int getLevelCount()
      Deprecated.
      Description copied from interface: MultiLevelModel
      Gets the number of resolution levels, which is always greater than zero.
      Specified by:
      getLevelCount in interface MultiLevelModel
      Returns:
      The number of resolution levels.
    • getLevel

      public int getLevel(double scale)
      Deprecated.
      Description copied from interface: MultiLevelModel
      Gets the resolution level for a given scaling factor, e.g. level=log(scale)/log(2).
      Specified by:
      getLevel in interface MultiLevelModel
      Parameters:
      scale - The scaling factor, will always be a greater than or equal to 1.
      Returns:
      The resolution level, must be in the range 0 to levelCount-1.
      See Also:
    • getScale

      public double getScale(int level)
      Deprecated.
      Description copied from interface: MultiLevelModel
      Gets the scale for a given resolution level, e.g. scale=pow(2,level).
      Specified by:
      getScale in interface MultiLevelModel
      Parameters:
      level - The resolution level, must be in the range 0 to levelCount-1.
      Returns:
      The scaling factor, must be greater than or equal to 1. getLevel(scale) shall return level.
      See Also:
    • getImageToModelTransform

      public final AffineTransform getImageToModelTransform(int level)
      Deprecated.
      Description copied from interface: MultiLevelModel
      Gets a copy (non-life object) of the affine transformation from image to model coordinates for the given level.
      Specified by:
      getImageToModelTransform in interface MultiLevelModel
      Parameters:
      level - The resolution level, must be in the range 0 to levelCount-1.
      Returns:
      The affine transformation from image to model coordinates.
    • getModelToImageTransform

      public final AffineTransform getModelToImageTransform(int level)
      Deprecated.
      Description copied from interface: MultiLevelModel
      Gets a copy (non-life object) of the affine transformation from model to image coordinates for the given level.
      Specified by:
      getModelToImageTransform in interface MultiLevelModel
      Parameters:
      level - The resolution level, must be in the range 0 to levelCount-1.
      Returns:
      The affine transformation from model to image coordinates.
    • pow2

      protected static double pow2(double v)
      Deprecated.
    • log2

      protected static double log2(double v)
      Deprecated.
    • checkLevel

      protected void checkLevel(int level)
      Deprecated.
    • getModelBounds

      public Rectangle2D getModelBounds()
      Deprecated.
      Description copied from interface: MultiLevelModel
      Gets the bounding box in model coordinates.
      Specified by:
      getModelBounds in interface MultiLevelModel
      Returns:
      The bounding box, may be null if unspecified.
    • setModelBounds

      public void setModelBounds(Rectangle2D modelBounds)
      Deprecated.
    • getModelBounds

      public static Rectangle2D getModelBounds(AffineTransform i2mTransform, RenderedImage levelZeroImage)
      Deprecated.
      Computes the image bounding box in model coordinates.
      Parameters:
      i2mTransform - The affine transformation from image to model coordinates.
      levelZeroImage - The image at level zero.
      Returns:
      The number of levels.
    • getModelBounds

      public static Rectangle2D getModelBounds(AffineTransform i2mTransform, int width, int height)
      Deprecated.
      Computes the image bounding box in model coordinates.
      Parameters:
      i2mTransform - The affine transformation from image to model coordinates.
      width - The width of the image in pixels at level zero.
      height - The height of the image in pixels at level zero.
      Returns:
      The number of levels.
    • getLevelCount

      public static int getLevelCount(int width, int height)
      Deprecated.
      Computes the number of levels using the DEFAULT_MAX_LEVEL_PIXEL_COUNT constant.
      Parameters:
      width - The width of the image in pixels at level zero.
      height - The height of the image in pixels at level zero.
      Returns:
      The number of levels.