Class ScalingParameters

  • All Implemented Interfaces:
    Serializable

    public class ScalingParameters
    extends Object
    implements Serializable
    Parameters for a scaling operation: the width and height of the bounding box, and whether to do upscaling or not.
    See Also:
    Serialized Form
    • Constructor Detail

      • ScalingParameters

        @Deprecated
        public ScalingParameters​(int width,
                                 int height,
                                 boolean upscaling)
        Deprecated.
        Creates a set of scaling parameters: the width and height of the bounding box, and whether to do upscaling. A width or height of 0 or less means 'unspecified'.
        Parameters:
        width - the width of the bounding box
        height - the height of the bounding box
        upscaling - whether to do upscaling of images that are smaller than the bounding box
      • ScalingParameters

        @Deprecated
        public ScalingParameters​(int width,
                                 int height,
                                 boolean upscaling,
                                 ImageUtils.ScalingStrategy strategy)
        Deprecated.
        Creates a set of scaling parameters: the width and height of the bounding box, and whether to do upscaling. A width or height of 0 or less means 'unspecified'.
        Parameters:
        width - the width of the bounding box
        height - the height of the bounding box
        upscaling - whether to do upscaling of images that are smaller than the bounding box
        strategy - the scaling strategy to use
      • ScalingParameters

        @Deprecated
        public ScalingParameters​(int width,
                                 int height,
                                 boolean upscaling,
                                 ImageUtils.ScalingStrategy strategy,
                                 float compressionQuality)
        Deprecated.
        Creates a set of scaling parameters: the width and height of the bounding box, and whether to do upscaling. A width or height of 0 or less means 'unspecified'.
        Parameters:
        width - the width of the bounding box
        height - the height of the bounding box
        upscaling - whether to do upscaling of images that are smaller than the bounding box
        strategy - the scaling strategy to use
        compressionQuality - compression quality
      • ScalingParameters

        public ScalingParameters​(int width,
                                 int height,
                                 boolean upscaling,
                                 boolean cropping,
                                 ImageUtils.ScalingStrategy strategy,
                                 float compressionQuality)
        Creates a set of scaling parameters: the width and height of the bounding box, and whether to do upscaling. A width or height of 0 or less means 'unspecified'.
        Parameters:
        width - the width of the bounding box
        height - the height of the bounding box
        upscaling - whether to do upscaling of images that are smaller than the bounding box
        cropping - whether to do cropping of images to fill the whole bounding box
        strategy - the scaling strategy to use
        compressionQuality - compression quality
    • Method Detail

      • getWidth

        public int getWidth()
        Returns:
        the width of the bounding box
      • getHeight

        public int getHeight()
        Returns:
        the height of the bounding box
      • getUpscaling

        @Deprecated
        public boolean getUpscaling()
        Deprecated.
        Use isUpscaling() instead
        Returns:
        whether images that are smaller than the specified bounding box should be scaled up or not.
      • isUpscaling

        public boolean isUpscaling()
        Returns:
        whether images that are smaller than the specified bounding box should be scaled up or not.
      • isCropping

        public boolean isCropping()
        Returns:
        whether cropping should be used to fill the bounding box
      • getCompressionQuality

        public float getCompressionQuality()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object