#include "services/image_annotation/public/cpp/image_processor.h"
#include "base/functional/bind.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/thread_pool.h"
#include "services/image_annotation/image_annotation_metrics.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkImage.h"
#include "ui/gfx/codec/jpeg_codec.h"
namespace image_annotation {
namespace {
SkBitmap ScaleImage(const SkBitmap& source, const float scale) { … }
void ScaleAndEncodeImage(scoped_refptr<base::SequencedTaskRunner> task_runner,
ImageProcessor::GetJpgImageDataCallback callback,
const SkBitmap& image,
const int max_pixels,
const int jpg_quality) { … }
}
constexpr int ImageProcessor::kMaxPixels;
constexpr int ImageProcessor::kJpgQuality;
ImageProcessor::ImageProcessor(base::RepeatingCallback<SkBitmap()> get_pixels)
: … { … }
ImageProcessor::~ImageProcessor() = default;
mojo::PendingRemote<mojom::ImageProcessor> ImageProcessor::GetPendingRemote() { … }
void ImageProcessor::GetJpgImageData(GetJpgImageDataCallback callback) { … }
}