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 // Returns true on success. |pSrcBuf| will be set if this succeeds.
35 // |pSrcBuf| does not take ownership of the buffer.
36 virtual bool PngAskScanlineBuf(int line, uint8_t** pSrcBuf) = 0;
37
38 virtual void PngFillScanlineBufCompleted(int pass, int line) = 0;
39 };
40
42 Delegate* pDelegate);
43
44 static bool ContinueDecode(ProgressiveDecoderIface::Context* pContext,
45 RetainPtr<CFX_CodecMemory> codec_memory,
46 CFX_DIBAttribute* pAttribute);
47
48 PngDecoder() = delete;
49 PngDecoder(const PngDecoder&) = delete;
50 PngDecoder& operator=(const PngDecoder&) = delete;
51};
52
53} // namespace fxcodec
54
55using PngDecoder = fxcodec::PngDecoder;
56
57#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 bool PngAskScanlineBuf(int line, uint8_t **pSrcBuf)=0
virtual void PngFillScanlineBufCompleted(int pass, 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)