Package org.schabi.newpipe.extractor
Enum Image.ResolutionLevel
- java.lang.Object
-
- java.lang.Enum<Image.ResolutionLevel>
-
- org.schabi.newpipe.extractor.Image.ResolutionLevel
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Image.ResolutionLevel>
- Enclosing class:
- Image
public static enum Image.ResolutionLevel extends java.lang.Enum<Image.ResolutionLevel>
The estimated resolution level of anImage
.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.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Image.ResolutionLevel
fromHeight(int heightPx)
Get aImage.ResolutionLevel
based from the given height.static Image.ResolutionLevel
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static Image.ResolutionLevel[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
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 Detail
-
values
public static Image.ResolutionLevel[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Image.ResolutionLevel c : Image.ResolutionLevel.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Image.ResolutionLevel valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
fromHeight
public static Image.ResolutionLevel fromHeight(int heightPx)
Get aImage.ResolutionLevel
based from the given height.- Parameters:
heightPx
- the height from which returning the goodImage.ResolutionLevel
- Returns:
- the
Image.ResolutionLevel
corresponding to the height provided. See theImage.ResolutionLevel
values for details about what value is returned.
-
-