#include "services/media_session/public/cpp/media_image_manager.h"
#include <algorithm>
#include "base/containers/span.h"
#include "base/hash/hash.h"
#include "base/strings/string_util.h"
#include "ui/gfx/geometry/size.h"
namespace media_session {
namespace {
const double kDefaultImageSizeScore = …;
const double kDefaultTypeScore = …;
const double kPNGTypeScore = …;
const double kJPEGTypeScore = …;
const double kBMPTypeScore = …;
const double kXIconTypeScore = …;
const double kGIFTypeScore = …;
double GetImageAspectRatioScore(const gfx::Size& size) { … }
std::string GetExtension(const std::string& path) { … }
double GetImageDominantSizeScore(int min_size,
int ideal_size,
const gfx::Size& size) { … }
}
double MediaImageManager::GetImageSizeScore(int min_size,
int ideal_size,
const gfx::Size& size) { … }
MediaImageManager::MediaImageManager(int min_size, int ideal_size)
: … { … }
MediaImageManager::~MediaImageManager() = default;
std::optional<MediaImage> MediaImageManager::SelectImage(
const std::vector<MediaImage>& images) { … }
double MediaImageManager::GetImageScore(const MediaImage& image) const { … }
std::optional<double> MediaImageManager::GetImageExtensionScore(
const GURL& url) { … }
std::optional<double> MediaImageManager::GetImageTypeScore(
const std::u16string& type) { … }
}