Haru Free PDF Library
|
Functions | |
HPDF_Image | HPDF_LoadPngImageFromMem (HPDF_Doc pdf, const HPDF_BYTE *buf, HPDF_UINT size) |
Load PNG image from buffer. More... | |
HPDF_Image | HPDF_LoadPngImageFromFile (HPDF_Doc pdf, const char *filename) |
Load external PNG image file. More... | |
HPDF_Image | HPDF_LoadPngImageFromFile2 (HPDF_Doc pdf, const char *filename) |
Load external PNG image file. More... | |
HPDF_Image | HPDF_LoadJpegImageFromFile (HPDF_Doc pdf, const char *filename) |
Load external JPEG image file. More... | |
HPDF_Image | HPDF_LoadJpegImageFromMem (HPDF_Doc pdf, const HPDF_BYTE *buf, HPDF_UINT size) |
Load JPEG image from buffer. More... | |
HPDF_Image | HPDF_LoadRawImageFromFile (HPDF_Doc pdf, const char *filename, HPDF_UINT width, HPDF_UINT height, HPDF_ColorSpace color_space) |
Load raw format image. More... | |
HPDF_Image | HPDF_LoadRawImageFromMem (HPDF_Doc pdf, const HPDF_BYTE *buf, HPDF_UINT width, HPDF_UINT height, HPDF_ColorSpace color_space, HPDF_UINT bits_per_component) |
Load raw format image. More... | |
HPDF_Point | HPDF_Image_GetSize (HPDF_Image image) |
Get size of the image of an image object. More... | |
HPDF_STATUS | HPDF_Image_GetSize2 (HPDF_Image image, HPDF_Point *size) |
Get size of the image of an image object to parameter. More... | |
HPDF_UINT | HPDF_Image_GetWidth (HPDF_Image image) |
Get image width of an image object. More... | |
HPDF_UINT | HPDF_Image_GetHeight (HPDF_Image image) |
Get image height of an image object. More... | |
HPDF_UINT | HPDF_Image_GetBitsPerComponent (HPDF_Image image) |
Get bit count used to describe each color component. More... | |
const char * | HPDF_Image_GetColorSpace (HPDF_Image image) |
Get image color space name. More... | |
HPDF_STATUS | HPDF_Image_SetColorMask (HPDF_Image image, HPDF_UINT rmin, HPDF_UINT rmax, HPDF_UINT gmin, HPDF_UINT gmax, HPDF_UINT bmin, HPDF_UINT bmax) |
Sets transparent color of the image by the RGB range values. More... | |
HPDF_STATUS | HPDF_Image_SetMaskImage (HPDF_Image image, HPDF_Image mask_image) |
Set image mask. More... | |
Routines for image loading and measuring
HPDF_UINT HPDF_Image_GetBitsPerComponent | ( | HPDF_Image | image | ) |
Get bit count used to describe each color component.
image | Image object handle. |
0
. const char* HPDF_Image_GetColorSpace | ( | HPDF_Image | image | ) |
Get image color space name.
image | Image object handle. |
NULL
.HPDF_UINT HPDF_Image_GetHeight | ( | HPDF_Image | image | ) |
Get image height of an image object.
image | Image object handle. |
0
. HPDF_Point HPDF_Image_GetSize | ( | HPDF_Image | image | ) |
Get size of the image of an image object.
image | Image object handle. |
HPDF_Point{0, 0}
. HPDF_STATUS HPDF_Image_GetSize2 | ( | HPDF_Image | image, |
HPDF_Point * | size | ||
) |
Get size of the image of an image object to parameter.
In contrast with HPDF_Image_GetWidth() this function returns HPDF_OK on success and writes size value to size
parameter.
image | Image object handle. |
size | Variable to return size of image to. |
HPDF_UINT HPDF_Image_GetWidth | ( | HPDF_Image | image | ) |
Get image width of an image object.
image | Image object handle. |
0
. HPDF_STATUS HPDF_Image_SetColorMask | ( | HPDF_Image | image, |
HPDF_UINT | rmin, | ||
HPDF_UINT | rmax, | ||
HPDF_UINT | gmin, | ||
HPDF_UINT | gmax, | ||
HPDF_UINT | bmin, | ||
HPDF_UINT | bmax | ||
) |
Sets transparent color of the image by the RGB range values.
The color within the range is displayed as a transparent color. The image
must have RGB color space.
image | Image object handle. |
rmin,rmax | Lower and upper limits of red color. Must be in a range 0 and 255 . |
gmin,gmax | Lower and upper limits of green color. Must be in a range 0 and 255 . |
bmin,bmax | Lower and upper limits of blue color. Must be in a range 0 and 255 . |
HPDF_STATUS HPDF_Image_SetMaskImage | ( | HPDF_Image | image, |
HPDF_Image | mask_image | ||
) |
Set image mask.
image | Image object handle. |
mask_image | Specify image object handle which is used as image mask. This image must be 1-bit gray-scale color image. |
HPDF_Image HPDF_LoadJpegImageFromFile | ( | HPDF_Doc | pdf, |
const char * | filename | ||
) |
Load external JPEG image file.
Document object handle. | |
filename | Path to JPEG image file. |
NULL
and calls error handler.HPDF_Image HPDF_LoadJpegImageFromMem | ( | HPDF_Doc | pdf, |
const HPDF_BYTE * | buf, | ||
HPDF_UINT | size | ||
) |
Load JPEG image from buffer.
Document object handle. | |
buf | Pointer to the image data. |
size | Size of the data in buffer. |
NULL
and calls error handler.HPDF_Image HPDF_LoadPngImageFromFile | ( | HPDF_Doc | pdf, |
const char * | filename | ||
) |
Load external PNG image file.
Document object handle. | |
filename | Path to PNG image file. |
NULL
and calls error handler.HPDF_Image HPDF_LoadPngImageFromFile2 | ( | HPDF_Doc | pdf, |
const char * | filename | ||
) |
Load external PNG image file.
Unlike HPDF_LoadPngImageFromFile(), HPDF_LoadPngImageFromFile2() does not load all the data immediately (only size and color properties are loaded). The main data are loaded just before the image object is written to PDF, and then loaded data is deleted.
Document object handle. | |
filename | Path to PNG image file. |
NULL
and calls error handler.HPDF_Image HPDF_LoadPngImageFromMem | ( | HPDF_Doc | pdf, |
const HPDF_BYTE * | buf, | ||
HPDF_UINT | size | ||
) |
Load PNG image from buffer.
Document object handle. | |
buf | Pointer to the image data. |
size | Size of the data in buffer. |
NULL
and calls error handler.HPDF_Image HPDF_LoadRawImageFromFile | ( | HPDF_Doc | pdf, |
const char * | filename, | ||
HPDF_UINT | width, | ||
HPDF_UINT | height, | ||
HPDF_ColorSpace | color_space | ||
) |
Load raw format image.
This function loads image data from file without any conversion, it is usually faster than the other functions.
Document object handle. | |
filename | Path to image file |
width | Width of image file |
height | Height of image file |
color_space | One of HPDF_CS_DEVICE_GRAY, HPDF_CS_DEVICE_RGB or HPDF_CS_DEVICE_CMYK values. |
NULL
and call error handler.HPDF_Image HPDF_LoadRawImageFromMem | ( | HPDF_Doc | pdf, |
const HPDF_BYTE * | buf, | ||
HPDF_UINT | width, | ||
HPDF_UINT | height, | ||
HPDF_ColorSpace | color_space, | ||
HPDF_UINT | bits_per_component | ||
) |
Load raw format image.
This function loads image data from buffer without any conversion, it is usually faster than the other functions.
Document object handle. | |
buf | Pointer to image data |
width | Width of image file |
height | Height of image file |
color_space | One of HPDF_CS_DEVICE_GRAY, HPDF_CS_DEVICE_RGB or HPDF_CS_DEVICE_CMYK values. |
bits_per_component | Bit size of each color component. Valid values are 1, 2, 4 and 8. |
NULL
and call error handler.