blob: 97d3f287c66d7670f4fec135a651e41e9130f26b [file]
// Copyright 2020 The PDFium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#ifndef CORE_FXCODEC_JPEG_JPEG_PROGRESSIVE_DECODER_H_
#define CORE_FXCODEC_JPEG_JPEG_PROGRESSIVE_DECODER_H_
#include <stdint.h>
namespace fxcodec {
class CFX_DIBAttribute;
class ProgressiveDecoderContext;
class JpegProgressiveDecoder {
public:
// Result codes for ReadHeader()/ReadScanline():
static constexpr int kFatal = -1;
static constexpr int kOk = 0;
static constexpr int kError = 1;
static constexpr int kNeedsMoreInput = 2;
static int ReadHeader(ProgressiveDecoderContext* context,
int* width,
int* height,
int* nComps,
CFX_DIBAttribute* pAttribute);
static bool StartScanline(ProgressiveDecoderContext* context);
static int ReadScanline(ProgressiveDecoderContext* context,
uint8_t* dest_buf);
// Only `static` methods.
JpegProgressiveDecoder() = delete;
JpegProgressiveDecoder(const JpegProgressiveDecoder&) = delete;
JpegProgressiveDecoder& operator=(const JpegProgressiveDecoder&) = delete;
};
} // namespace fxcodec
using JpegProgressiveDecoder = fxcodec::JpegProgressiveDecoder;
#endif // CORE_FXCODEC_JPEG_JPEG_PROGRESSIVE_DECODER_H_