|
PoDoFo 1.2.0
|
A PdfImage object is needed when ever you want to embed an image file into a PDF document. More...
#include <PdfImage.h>
Public Member Functions | |
| void | DecodeTo (charbuff &buff, PdfPixelFormat format, int scanLineSize=-1) const |
| void | DecodeTo (const bufferspan &buff, PdfPixelFormat format, int scanLineSize=-1) const |
| void | DecodeTo (OutputStream &stream, PdfPixelFormat format, int scanLineSize=-1) const |
| charbuff | GetDecodedCopy (PdfPixelFormat format) |
| bool | TryFetchRawImageInfo (PdfImageInfo &info) |
| Try read image info, when available as read from internal image codecs (eg. | |
| void | SetSoftMask (const PdfImage &softmask) |
| Set a softmask for this image. | |
| void | SetData (const bufferview &buffer, unsigned width, unsigned height, PdfPixelFormat format, int rowSize=-1) |
| Set the actual image data from a buffer. | |
| void | SetData (InputStream &stream, unsigned width, unsigned height, PdfPixelFormat format, int rowSize=-1) |
| Set the actual image data from an input stream. | |
| void | SetDataRaw (const bufferview &buffer, const PdfImageInfo &info) |
| Set the actual image encoded data from a buffer. | |
| void | SetDataRaw (InputStream &stream, const PdfImageInfo &info) |
| Set the actual image encoded data from an input stream. | |
| PdfImageInfo | Load (const std::string_view &filepath, const PdfImageLoadParams ¶ms={ }) |
| Load the image data from a file. | |
| PdfImageInfo | LoadFromBuffer (const bufferview &buffer, const PdfImageLoadParams ¶ms={ }) |
| Load the image data from bytes. | |
| void | ExportTo (charbuff &buff, PdfExportFormat format, PdfArray args={}) const |
| void | SetChromaKeyMask (int64_t r, int64_t g, int64_t b, int64_t threshold=0) |
| Set an color/chroma-key mask on an image. | |
| void | SetInterpolate (bool value) |
| Apply an interpolation to the image if the source resolution is lower than the resolution of the output device. | |
| Rect | GetRect () const override |
| const PdfColorSpaceFilter & | GetColorSpace () const |
| Get the color space of the image. | |
| unsigned | GetWidth () const |
| Get the width of the image when drawn in PDF units. | |
| unsigned | GetHeight () const |
| Get the height of the image when drawn in PDF units. | |
| Public Member Functions inherited from PoDoFo::PdfXObject | |
| virtual const Matrix & | GetMatrix () const |
| PdfXObjectType | GetType () const |
Protected Member Functions | |
| PdfXObjectForm * | getForm () const override |
Friends | |
| class | PdfXObject |
| class | PdfDocument |
Additional Inherited Members | |
| Static Public Member Functions inherited from PoDoFo::PdfXObject | |
| static bool | TryCreateFromObject (PdfObject &obj, std::unique_ptr< PdfXObject > &xobj) |
| static bool | TryCreateFromObject (const PdfObject &obj, std::unique_ptr< const PdfXObject > &xobj) |
| template<typename XObjectT> | |
| static bool | TryCreateFromObject (PdfObject &obj, std::unique_ptr< XObjectT > &xobj) |
| template<typename XObjectT> | |
| static bool | TryCreateFromObject (const PdfObject &obj, std::unique_ptr< const XObjectT > &xobj) |
A PdfImage object is needed when ever you want to embed an image file into a PDF document.
The PdfImage object is embedded once and can be drawn as often as you want on any page in the document using PdfPainter
|
inline |
Get the color space of the image.
|
overrideprotectedvirtual |
Reimplemented from PoDoFo::PdfXObject.
|
inline |
Get the height of the image when drawn in PDF units.
|
overridevirtual |
Implements PoDoFo::PdfXObject.
|
inline |
Get the width of the image when drawn in PDF units.
| PdfImageInfo PdfImage::Load | ( | const std::string_view & | filepath, |
| const PdfImageLoadParams & | params = { } ) |
Load the image data from a file.
| filepath | path to the image file |
| params | parameters like index to be fed to multi image/page formats (eg. TIFF) |
| PdfImageInfo PdfImage::LoadFromBuffer | ( | const bufferview & | buffer, |
| const PdfImageLoadParams & | params = { } ) |
Load the image data from bytes.
| buffer | buffer containing the image data |
| params | parameters like index to be fed to multi image/page formats (eg. TIFF) |
| void PdfImage::SetChromaKeyMask | ( | int64_t | r, |
| int64_t | g, | ||
| int64_t | b, | ||
| int64_t | threshold = 0 ) |
Set an color/chroma-key mask on an image.
The masked color will not be painted, i.e. masked as being transparent.
| r | red RGB value of color that should be masked |
| g | green RGB value of color that should be masked |
| b | blue RGB value of color that should be masked |
| threshold | colors are masked that are in the range [(r-threshold, r+threshold),(g-threshold, g+threshold),(b-threshold, b+threshold)] |
| void PdfImage::SetData | ( | const bufferview & | buffer, |
| unsigned | width, | ||
| unsigned | height, | ||
| PdfPixelFormat | format, | ||
| int | rowSize = -1 ) |
Set the actual image data from a buffer.
| buffer | buffer supplying image data |
| width | width of the image in pixels |
| height | height of the image in pixels |
| format | pixel format of the bitmap |
| rowSize | length of the row, if negative the default is used |
| void PdfImage::SetData | ( | InputStream & | stream, |
| unsigned | width, | ||
| unsigned | height, | ||
| PdfPixelFormat | format, | ||
| int | rowSize = -1 ) |
Set the actual image data from an input stream.
| stream | stream supplying raw image data |
| width | width of the image in pixels |
| height | height of the image in pixels |
| format | pixel format of the bitmap |
| rowSize | length of the row, if negative the default is used |
| void PdfImage::SetDataRaw | ( | const bufferview & | buffer, |
| const PdfImageInfo & | info ) |
Set the actual image encoded data from a buffer.
| buffer | buffer supplying image data |
| info | parameters describing the encoded image data |
| void PdfImage::SetDataRaw | ( | InputStream & | stream, |
| const PdfImageInfo & | info ) |
Set the actual image encoded data from an input stream.
| stream | stream supplying encoded image data |
| info | parameters describing the encoded image data |
| void PdfImage::SetInterpolate | ( | bool | value | ) |
Apply an interpolation to the image if the source resolution is lower than the resolution of the output device.
Default is false.
| value | whether the image should be interpolated |
| void PdfImage::SetSoftMask | ( | const PdfImage & | softmask | ) |
Set a softmask for this image.
| softmask | the image to be set as softmask, must be 8-Bit-Grayscale |
| bool PdfImage::TryFetchRawImageInfo | ( | PdfImageInfo & | info | ) |
Try read image info, when available as read from internal image codecs (eg.
the actual color space of a /DCTDecode image)