blob: b9c9d3c129bb78a34452cbc96918eac11ed7ec86 [file] [log] [blame]
* Copyright 2015 Google Inc.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
#ifndef SkCodecImageGenerator_DEFINED
#define SkCodecImageGenerator_DEFINED
#include "SkCodec.h"
#include "SkData.h"
#include "SkImageGenerator.h"
class SkCodecImageGenerator : public SkImageGenerator {
* If this data represents an encoded image that we know how to decode,
* return an SkCodecImageGenerator. Otherwise return nullptr.
static std::unique_ptr<SkImageGenerator> MakeFromEncodedCodec(sk_sp<SkData>);
sk_sp<SkData> onRefEncodedData() override;
bool onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, const Options& opts)
bool onQueryYUV8(SkYUVSizeInfo*, SkYUVColorSpace*) const override;
bool onGetYUV8Planes(const SkYUVSizeInfo&, void* planes[3]) override;
* Takes ownership of codec
SkCodecImageGenerator(std::unique_ptr<SkCodec>, sk_sp<SkData>);
std::unique_ptr<SkCodec> fCodec;
sk_sp<SkData> fData;
typedef SkImageGenerator INHERITED;
#endif // SkCodecImageGenerator_DEFINED