Enum Class Image.ResolutionLevel

java.lang.Object
java.lang.Enum<Image.ResolutionLevel>
org.schabi.newpipe.extractor.Image.ResolutionLevel
All Implemented Interfaces:
Serializable, Comparable<Image.ResolutionLevel>, Constable
Enclosing class:
Image

public static enum Image.ResolutionLevel extends Enum<Image.ResolutionLevel>
The estimated resolution level of an Image.

Some services don't return the size of their images, but we may know for a specific image type that a service returns, according to real data, an approximation of the resolution level.

  • Enum Constant Details

    • HIGH

      public static final Image.ResolutionLevel HIGH
      The high resolution level.

      This level applies to images with a height greater than or equal to 720px.

    • MEDIUM

      public static final Image.ResolutionLevel MEDIUM
      The medium resolution level.

      This level applies to images with a height between 175px inclusive and 720px exclusive.

    • LOW

      public static final Image.ResolutionLevel LOW
      The low resolution level.

      This level applies to images with a height between 1px inclusive and 175px exclusive.

    • UNKNOWN

      public static final Image.ResolutionLevel UNKNOWN
      The unknown resolution level.

      This value is returned when the extractor doesn't know what resolution level an image could have, for example if the extractor loops in an array of images with different resolution levels without knowing the height.

  • Method Details

    • values

      public static Image.ResolutionLevel[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Image.ResolutionLevel valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • fromHeight

      public static Image.ResolutionLevel fromHeight(int heightPx)
      Get a Image.ResolutionLevel based from the given height.
      Parameters:
      heightPx - the height from which returning the good Image.ResolutionLevel
      Returns:
      the Image.ResolutionLevel corresponding to the height provided. See the Image.ResolutionLevel values for details about what value is returned.