Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
jpeg_progressive_decoder.h
Go to the documentation of this file.
1// Copyright 2020 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#ifndef CORE_FXCODEC_JPEG_JPEG_PROGRESSIVE_DECODER_H_
8#define CORE_FXCODEC_JPEG_JPEG_PROGRESSIVE_DECODER_H_
9
10#include <setjmp.h>
11
12#include <memory>
13
14#include "core/fxcodec/progressive_decoder_iface.h"
15
16namespace fxcodec {
17
18class CFX_DIBAttribute;
19
20class JpegProgressiveDecoder final : public ProgressiveDecoderIface {
21 public:
22 static void InitializeGlobals();
23 static void DestroyGlobals();
24
25 static JpegProgressiveDecoder* GetInstance();
26
27 static std::unique_ptr<Context> Start();
28
29 static jmp_buf& GetJumpMark(Context* pContext);
30
31 static int ReadHeader(Context* pContext,
32 int* width,
33 int* height,
34 int* nComps,
35 CFX_DIBAttribute* pAttribute);
36
37 static bool StartScanline(Context* pContext, int down_scale);
38 static bool ReadScanline(Context* pContext, uint8_t* dest_buf);
39
40 // ProgressiveDecoderIface:
41 FX_FILESIZE GetAvailInput(Context* pContext) const override;
42 bool Input(Context* pContext,
43 RetainPtr<CFX_CodecMemory> codec_memory) override;
44
45 private:
46 JpegProgressiveDecoder();
48};
49
50} // namespace fxcodec
51
52using JpegProgressiveDecoder = fxcodec::JpegProgressiveDecoder;
53
54#endif // CORE_FXCODEC_JPEG_JPEG_PROGRESSIVE_DECODER_H_
jpeg_decompress_struct m_Info
static bool ReadScanline(Context *pContext, uint8_t *dest_buf)
static jmp_buf & GetJumpMark(Context *pContext)
static int ReadHeader(Context *pContext, int *width, int *height, int *nComps, CFX_DIBAttribute *pAttribute)
static JpegProgressiveDecoder * GetInstance()
static std::unique_ptr< Context > Start()
FX_FILESIZE GetAvailInput(Context *pContext) const override
bool Input(Context *pContext, RetainPtr< CFX_CodecMemory > codec_memory) override
static bool StartScanline(Context *pContext, int down_scale)
#define FX_FILESIZE
Definition fx_types.h:19
static void JpegLoadAttribute(const jpeg_decompress_struct &info, CFX_DIBAttribute *pAttribute)
static void src_skip_data(jpeg_decompress_struct *cinfo, long num)
static void error_fatal(j_common_ptr cinfo)
#define CHECK(cvref)