Hpdf::Image
Inherits Hpdf::Helper / Reference / Object
The image is used to display image to a page mainly. To create/load an image use:
- PNG
Doc#load_png_image_from_fileorDoc#load_png_image - JPEG
Doc#load_jpeg_image_from_fileorDoc#load_jpeg_image - RAW
Doc#load_raw_image_from_file,Doc#load_raw_image_from_mem, orDoc#load_raw1_bit_image
Constructors
new(image : LibHaru::Image, doc : Doc)
SourceInstance methods
color_space
gets the name of the image's color space.
Usually one of "DeviceGray", "DeviceRGB", "DeviceCMYK" or
"Indexed".
mask_image=(mask : Image)
sets the mask image.
- mask image object which is used as image-mask. This image must be 1bit gray-scale color image.
set_color_mask(*, rmin : UInt8 = 0, rmax : UInt8 = 0, gmin : UInt8 = 0, gmax : UInt8 = 0, bmin : UInt8 = 0, bmax : UInt8 = 0)
sets the transparent color of the image by the RGB range values. The color within the range is displayed as a transparent color. The Image must be RGB color space.
- rmin lower limit of Red. It must be between
0and255. - rmax upper limit of Red. It must be between
0and255. - gmin lower limit of Green. It must be between
0and255. - gmax upper limit of Green. It must be between
0and255. - bmin lower limit of Blue. It must be between
0and255. - bmax upper limit of Blue. It must be between
0and255.
size2
gets the size of the image via an out-parameter variant of #size.
Both methods return the same value; this one exists for completeness.
smask=(smask : Image)
attaches a soft-mask image to this image for per-pixel opacity control. The soft mask must be a grayscale image: white = fully opaque, black = fully transparent.
- smask the grayscale
Imageto use as a soft mask.
to_unsafe
Source