class

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_file or Doc#load_png_image
  • JPEG Doc#load_jpeg_image_from_file or Doc#load_jpeg_image
  • RAW Doc#load_raw_image_from_file, Doc#load_raw_image_from_mem, or Doc#load_raw1_bit_image

Constructors

new(image : LibHaru::Image, doc : Doc)
Source

Instance methods

bits_per_component

gets the number of bits used to describe each color component.

Source
color_space

gets the name of the image's color space. Usually one of "DeviceGray", "DeviceRGB", "DeviceCMYK" or "Indexed".

Source
height

gets the height of the image of an image object.

Source
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.
Source
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 0 and 255.
  • rmax upper limit of Red. It must be between 0 and 255.
  • gmin lower limit of Green. It must be between 0 and 255.
  • gmax upper limit of Green. It must be between 0 and 255.
  • bmin lower limit of Blue. It must be between 0 and 255.
  • bmax upper limit of Blue. It must be between 0 and 255.
Source
size

gets the size of the image of an image object.

Source
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.

Source
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 Image to use as a soft mask.
Source
to_unsafe
Source
width

gets the width of the image of an image object.

Source