chromium/third_party/skia/src/codec/SkPngCodecBase.cpp

/*
 * Copyright 2024 Google LLC.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "src/codec/SkPngCodecBase.h"

#include <cstddef>
#include <utility>

#include "include/codec/SkEncodedImageFormat.h"
#include "include/core/SkAlphaType.h"
#include "include/core/SkColor.h"
#include "include/core/SkColorType.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkStream.h"
#include "include/private/SkEncodedInfo.h"
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkSpan_impl.h"
#include "modules/skcms/skcms.h"
#include "src/codec/SkCodecPriv.h"
#include "src/codec/SkColorPalette.h"
#include "src/codec/SkSwizzler.h"
#include "src/core/SkMemset.h"
#include "src/core/SkSwizzlePriv.h"

namespace {

constexpr SkColorType kXformSrcColorType =;

inline bool needs_premul(SkAlphaType dstAT, SkEncodedInfo::Alpha encodedAlpha) {}

skcms_PixelFormat ToPixelFormat(const SkEncodedInfo& info) {}

}  // namespace

SkPngCodecBase::~SkPngCodecBase() = default;

// static
bool SkPngCodecBase::isCompatibleColorProfileAndType(const SkEncodedInfo::ICCProfile* profile,
                                                     SkEncodedInfo::Color color) {}

SkPngCodecBase::SkPngCodecBase(SkEncodedInfo&& encodedInfo, std::unique_ptr<SkStream> stream)
        :{}

SkEncodedImageFormat SkPngCodecBase::onGetEncodedFormat() const {}

SkCodec::Result SkPngCodecBase::initializeXforms(const SkImageInfo& dstInfo,
                                                 const Options& options) {}

void SkPngCodecBase::initializeXformParams() {}

void SkPngCodecBase::allocateStorage(const SkImageInfo& dstInfo) {}

void SkPngCodecBase::initializeSwizzler(const SkImageInfo& dstInfo,
                                        const Options& options,
                                        bool skipFormatConversion) {}

size_t SkPngCodecBase::getEncodedInfoRowSize() {}

SkSampler* SkPngCodecBase::getSampler(bool createIfNecessary) {}

void SkPngCodecBase::applyXformRow(SkSpan<uint8_t> dstRow, SkSpan<const uint8_t> srcRow) {}

void SkPngCodecBase::applyXformRow(void* dstRow, const uint8_t* srcRow) {}

// Note: SkColorPalette claims to store SkPMColors, which is not necessarily the case here.
bool SkPngCodecBase::createColorTable(const SkImageInfo& dstInfo) {}