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
png_decoder.h
Go to the documentation of this file.
1// Copyright 2016 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_PNG_PNG_DECODER_H_
8#define CORE_FXCODEC_PNG_PNG_DECODER_H_
9
10#include <memory>
11
12#include "core/fxcodec/progressive_decoder_iface.h"
13#include "core/fxcrt/retain_ptr.h"
14
15#ifndef PDF_ENABLE_XFA_PNG
16#error "PNG must be enabled"
17#endif
18
19namespace fxcodec {
20
21class CFX_DIBAttribute;
22
24 public:
25 class Delegate {
26 public:
27 virtual bool PngReadHeader(int width,
28 int height,
29 int bpc,
30 int pass,
31 int* color_type,
32 double* gamma) = 0;
33
34 // `line` must be within [0, height].
35 virtual uint8_t* PngAskScanlineBuf(int line) = 0;
36
37 virtual void PngFillScanlineBufCompleted(int pass, int line) = 0;
38 };
39
41 Delegate* pDelegate);
42
43 static bool ContinueDecode(ProgressiveDecoderIface::Context* pContext,
44 RetainPtr<CFX_CodecMemory> codec_memory,
45 CFX_DIBAttribute* pAttribute);
46
47 PngDecoder() = delete;
48 PngDecoder(const PngDecoder&) = delete;
49 PngDecoder& operator=(const PngDecoder&) = delete;
50};
51
52} // namespace fxcodec
53
55
56#endif // CORE_FXCODEC_PNG_PNG_DECODER_H_
CPngContext(PngDecoder::Delegate *pDelegate)
~CPngContext() override
char m_szLastError[PNG_ERROR_SIZE]
png_infop m_pInfo
png_structp m_pPng
UnownedPtr< PngDecoder::Delegate > const m_pDelegate
virtual void PngFillScanlineBufCompleted(int pass, int line)=0
virtual uint8_t * PngAskScanlineBuf(int line)=0
virtual bool PngReadHeader(int width, int height, int bpc, int pass, int *color_type, double *gamma)=0
static bool ContinueDecode(ProgressiveDecoderIface::Context *pContext, RetainPtr< CFX_CodecMemory > codec_memory, CFX_DIBAttribute *pAttribute)
PngDecoder(const PngDecoder &)=delete
static std::unique_ptr< ProgressiveDecoderIface::Context > StartDecode(Delegate *pDelegate)
PngDecoder & operator=(const PngDecoder &)=delete
void _png_get_header_func(png_structp png_ptr, png_infop info_ptr)
void _png_warning_data(png_structp png_ptr, png_const_charp error_msg)
void _png_error_data(png_structp png_ptr, png_const_charp error_msg)
void _png_load_bmp_attribute(png_structp png_ptr, png_infop info_ptr, CFX_DIBAttribute *pAttribute)
void _png_get_row_func(png_structp png_ptr, png_bytep new_row, png_uint_32 row_num, int pass)
#define PNG_ERROR_SIZE
void _png_get_end_func(png_structp png_ptr, png_infop info_ptr)
fxcodec::PngDecoder PngDecoder
Definition png_decoder.h:54
#define CHECK(cvref)