Class Resolution


  • public class Resolution
    extends java.lang.Object
    The resolution defines the spatial dot density, e.g. of images.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      double xDpi
      Horizontal resolution in DPI (dots per inch)
      double yDpi
      Vertical resolution in DPI (dots per inch)
    • Constructor Summary

      Constructors 
      Constructor Description
      Resolution​(double dpi)  
      Resolution​(double xDpi, double yDpi)  
    • Field Detail

      • xDpi

        public double xDpi

        Horizontal resolution in DPI (dots per inch)

      • yDpi

        public double yDpi

        Vertical resolution in DPI (dots per inch)

    • Constructor Detail

      • Resolution

        public Resolution​(double xDpi,
                          double yDpi)
      • Resolution

        public Resolution​(double dpi)
    • Method Detail

      • getXDpi

        public double getXDpi()
        Gets xDpi
      • setXDpi

        public void setXDpi​(double xDpi)
        Sets xDpi
      • getYDpi

        public double getYDpi()
        Gets yDpi
      • setYDpi

        public void setYDpi​(double yDpi)
        Sets yDpi
      • calculateSize

        public Size calculateSize​(Size pixels)
        Calculate the physical size of an object, e.g. an image, at that resolution.
        Parameters:
        pixels - The size of the image in pixels
        Returns:
        The physical size
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object