#include "ui/gfx/codec/jpeg_codec.h"
#include <climits>
#include <memory>
#include "base/notreached.h"
#include "third_party/skia/include/codec/SkJpegDecoder.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkColorPriv.h"
#include "third_party/skia/include/core/SkImageInfo.h"
#include "third_party/skia/include/encode/SkJpegEncoder.h"
#include "ui/gfx/codec/vector_wstream.h"
namespace gfx {
bool JPEGCodec::Encode(const SkPixmap& input,
int quality,
SkJpegEncoder::Downsample downsample,
std::vector<unsigned char>* output,
const SkData* xmp_metadata) { … }
bool JPEGCodec::Encode(const SkPixmap& input,
int quality,
std::vector<unsigned char>* output) { … }
bool JPEGCodec::Encode(const SkBitmap& src,
int quality,
std::vector<unsigned char>* output) { … }
static bool PrepareForJPEGDecode(const unsigned char* input,
size_t input_size,
SkColorType color_type,
std::unique_ptr<SkCodec>* codec,
SkImageInfo* image_info) { … }
bool JPEGCodec::Decode(const unsigned char* input,
size_t input_size,
SkColorType color_type,
std::vector<unsigned char>* output,
int* w,
int* h) { … }
std::unique_ptr<SkBitmap> JPEGCodec::Decode(const unsigned char* input,
size_t input_size) { … }
}