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
image_diff_png.h
Go to the documentation of this file.
1// Copyright 2013 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#ifndef TESTING_IMAGE_DIFF_IMAGE_DIFF_PNG_H_
6#define TESTING_IMAGE_DIFF_IMAGE_DIFF_PNG_H_
7
8#include <stdlib.h> // for size_t.
9
10#include <vector>
11
12#include "third_party/base/containers/span.h"
13
14namespace image_diff_png {
15
16// Decode a PNG into an RGBA pixel array, or BGRA pixel array if
17// |reverse_byte_order| is set to true.
18std::vector<uint8_t> DecodePNG(pdfium::span<const uint8_t> input,
19 bool reverse_byte_order,
20 int* width,
21 int* height);
22
23// Encode a BGR pixel array into a PNG.
24std::vector<uint8_t> EncodeBGRPNG(pdfium::span<const uint8_t> input,
25 int width,
26 int height,
27 int row_byte_width);
28
29// Encode an RGBA pixel array into a PNG.
30std::vector<uint8_t> EncodeRGBAPNG(pdfium::span<const uint8_t> input,
31 int width,
32 int height,
33 int row_byte_width);
34
35// Encode an BGRA pixel array into a PNG.
36std::vector<uint8_t> EncodeBGRAPNG(pdfium::span<const uint8_t> input,
37 int width,
38 int height,
39 int row_byte_width,
40 bool discard_transparency);
41
42// Encode a grayscale pixel array into a PNG.
43std::vector<uint8_t> EncodeGrayPNG(pdfium::span<const uint8_t> input,
44 int width,
45 int height,
46 int row_byte_width);
47
48} // namespace image_diff_png
49
50#endif // TESTING_IMAGE_DIFF_IMAGE_DIFF_PNG_H_
#define FPDF_ANNOT_FILEATTACHMENT
Definition fpdf_annot.h:37
#define FPDF_ANNOT_RICHMEDIA
Definition fpdf_annot.h:46
#define FPDF_ANNOT_STAMP
Definition fpdf_annot.h:33
#define FPDF_ANNOT_FLAG_INVISIBLE
Definition fpdf_annot.h:52
#define FPDF_ANNOT_MOVIE
Definition fpdf_annot.h:39
#define FPDF_ANNOT_FLAG_NOROTATE
Definition fpdf_annot.h:56
#define FPDF_ANNOT_FLAG_NOZOOM
Definition fpdf_annot.h:55
#define FPDF_ANNOT_FLAG_HIDDEN
Definition fpdf_annot.h:53
#define FPDF_ANNOT_FLAG_PRINT
Definition fpdf_annot.h:54
#define FPDF_ANNOT_THREED
Definition fpdf_annot.h:45
#define FPDF_ANNOT_STRIKEOUT
Definition fpdf_annot.h:32
#define FPDF_ANNOT_UNDERLINE
Definition fpdf_annot.h:30
#define FPDF_ANNOT_LINE
Definition fpdf_annot.h:24
#define FPDF_ANNOT_SCREEN
Definition fpdf_annot.h:41
#define FPDF_ANNOT_FLAG_READONLY
Definition fpdf_annot.h:58
FPDF_EXPORT int FPDF_CALLCONV FPDFPage_GetAnnotCount(FPDF_PAGE page)
#define FPDF_ANNOT_WATERMARK
Definition fpdf_annot.h:44
#define FPDF_ANNOT_XFAWIDGET
Definition fpdf_annot.h:47
#define FPDF_ANNOT_WIDGET
Definition fpdf_annot.h:40
#define FPDF_ANNOT_HIGHLIGHT
Definition fpdf_annot.h:29
#define FPDF_ANNOT_TRAPNET
Definition fpdf_annot.h:43
#define FPDF_ANNOT_SQUIGGLY
Definition fpdf_annot.h:31
#define FPDF_ANNOT_SOUND
Definition fpdf_annot.h:38
#define FPDF_ANNOT_INK
Definition fpdf_annot.h:35
#define FPDF_ANNOT_FLAG_LOCKED
Definition fpdf_annot.h:59
#define FPDF_ANNOT_SQUARE
Definition fpdf_annot.h:25
#define FPDF_ANNOT_FREETEXT
Definition fpdf_annot.h:23
#define FPDF_ANNOT_FLAG_NOVIEW
Definition fpdf_annot.h:57
#define FPDF_ANNOT_POLYGON
Definition fpdf_annot.h:27
#define FPDF_ANNOT_CARET
Definition fpdf_annot.h:34
#define FPDF_ANNOT_POPUP
Definition fpdf_annot.h:36
@ FPDFANNOT_COLORTYPE_InteriorColor
Definition fpdf_annot.h:97
@ FPDFANNOT_COLORTYPE_Color
Definition fpdf_annot.h:96
#define FPDF_ANNOT_FLAG_TOGGLENOVIEW
Definition fpdf_annot.h:60
#define FPDF_ANNOT_CIRCLE
Definition fpdf_annot.h:26
#define FPDF_ANNOT_TEXT
Definition fpdf_annot.h:21
#define FPDF_ANNOT_PRINTERMARK
Definition fpdf_annot.h:42
#define FPDF_ANNOT_LINK
Definition fpdf_annot.h:22
#define FPDF_ANNOT_POLYLINE
Definition fpdf_annot.h:28
FPDF_EXPORT int FPDF_CALLCONV FPDFDoc_GetAttachmentCount(FPDF_DOCUMENT document)
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFAttachment_GetName(FPDF_ATTACHMENT attachment, FPDF_WCHAR *buffer, unsigned long buflen)
FPDF_EXPORT FPDF_ATTACHMENT FPDF_CALLCONV FPDFDoc_GetAttachment(FPDF_DOCUMENT document, int index)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAttachment_GetFile(FPDF_ATTACHMENT attachment, void *buffer, unsigned long buflen, unsigned long *out_buflen)
FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDFPage_GetObject(FPDF_PAGE page, int index)
FPDF_EXPORT int FPDF_CALLCONV FPDFPageObj_GetType(FPDF_PAGEOBJECT page_object)
#define FPDF_PAGEOBJ_PATH
Definition fpdf_edit.h:40
#define FPDF_PAGEOBJ_TEXT
Definition fpdf_edit.h:39
#define FPDF_PAGEOBJ_SHADING
Definition fpdf_edit.h:42
#define FPDF_PAGEOBJ_IMAGE
Definition fpdf_edit.h:41
#define FPDF_PAGEOBJ_FORM
Definition fpdf_edit.h:43
FPDF_EXPORT int FPDF_CALLCONV FPDFPage_CountObjects(FPDF_PAGE page)
FPDF_EXPORT int FPDF_CALLCONV FPDFText_CountChars(FPDF_TEXTPAGE text_page)
Definition fpdf_text.cpp:59
FPDF_EXPORT unsigned int FPDF_CALLCONV FPDFText_GetUnicode(FPDF_TEXTPAGE text_page, int index)
Definition fpdf_text.cpp:65
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFPage_GetRawThumbnailData(FPDF_PAGE page, void *buffer, unsigned long buflen)
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFPage_GetDecodedThumbnailData(FPDF_PAGE page, void *buffer, unsigned long buflen)
#define FPDFBitmap_BGR
Definition fpdfview.h:1100
#define FPDFBitmap_BGRx
Definition fpdfview.h:1102
#define FPDFBitmap_BGRA
Definition fpdfview.h:1104
#define FPDFBitmap_Unknown
Definition fpdfview.h:1096
#define FPDFBitmap_Gray
Definition fpdfview.h:1098
std::vector< uint8_t > EncodeGrayPNG(pdfium::span< const uint8_t > input, int width, int height, int row_byte_width)
std::vector< uint8_t > DecodePNG(pdfium::span< const uint8_t > input, bool reverse_byte_order, int *width, int *height)
std::vector< uint8_t > EncodeBGRPNG(pdfium::span< const uint8_t > input, int width, int height, int row_byte_width)
std::vector< uint8_t > EncodeRGBAPNG(pdfium::span< const uint8_t > input, int width, int height, int row_byte_width)
std::vector< uint8_t > EncodeBGRAPNG(pdfium::span< const uint8_t > input, int width, int height, int row_byte_width, bool discard_transparency)
bool GetThumbnailFilename(char *name_buf, size_t name_buf_size, const char *pdf_name, int page_num, ThumbnailDecodeType decode_type)
Definition write.cc:644
void WriteDecodedThumbnailStream(FPDF_PAGE page, const char *pdf_name, int page_num)
Definition write.cc:838
void WriteRenderedImages(FPDF_DOCUMENT doc, FPDF_PAGE page, const char *pdf_name, int page_num)
Definition write.cc:802
void WriteBufferToFile(const void *buf, size_t buflen, const char *filename, const char *filetype)
Definition write.cc:673
ThumbnailDecodeType
Definition write.cc:642
void WriteRawThumbnailStream(FPDF_PAGE page, const char *pdf_name, int page_num)
Definition write.cc:868
std::vector< uint8_t > EncodeBitmapToPng(ScopedFPDFBitmap bitmap)
Definition write.cc:692
void WriteAnnot(FPDF_PAGE page, const char *pdf_name, int num)
Definition write.cc:339
void WriteImages(FPDF_PAGE page, const char *pdf_name, int page_num)
Definition write.cc:769
std::string WritePng(const char *pdf_name, int num, void *buffer, int stride, int width, int height)
Definition write.cc:451
void WriteThumbnail(FPDF_PAGE page, const char *pdf_name, int page_num)
Definition write.cc:896
void WriteText(FPDF_TEXTPAGE textpage, const char *pdf_name, int num)
Definition write.cc:310
std::string WritePpm(const char *pdf_name, int num, void *buffer_void, int stride, int width, int height)
Definition write.cc:259
void WriteAttachments(FPDF_DOCUMENT doc, const std::string &name)
Definition write.cc:714