/* * 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 SkPngCodec_DEFINED #define SkPngCodec_DEFINED
class SkPngChunkReader; class SkStream; struct SkEncodedInfo; struct SkImageInfo; template <typename T> class SkSpan;
class SkPngCodec : public SkPngCodecBase { public: staticbool IsPng(constvoid*, size_t);
// Assume IsPng was called and returned true. static std::unique_ptr<SkCodec> MakeFromStream(std::unique_ptr<SkStream>, Result*,
SkPngChunkReader* = nullptr);
protected: // We hold the png_ptr and info_ptr as voidp to avoid having to include png.h // or forward declare their types here. voidp auto-casts to the real pointer types. struct voidp {
voidp(void* ptr) : fPtr(ptr) {}
/** * Pass available input to libpng to process it. * * libpng will call any relevant callbacks installed. This will continue decoding * until it reaches the end of the file, or until a callback tells libpng to stop.
*/ bool processData();
Result onStartIncrementalDecode(const SkImageInfo& dstInfo, void* pixels, size_t rowBytes, const SkCodec::Options&) override;
Result onIncrementalDecode(int*) override;
// Thin wrapper around `SkPngCodecBase::initializeXforms` that also sets up // some `libpng`-specific state.
Result initializeXforms(const SkImageInfo& dstInfo, const Options&);
void destroyReadStruct();
virtual Result decodeAllRows(void* dst, size_t rowBytes, int* rowsDecoded) = 0; virtualvoid setRange(int firstRow, int lastRow, void* dst, size_t rowBytes) = 0; virtual Result decode(int* rowsDecoded) = 0;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.