#include "include/codec/SkCodec.h"
#include "include/codec/SkCodecAnimation.h"
#include "include/codec/SkPixmapUtils.h"
#include "include/core/SkAlphaType.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkColorPriv.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkColorType.h"
#include "include/core/SkData.h"
#include "include/core/SkImage.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkStream.h"
#include "include/private/base/SkTemplates.h"
#include "modules/skcms/skcms.h"
#include "src/base/SkNoDestructor.h"
#include "src/codec/SkCodecPriv.h"
#include "src/codec/SkFrameHolder.h"
#include "src/codec/SkPixmapUtilsPriv.h"
#include "src/codec/SkSampler.h"
#include <string>
#include <string_view>
#include <utility>
#if !defined(SK_DISABLE_LEGACY_INIT_DECODERS)
#include "include/private/base/SkOnce.h"
#if defined(SK_CODEC_DECODES_AVIF)
#include "include/codec/SkAvifDecoder.h"
#endif
#if defined(SK_CODEC_DECODES_BMP)
#include "include/codec/SkBmpDecoder.h"
#endif
#if defined(SK_CODEC_DECODES_GIF) || defined(SK_HAS_WUFFS_LIBRARY)
#include "include/codec/SkGifDecoder.h"
#endif
#if defined(SK_HAS_HEIF_LIBRARY)
#include "include/android/SkHeifDecoder.h"
#endif
#if defined(SK_CODEC_DECODES_ICO)
#include "include/codec/SkIcoDecoder.h"
#endif
#if defined(SK_CODEC_DECODES_JPEG)
#include "include/codec/SkJpegDecoder.h"
#endif
#if defined(SK_CODEC_DECODES_JPEGXL)
#include "include/codec/SkJpegxlDecoder.h"
#endif
#if defined(SK_CODEC_DECODES_PNG)
#include "include/codec/SkPngDecoder.h"
#endif
#if defined(SK_CODEC_DECODES_RAW)
#include "include/codec/SkRawDecoder.h"
#endif
#if defined(SK_CODEC_DECODES_WBMP)
#include "include/codec/SkWbmpDecoder.h"
#endif
#if defined(SK_CODEC_DECODES_WEBP)
#include "include/codec/SkWebpDecoder.h"
#endif
#endif
namespace SkCodecs {
static std::vector<Decoder>* get_decoders_for_editing() { … }
const std::vector<Decoder>& get_decoders() { … }
void Register(Decoder d) { … }
bool HasDecoder(std::string_view id) { … }
}
std::unique_ptr<SkCodec> SkCodec::MakeFromStream(
std::unique_ptr<SkStream> stream, Result* outResult,
SkPngChunkReader* chunkReader, SelectionPolicy selectionPolicy) { … }
std::unique_ptr<SkCodec> SkCodec::MakeFromStream(
std::unique_ptr<SkStream> stream, SkSpan<const SkCodecs::Decoder> decoders,
Result* outResult, SkPngChunkReader* chunkReader, SelectionPolicy selectionPolicy) { … }
std::unique_ptr<SkCodec> SkCodec::MakeFromData(sk_sp<SkData> data, SkPngChunkReader* reader) { … }
std::unique_ptr<SkCodec> SkCodec::MakeFromData(sk_sp<SkData> data,
SkSpan<const SkCodecs::Decoder> decoders,
SkPngChunkReader* reader) { … }
SkCodec::SkCodec(SkEncodedInfo&& info,
XformFormat srcFormat,
std::unique_ptr<SkStream> stream,
SkEncodedOrigin origin)
: … { … }
SkCodec::~SkCodec() { … }
void SkCodec::setSrcXformFormat(XformFormat pixelFormat) { … }
bool SkCodec::queryYUVAInfo(const SkYUVAPixmapInfo::SupportedDataTypes& supportedDataTypes,
SkYUVAPixmapInfo* yuvaPixmapInfo) const { … }
SkCodec::Result SkCodec::getYUVAPlanes(const SkYUVAPixmaps& yuvaPixmaps) { … }
bool SkCodec::conversionSupported(const SkImageInfo& dst, bool srcIsOpaque, bool needsColorXform) { … }
bool SkCodec::rewindIfNeeded() { … }
static SkIRect frame_rect_on_screen(SkIRect frameRect,
const SkIRect& screenRect) { … }
bool zero_rect(const SkImageInfo& dstInfo, void* pixels, size_t rowBytes,
SkISize srcDimensions, SkIRect prevRect) { … }
SkCodec::Result SkCodec::handleFrameIndex(const SkImageInfo& info, void* pixels, size_t rowBytes,
const Options& options, GetPixelsCallback getPixelsFn) { … }
SkCodec::Result SkCodec::getPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,
const Options* options) { … }
std::tuple<sk_sp<SkImage>, SkCodec::Result> SkCodec::getImage(const SkImageInfo& info,
const Options* options) { … }
std::tuple<sk_sp<SkImage>, SkCodec::Result> SkCodec::getImage() { … }
SkCodec::Result SkCodec::startIncrementalDecode(const SkImageInfo& info, void* pixels,
size_t rowBytes, const SkCodec::Options* options) { … }
SkCodec::Result SkCodec::startScanlineDecode(const SkImageInfo& info,
const SkCodec::Options* options) { … }
int SkCodec::getScanlines(void* dst, int countLines, size_t rowBytes) { … }
bool SkCodec::skipScanlines(int countLines) { … }
int SkCodec::outputScanline(int inputScanline) const { … }
int SkCodec::onOutputScanline(int inputScanline) const { … }
void SkCodec::fillIncompleteImage(const SkImageInfo& info, void* dst, size_t rowBytes,
ZeroInitialized zeroInit, int linesRequested, int linesDecoded) { … }
bool sk_select_xform_format(SkColorType colorType, bool forColorTable,
skcms_PixelFormat* outFormat) { … }
bool SkCodec::initializeColorXform(const SkImageInfo& dstInfo, SkEncodedInfo::Alpha encodedAlpha,
bool srcIsOpaque) { … }
void SkCodec::applyColorXform(void* dst, const void* src, int count) const { … }
std::vector<SkCodec::FrameInfo> SkCodec::getFrameInfo() { … }
const char* SkCodec::ResultToString(Result result) { … }
void SkFrame::fillIn(SkCodec::FrameInfo* frameInfo, bool fullyReceived) const { … }
static bool independent(const SkFrame& frame) { … }
static bool restore_bg(const SkFrame& frame) { … }
void SkFrameHolder::setAlphaAndRequiredFrame(SkFrame* frame) { … }
std::unique_ptr<SkStream> SkCodec::getEncodedData() const { … }