#include <PdfImage.h>
|
| PdfColorSpace | GetColorSpace () const |
| void | SetICCProfile (InputStream &stream, unsigned colorComponents, PdfColorSpace alternateColorSpace=PdfColorSpace::DeviceRGB) |
| void | SetSoftMask (const PdfImage &softmask) |
| unsigned | GetWidth () const |
| unsigned | GetHeight () const |
| void | SetData (const bufferview &buffer, unsigned width, unsigned height, PdfPixelFormat format, int rowSize=-1) |
| void | SetData (InputStream &stream, unsigned width, unsigned height, PdfPixelFormat format, int rowSize=-1) |
| void | SetDataRaw (const bufferview &buffer, const PdfImageInfo &info) |
| void | SetDataRaw (InputStream &stream, const PdfImageInfo &info) |
| void | Load (const std::string_view &filepath, unsigned imageIndex=0) |
| void | LoadFromBuffer (const bufferview &buffer, unsigned imageIndex=0) |
| void | SetChromaKeyMask (int64_t r, int64_t g, int64_t b, int64_t threshold=0) |
| void | SetInterpolate (bool value) |
| const PdfName & | GetIdentifier () const |
A PdfImage object is needed when ever you want to embedd 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
- See also
- GetImageReference
-
PdfPainter::DrawImage
◆ GetColorSpace()
Get the color space of the image
- Returns
- the color space of the image
◆ GetHeight()
| unsigned PdfImage::GetHeight |
( |
| ) |
const |
Get the height of the image when drawn in PDF units
- Returns
- the height in PDF units
◆ GetWidth()
| unsigned PdfImage::GetWidth |
( |
| ) |
const |
Get the width of the image when drawn in PDF units
- Returns
- the width in PDF units
◆ Load()
| void PdfImage::Load |
( |
const std::string_view & | filepath, |
|
|
unsigned | imageIndex = 0 ) |
Load the image data from bytes
- Parameters
-
| imageIndex | image index to be fed to multi image/page formats (eg. TIFF). Ignored by the other formats |
◆ LoadFromBuffer()
| void PdfImage::LoadFromBuffer |
( |
const bufferview & | buffer, |
|
|
unsigned | imageIndex = 0 ) |
Load the image data from bytes
- Parameters
-
| imageIndex | image index to be fed to multi image/page formats (eg. TIFF). Ignored by the other formats |
◆ SetChromaKeyMask()
| 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.
- Parameters
-
| 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)] |
◆ SetData() [1/2]
| void PdfImage::SetData |
( |
const bufferview & | buffer, |
|
|
unsigned | width, |
|
|
unsigned | height, |
|
|
PdfPixelFormat | format, |
|
|
int | rowSize = -1 ) |
Set the actual image data from a buffer
- Parameters
-
| 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 |
◆ SetData() [2/2]
Set the actual image data from an input stream
- Parameters
-
| 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 |
◆ SetDataRaw() [1/2]
| void PdfImage::SetDataRaw |
( |
const bufferview & | buffer, |
|
|
const PdfImageInfo & | info ) |
Set the actual image encoded data from a buffer
- Parameters
-
| buffer | buffer supplying image data |
| info | parameters describing the encoded image data |
◆ SetDataRaw() [2/2]
| void PdfImage::SetDataRaw |
( |
InputStream & | stream, |
|
|
const PdfImageInfo & | info ) |
Set the actual image encoded data from an input stream.
- Parameters
-
| stream | stream supplying encoded image data |
| info | parameters describing the encoded image data |
◆ SetICCProfile()
| void PdfImage::SetICCProfile |
( |
InputStream & | stream, |
|
|
unsigned | colorComponents, |
|
|
PdfColorSpace | alternateColorSpace = PdfColorSpace::DeviceRGB ) |
Set an ICC profile for this image.
- Parameters
-
| stream | an input stream from which the ICC profiles data can be read |
| colorComponents | the number of colorcomponents of the ICC profile |
| alternateColorSpace | an alternate colorspace to use if the ICC profile cannot be used |
- See also
- SetImageColorSpace to set an colorspace instead of an ICC profile for this image
◆ SetInterpolate()
| 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.
- Parameters
-
| value | whether the image should be interpolated |
◆ SetSoftMask()
| void PdfImage::SetSoftMask |
( |
const PdfImage & | softmask | ) |
|
Set a softmask for this image.
- Parameters
-
| pSoftmask | a PdfImage pointer to the image, which is to be set as softmask, must be 8-Bit-Grayscale |