2021-03-02 00:27:36 +00:00
|
|
|
package models
|
|
|
|
|
2021-08-02 03:22:39 +00:00
|
|
|
type ResolutionRange struct {
|
|
|
|
min, max int
|
|
|
|
}
|
|
|
|
|
|
|
|
var resolutionRanges = map[ResolutionEnum]ResolutionRange{
|
|
|
|
ResolutionEnum("VERY_LOW"): {144, 239},
|
|
|
|
ResolutionEnum("LOW"): {240, 359},
|
|
|
|
ResolutionEnum("R360P"): {360, 479},
|
|
|
|
ResolutionEnum("STANDARD"): {480, 539},
|
|
|
|
ResolutionEnum("WEB_HD"): {540, 719},
|
|
|
|
ResolutionEnum("STANDARD_HD"): {720, 1079},
|
|
|
|
ResolutionEnum("FULL_HD"): {1080, 1439},
|
|
|
|
ResolutionEnum("QUAD_HD"): {1440, 1919},
|
|
|
|
ResolutionEnum("VR_HD"): {1920, 2159},
|
|
|
|
ResolutionEnum("FOUR_K"): {2160, 2879},
|
|
|
|
ResolutionEnum("FIVE_K"): {2880, 3383},
|
|
|
|
ResolutionEnum("SIX_K"): {3384, 4319},
|
|
|
|
ResolutionEnum("EIGHT_K"): {4320, 8639},
|
2021-03-02 00:27:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// GetMaxResolution returns the maximum width or height that media must be
|
2021-08-02 03:22:39 +00:00
|
|
|
// to qualify as this resolution.
|
2021-03-02 00:27:36 +00:00
|
|
|
func (r *ResolutionEnum) GetMaxResolution() int {
|
2021-08-02 03:22:39 +00:00
|
|
|
return resolutionRanges[*r].max
|
2021-03-02 00:27:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// GetMinResolution returns the minimum width or height that media must be
|
|
|
|
// to qualify as this resolution.
|
|
|
|
func (r *ResolutionEnum) GetMinResolution() int {
|
2021-08-02 03:22:39 +00:00
|
|
|
return resolutionRanges[*r].min
|
2021-03-02 00:27:36 +00:00
|
|
|
}
|