Class ScalingParameters.Builder

java.lang.Object
org.hippoecm.frontend.plugins.gallery.imageutil.ScalingParameters.Builder
Enclosing class:
ScalingParameters

public static class ScalingParameters.Builder extends Object
  • Constructor Details

    • Builder

      public Builder(int width, int height)
      Creates a scaled version of an image. The given scaling parameters define a bounding box with a certain width and height.
      Parameters:
      width - the width of the bounding box
      height - the height of the bounding box
  • Method Details

    • upscaling

      public ScalingParameters.Builder upscaling()
      Sets upscaling to true. Images that are smaller than the variant configuration are scaled up.
    • cropping

      public ScalingParameters.Builder cropping()
      Sets cropping to true. The original is cropped to fill the variant dimensions. The upscaling setting is ignored, since cropping implies upscaling.
    • strategy

      Sets a scaling strategy. When not set the default ImageUtils.ScalingStrategy.QUALITY is used.
    • compressionQuality

      public ScalingParameters.Builder compressionQuality(float compressionQuality)
      Sets the compression quality. When not set the default 1 is used.
    • build

      public ScalingParameters build()