Class ContextBasedScaleProvider

  • All Implemented Interfaces:
    com.applitools.eyes.ScaleProvider

    public class ContextBasedScaleProvider
    extends Object
    implements com.applitools.eyes.ScaleProvider
    • Constructor Detail

      • ContextBasedScaleProvider

        public ContextBasedScaleProvider​(com.applitools.eyes.Logger logger,
                                         com.applitools.eyes.RectangleSize topLevelContextEntireSize,
                                         com.applitools.eyes.RectangleSize viewportSize,
                                         double devicePixelRatio,
                                         boolean isMobileDevice)
        Parameters:
        topLevelContextEntireSize - The total size of the top level context. E.g., for selenium this would be the document size of the top level frame.
        viewportSize - The viewport size.
        devicePixelRatio - The device pixel ratio of the platform on which the application is running.
        logger - the logger.
        isMobileDevice - is mobile device.
    • Method Detail

      • getScaleRatio

        public double getScaleRatio()
        Specified by:
        getScaleRatio in interface com.applitools.eyes.ScaleProvider
      • updateScaleRatio

        public void updateScaleRatio​(int imageToScaleWidth)
        Set the scale ratio based on the given image.
        Parameters:
        imageToScaleWidth - The width of the image to scale, used for calculating the scale ratio.