10 #include "PdfXObject.h"
12 #include "PdfColorSpace.h"
14 #ifdef PODOFO_HAVE_JPEG_LIB
15 struct jpeg_decompress_struct;
23 struct PODOFO_API PdfImageInfo final
29 nullable<PdfFilterList> Filters;
30 unsigned char BitsPerComponent = 0;
31 PdfColorSpaceInitializer ColorSpace;
32 std::vector<double> DecodeArray;
67 void SetSoftMask(
const PdfImage& softmask);
78 void SetData(
const bufferview& buffer,
unsigned width,
unsigned height,
89 void SetData(
InputStream& stream,
unsigned width,
unsigned height,
97 void SetDataRaw(
const bufferview& buffer,
const PdfImageInfo& info);
104 void SetDataRaw(
InputStream& stream,
const PdfImageInfo& info);
110 void Load(
const std::string_view& filepath,
unsigned imageIndex = 0);
116 void LoadFromBuffer(
const bufferview& buffer,
unsigned imageIndex = 0);
128 void SetChromaKeyMask(int64_t r, int64_t g, int64_t b, int64_t threshold = 0);
136 void SetInterpolate(
bool value);
138 Rect GetRect()
const override;
164 #ifdef PODOFO_HAVE_JPEG_LIB
165 void loadFromJpegInfo(jpeg_decompress_struct& ctx, PdfImageInfo& info);
170 void loadFromJpeg(
const std::string_view& filename);
176 void loadFromJpegData(
const unsigned char* data,
size_t len);
179 #ifdef PODOFO_HAVE_TIFF_LIB
180 void loadFromTiffHandle(
void* handle,
unsigned imageIndex);
184 void loadFromTiff(
const std::string_view& filename,
unsigned imageIndex);
190 void loadFromTiffData(
const unsigned char* data,
size_t len,
unsigned imageIndex);
193 #ifdef PODOFO_HAVE_PNG_LIB
194 void loadFromPngHandle(FILE* stream);
198 void loadFromPng(
const std::string_view& filename);
204 void loadFromPngData(
const unsigned char* data,
size_t len);
211 unsigned m_BitsPerComponent;
An interface for writing blocks of data to a data source.
Definition: OutputStream.h:18
This class represents a PdfArray Use it for all arrays that are written to a PDF file.
Definition: PdfArray.h:81
A class that implements methods to sample colors from a scanline buffer.
Definition: PdfColorSpaceFilter.h:31
PdfDocument is the core interface for working with PDF documents.
Definition: PdfDocument.h:108
A PdfImage object is needed when ever you want to embed an image file into a PDF document.
Definition: PdfImage.h:44
const PdfColorSpaceFilter & GetColorSpace() const
Get the color space of the image.
Definition: PdfImage.h:143
unsigned GetWidth() const
Get the width of the image when drawn in PDF units.
Definition: PdfImage.h:148
unsigned GetHeight() const
Get the height of the image when drawn in PDF units.
Definition: PdfImage.h:153
This class represents a PDF indirect Object in memory.
Definition: PdfObject.h:35
A XObject is a content stream with several drawing commands and data which can be used throughout a P...
Definition: PdfXObject.h:30
A rectangle defined by position and size.
Definition: Rect.h:20
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition: basetypes.h:38
SPDX-FileCopyrightText: (C) 2022 Francesco Pretto ceztko@gmail.com SPDX-License-Identifier: LGPL-2....
Definition: basetypes.h:16
@ Width
The glyph is accessed in the widths arrays (/Widths, /W1 keys)
std::shared_ptr< const PdfColorSpaceFilter > PdfColorSpaceFilterPtr
Convenience alias for a constant PdfColorSpaceFilter shared ptr.
Definition: PdfColorSpaceFilter.h:77
PdfExportFormat
Definition: PdfDeclarations.h:212
mspan< char > bufferspan
Convenient writable char buffer span.
Definition: basetypes.h:23
cspan< char > bufferview
Convenient read-only char buffer span.
Definition: basetypes.h:19
PdfPixelFormat
Definition: PdfDeclarations.h:346