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

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

#include "src/codec/SkBmpCodec.h"

#include "include/codec/SkBmpDecoder.h"
#include "include/core/SkData.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkSize.h"
#include "include/core/SkStream.h"
#include "include/private/SkEncodedInfo.h"
#include "include/private/base/SkAlign.h"
#include "src/codec/SkBmpMaskCodec.h"
#include "src/codec/SkBmpRLECodec.h"
#include "src/codec/SkBmpStandardCodec.h"
#include "src/codec/SkCodecPriv.h"
#include "src/core/SkMasks.h"

#include <cstring>
#include <memory>
#include <utility>

/*
 * Defines the version and type of the second bitmap header
 */
enum BmpHeaderType {};

/*
 * Possible bitmap compression types
 */
enum BmpCompressionMethod {};

/*
 * Used to define the input format of the bmp
 */
enum BmpInputFormat {};

/*
 * Checks the start of the stream to see if the image is a bitmap
 */
bool SkBmpCodec::IsBmp(const void* buffer, size_t bytesRead) {}

/*
 * Assumes IsBmp was called and returned true
 * Creates a bmp decoder
 * Reads enough of the stream to determine the image format
 */
std::unique_ptr<SkCodec> SkBmpCodec::MakeFromStream(std::unique_ptr<SkStream> stream,
                                                    Result* result) {}

/*
 * Creates a bmp decoder for a bmp embedded in ico
 * Reads enough of the stream to determine the image format
 */
std::unique_ptr<SkCodec> SkBmpCodec::MakeFromIco(std::unique_ptr<SkStream> stream, Result* result) {}

// Header size constants
static constexpr uint32_t kBmpHeaderBytes =;
static constexpr uint32_t kBmpHeaderBytesPlusFour =;
static constexpr uint32_t kBmpOS2V1Bytes =;
static constexpr uint32_t kBmpOS2V2Bytes =;
static constexpr uint32_t kBmpInfoBaseBytes =;
static constexpr uint32_t kBmpInfoV1Bytes =;
static constexpr uint32_t kBmpInfoV2Bytes =;
static constexpr uint32_t kBmpInfoV3Bytes =;
static constexpr uint32_t kBmpInfoV4Bytes =;
static constexpr uint32_t kBmpInfoV5Bytes =;
static constexpr uint32_t kBmpMaskBytes =;

static BmpHeaderType get_header_type(size_t infoBytes) {}

SkCodec::Result SkBmpCodec::ReadHeader(SkStream* stream, bool inIco,
        std::unique_ptr<SkCodec>* codecOut) {}

/*
 * Creates a bmp decoder
 * Reads enough of the stream to determine the image format
 */
std::unique_ptr<SkCodec> SkBmpCodec::MakeFromStream(std::unique_ptr<SkStream> stream,
                                                    Result* result, bool inIco) {}

SkBmpCodec::SkBmpCodec(SkEncodedInfo&& info, std::unique_ptr<SkStream> stream,
        uint16_t bitsPerPixel, SkCodec::SkScanlineOrder rowOrder)
    :{}

bool SkBmpCodec::onRewind() {}

int32_t SkBmpCodec::getDstRow(int32_t y, int32_t height) const {}

SkCodec::Result SkBmpCodec::prepareToDecode(const SkImageInfo& dstInfo,
        const SkCodec::Options& options) {}

SkCodec::Result SkBmpCodec::onStartScanlineDecode(const SkImageInfo& dstInfo,
        const SkCodec::Options& options) {}

int SkBmpCodec::onGetScanlines(void* dst, int count, size_t rowBytes) {}

bool SkBmpCodec::skipRows(int count) {}

bool SkBmpCodec::onSkipScanlines(int count) {}

namespace SkBmpDecoder {
bool IsBmp(const void* data, size_t len) {}

std::unique_ptr<SkCodec> Decode(std::unique_ptr<SkStream> stream,
                                SkCodec::Result* outResult,
                                SkCodecs::DecodeContext) {}

std::unique_ptr<SkCodec> Decode(sk_sp<SkData> data,
                                SkCodec::Result* outResult,
                                SkCodecs::DecodeContext) {}
}  // namespace SkBmpDecoder