#include "pdf/ui/thumbnail.h"
#include <stddef.h>
#include <algorithm>
#include <cmath>
#include <utility>
#include "base/check.h"
#include "base/check_op.h"
#include "base/numerics/checked_math.h"
#include "base/values.h"
#include "ui/gfx/geometry/size.h"
namespace chrome_pdf {
namespace {
constexpr float kMinDevicePixelRatio = …;
constexpr float kMaxDevicePixelRatio = …;
constexpr int kImageColorChannels = …;
constexpr int kMaxThumbnailPixels = …;
constexpr int kMaxWidthPortraitPx = …;
constexpr int kMaxWidthLandscapePx = …;
constexpr int kPdfPageMinDimension = …;
constexpr int kPdfPageMaxDimension = …;
constexpr int kPdfMaxAspectRatio = …;
gfx::Size LimitAspectRatio(gfx::Size page_size) { … }
gfx::Size CalculateBestFitSize(const gfx::Size& page_size,
float device_pixel_ratio) { … }
int CalculateStride(int width) { … }
size_t CalculateImageDataSize(int stride, int height) { … }
}
Thumbnail::Thumbnail(const gfx::Size& page_size, float device_pixel_ratio)
: … { … }
Thumbnail::Thumbnail(Thumbnail&& other) noexcept = default;
Thumbnail& Thumbnail::operator=(Thumbnail&& other) noexcept = default;
Thumbnail::~Thumbnail() = default;
base::Value::BlobStorage& Thumbnail::GetImageData() { … }
base::Value::BlobStorage Thumbnail::TakeData() { … }
}